0 JBC
↳1 JBCToGraph (⇒, 619 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 15 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇒, 6 ms)
↳8 AND
↳9 intTRS
↳10 PolynomialOrderProcessor (⇔, 0 ms)
↳11 YES
↳12 intTRS
↳13 PolynomialOrderProcessor (⇔, 0 ms)
↳14 YES
/**
* Example taken from "A Term Rewriting Approach to the Automated Termination
* Analysis of Imperative Programs" (http://www.cs.unm.edu/~spf/papers/2009-02.pdf)
* and converted to Java.
*/
public class PastaB18 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
while (x > 0 && y > 0) {
if (x > y) {
while (x > 0) {
x--;
}
} else {
while (y > 0) {
y--;
}
}
}
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
Generated rules. Obtained 32 IRules
P rules:
f370_0_main_LE(EOS, i60, i50, i60) → f379_0_main_LE(EOS, i60, i50, i60)
f379_0_main_LE(EOS, i60, i50, i60) → f399_0_main_Load(EOS, i60, i50) | >(i60, 0)
f399_0_main_Load(EOS, i60, i50) → f412_0_main_LE(EOS, i60, i50, i50)
f412_0_main_LE(EOS, i60, i68, i68) → f421_0_main_LE(EOS, i60, i68, i68)
f421_0_main_LE(EOS, i60, i68, i68) → f446_0_main_Load(EOS, i60, i68) | >(i68, 0)
f446_0_main_Load(EOS, i60, i68) → f461_0_main_Load(EOS, i60, i68, i60)
f461_0_main_Load(EOS, i60, i68, i60) → f474_0_main_LE(EOS, i60, i68, i60, i68)
f474_0_main_LE(EOS, i60, i68, i60, i68) → f486_0_main_LE(EOS, i60, i68, i60, i68)
f474_0_main_LE(EOS, i60, i68, i60, i68) → f487_0_main_LE(EOS, i60, i68, i60, i68)
f486_0_main_LE(EOS, i60, i68, i60, i68) → f503_0_main_Load(EOS, i60, i68) | <=(i60, i68)
f503_0_main_Load(EOS, i60, i68) → f571_0_main_Load(EOS, i60, i68)
f571_0_main_Load(EOS, i60, i88) → f602_0_main_LE(EOS, i60, i88, i88)
f602_0_main_LE(EOS, i60, matching1, matching2) → f613_0_main_LE(EOS, i60, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
f602_0_main_LE(EOS, i60, i104, i104) → f614_0_main_LE(EOS, i60, i104, i104)
f613_0_main_LE(EOS, i60, matching1, matching2) → f652_0_main_Load(EOS, i60, 0) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f652_0_main_Load(EOS, i60, matching1) → f361_0_main_Load(EOS, i60, 0) | =(matching1, 0)
f361_0_main_Load(EOS, i18, i50) → f370_0_main_LE(EOS, i18, i50, i18)
f614_0_main_LE(EOS, i60, i104, i104) → f654_0_main_Inc(EOS, i60, i104) | >(i104, 0)
f654_0_main_Inc(EOS, i60, i104) → f1134_0_main_JMP(EOS, i60, +(i104, -1)) | >(i104, 0)
f1134_0_main_JMP(EOS, i60, i219) → f1376_0_main_Load(EOS, i60, i219)
f1376_0_main_Load(EOS, i60, i219) → f571_0_main_Load(EOS, i60, i219)
f487_0_main_LE(EOS, i60, i68, i60, i68) → f505_0_main_Load(EOS, i60, i68) | >(i60, i68)
f505_0_main_Load(EOS, i60, i68) → f593_0_main_Load(EOS, i60, i68)
f593_0_main_Load(EOS, i94, i68) → f607_0_main_LE(EOS, i94, i68, i94)
f607_0_main_LE(EOS, matching1, i68, matching2) → f617_0_main_LE(EOS, 0, i68, 0) | &&(=(matching1, 0), =(matching2, 0))
f607_0_main_LE(EOS, i105, i68, i105) → f618_0_main_LE(EOS, i105, i68, i105)
f617_0_main_LE(EOS, matching1, i68, matching2) → f665_0_main_Load(EOS, 0, i68) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f665_0_main_Load(EOS, matching1, i68) → f361_0_main_Load(EOS, 0, i68) | =(matching1, 0)
f618_0_main_LE(EOS, i105, i68, i105) → f668_0_main_Inc(EOS, i105, i68) | >(i105, 0)
f668_0_main_Inc(EOS, i105, i68) → f1373_0_main_JMP(EOS, +(i105, -1), i68) | >(i105, 0)
f1373_0_main_JMP(EOS, i277, i68) → f1379_0_main_Load(EOS, i277, i68)
f1379_0_main_Load(EOS, i277, i68) → f593_0_main_Load(EOS, i277, i68)
Combined rules. Obtained 6 IRules
P rules:
f370_0_main_LE(EOS, x0, x1, x0) → f602_0_main_LE(EOS, x0, x1, x1) | &&(&&(>=(x1, x0), >(x0, 0)), >(x1, 0))
f602_0_main_LE(EOS, x0, 0, 0) → f370_0_main_LE(EOS, x0, 0, x0)
f602_0_main_LE(EOS, x0, x1, x1) → f602_0_main_LE(EOS, x0, -(x1, 1), -(x1, 1)) | >(x1, 0)
f370_0_main_LE(EOS, x0, x1, x0) → f607_0_main_LE(EOS, x0, x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <(x1, x0))
f607_0_main_LE(EOS, 0, x1, 0) → f370_0_main_LE(EOS, 0, x1, 0)
f607_0_main_LE(EOS, x0, x1, x0) → f607_0_main_LE(EOS, -(x0, 1), x1, -(x0, 1)) | >(x0, 0)
Filtered ground terms:
f370_0_main_LE(x1, x2, x3, x4) → f370_0_main_LE(x2, x3, x4)
Cond_f370_0_main_LE(x1, x2, x3, x4, x5) → Cond_f370_0_main_LE(x1, x3, x4, x5)
f602_0_main_LE(x1, x2, x3, x4) → f602_0_main_LE(x2, x3, x4)
Cond_f602_0_main_LE(x1, x2, x3, x4, x5) → Cond_f602_0_main_LE(x1, x3, x4, x5)
Cond_f370_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f370_0_main_LE1(x1, x3, x4, x5)
f607_0_main_LE(x1, x2, x3, x4) → f607_0_main_LE(x2, x3, x4)
Cond_f607_0_main_LE(x1, x2, x3, x4, x5) → Cond_f607_0_main_LE(x1, x3, x4, x5)
Filtered duplicate terms:
f370_0_main_LE(x1, x2, x3) → f370_0_main_LE(x2, x3)
Cond_f370_0_main_LE(x1, x2, x3, x4) → Cond_f370_0_main_LE(x1, x3, x4)
f602_0_main_LE(x1, x2, x3) → f602_0_main_LE(x1, x3)
Cond_f602_0_main_LE(x1, x2, x3, x4) → Cond_f602_0_main_LE(x1, x2, x4)
Cond_f370_0_main_LE1(x1, x2, x3, x4) → Cond_f370_0_main_LE1(x1, x3, x4)
f607_0_main_LE(x1, x2, x3) → f607_0_main_LE(x2, x3)
Cond_f607_0_main_LE(x1, x2, x3, x4) → Cond_f607_0_main_LE(x1, x3, x4)
Prepared 6 rules for path length conversion:
P rules:
f370_0_main_LE(x1, x0) → f602_0_main_LE(x0, x1) | &&(&&(>=(x1, x0), >(x0, 0)), >(x1, 0))
f602_0_main_LE(x0, 0) → f370_0_main_LE(0, x0)
f602_0_main_LE(x0, x1) → f602_0_main_LE(x0, -(x1, 1)) | >(x1, 0)
f370_0_main_LE(x1, x0) → f607_0_main_LE(x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <(x1, x0))
f607_0_main_LE(x1, 0) → f370_0_main_LE(x1, 0)
f607_0_main_LE(x1, x0) → f607_0_main_LE(x1, -(x0, 1)) | >(x0, 0)
Finished conversion. Obtained 6 rules.
P rules:
f370_0_main_LE(x0, x1) → f602_0_main_LE(x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <=(x1, x0))
f602_0_main_LE(x2, c0) → f370_0_main_LE(0, x2) | =(0, c0)
f602_0_main_LE(x3, x4) → f602_0_main_LE(x3, -(x4, 1)) | >(x4, 0)
f370_0_main_LE(x5, x6) → f607_0_main_LE(x5, x6) | &&(&&(>(x6, x5), >(x5, 0)), >(x6, 0))
f607_0_main_LE(x7, c0) → f370_0_main_LE(x7, 0) | =(0, c0)
f607_0_main_LE(x8, x9) → f607_0_main_LE(x8, -(x9, 1)) | >(x9, 0)
Constructed the termination graph and obtained 2 non-trivial SCCs.
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped:
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: