0 JBC
↳1 JBCToGraph (⇒, 627 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 32 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇒, 0 ms)
↳8 intTRS
↳9 LinearRankingProcessor (⇔, 0 ms)
↳10 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 PastaC3 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z = Random.random();
while (x < y) {
if (x < z) {
x++;
} else {
z++;
}
}
}
}
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 16 IRules
P rules:
f634_0_main_Load(EOS, i18, i45, i92, i18) → f646_0_main_GE(EOS, i18, i45, i92, i18, i45)
f646_0_main_GE(EOS, i18, i45, i92, i18, i45) → f667_0_main_GE(EOS, i18, i45, i92, i18, i45)
f667_0_main_GE(EOS, i18, i45, i92, i18, i45) → f679_0_main_Load(EOS, i18, i45, i92) | <(i18, i45)
f679_0_main_Load(EOS, i18, i45, i92) → f687_0_main_Load(EOS, i18, i45, i92, i18)
f687_0_main_Load(EOS, i18, i45, i92, i18) → f703_0_main_GE(EOS, i18, i45, i92, i18, i92)
f703_0_main_GE(EOS, i18, i45, i92, i18, i92) → f718_0_main_GE(EOS, i18, i45, i92, i18, i92)
f703_0_main_GE(EOS, i18, i45, i92, i18, i92) → f719_0_main_GE(EOS, i18, i45, i92, i18, i92)
f718_0_main_GE(EOS, i18, i45, i92, i18, i92) → f733_0_main_Inc(EOS, i18, i45, i92) | >=(i18, i92)
f733_0_main_Inc(EOS, i18, i45, i92) → f748_0_main_JMP(EOS, i18, i45, +(i92, 1)) | >=(i92, 0)
f748_0_main_JMP(EOS, i18, i45, i110) → f804_0_main_Load(EOS, i18, i45, i110)
f804_0_main_Load(EOS, i18, i45, i110) → f622_0_main_Load(EOS, i18, i45, i110)
f622_0_main_Load(EOS, i18, i45, i92) → f634_0_main_Load(EOS, i18, i45, i92, i18)
f719_0_main_GE(EOS, i18, i45, i92, i18, i92) → f735_0_main_Inc(EOS, i18, i45, i92) | <(i18, i92)
f735_0_main_Inc(EOS, i18, i45, i92) → f750_0_main_JMP(EOS, +(i18, 1), i45, i92) | >=(i18, 0)
f750_0_main_JMP(EOS, i111, i45, i92) → f812_0_main_Load(EOS, i111, i45, i92)
f812_0_main_Load(EOS, i111, i45, i92) → f622_0_main_Load(EOS, i111, i45, i92)
Combined rules. Obtained 2 IRules
P rules:
f634_0_main_Load(EOS, x0, x1, x2, x0) → f634_0_main_Load(EOS, x0, x1, +(x2, 1), x0) | &&(&&(>(+(x2, 1), 0), >(x1, x0)), <=(x2, x0))
f634_0_main_Load(EOS, x0, x1, x2, x0) → f634_0_main_Load(EOS, +(x0, 1), x1, x2, +(x0, 1)) | &&(&&(>(x2, x0), >(+(x0, 1), 0)), >(x1, x0))
Filtered ground terms:
f634_0_main_Load(x1, x2, x3, x4, x5) → f634_0_main_Load(x2, x3, x4, x5)
Cond_f634_0_main_Load(x1, x2, x3, x4, x5, x6) → Cond_f634_0_main_Load(x1, x3, x4, x5, x6)
Cond_f634_0_main_Load1(x1, x2, x3, x4, x5, x6) → Cond_f634_0_main_Load1(x1, x3, x4, x5, x6)
Filtered duplicate terms:
f634_0_main_Load(x1, x2, x3, x4) → f634_0_main_Load(x2, x3, x4)
Cond_f634_0_main_Load(x1, x2, x3, x4, x5) → Cond_f634_0_main_Load(x1, x3, x4, x5)
Cond_f634_0_main_Load1(x1, x2, x3, x4, x5) → Cond_f634_0_main_Load1(x1, x3, x4, x5)
Prepared 2 rules for path length conversion:
P rules:
f634_0_main_Load(x1, x2, x0) → f634_0_main_Load(x1, +(x2, 1), x0) | &&(&&(>(+(x2, 1), 0), >(x1, x0)), <=(x2, x0))
f634_0_main_Load(x1, x2, x0) → f634_0_main_Load(x1, x2, +(x0, 1)) | &&(&&(>(x2, x0), >(+(x0, 1), 0)), >(x1, x0))
Finished conversion. Obtained 2 rules.
P rules:
f634_0_main_Load(x0, x1, x2) → f634_0_main_Load(x0, +(x1, 1), x2) | &&(&&(>=(x2, x1), >(x1, -1)), <(x2, x0))
f634_0_main_Load(x3, x4, x5) → f634_0_main_Load(x3, x4, +(x5, 1)) | &&(&&(>(x5, -1), <(x5, x3)), <(x5, x4))
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped:
Linear ranking:
where x = (x1, ... ,xn).
Therefore the following rule(s) have been dropped: