0 JBC
↳1 JBCToGraph (⇒, 434 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 89 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇒, 0 ms)
↳8 intTRS
↳9 PolynomialOrderProcessor (⇔, 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 PastaC1 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
while (x >= 0) {
int y = 1;
while (x > y) {
y = 2*y;
}
x--;
}
}
}
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 24 IRules
P rules:
f295_0_main_LT(EOS, i38, i38) → f310_0_main_LT(EOS, i38, i38)
f310_0_main_LT(EOS, i38, i38) → f320_0_main_ConstantStackPush(EOS, i38) | >=(i38, 0)
f320_0_main_ConstantStackPush(EOS, i38) → f328_0_main_Store(EOS, i38, 1)
f328_0_main_Store(EOS, i38, matching1) → f334_0_main_Load(EOS, i38, 1) | =(matching1, 1)
f334_0_main_Load(EOS, i38, matching1) → f691_0_main_Load(EOS, i38, 1) | =(matching1, 1)
f691_0_main_Load(EOS, i71, i72) → f827_0_main_Load(EOS, i71, i72)
f827_0_main_Load(EOS, i71, i93) → f946_0_main_Load(EOS, i71, i93)
f946_0_main_Load(EOS, i71, i110) → f1196_0_main_Load(EOS, i71, i110)
f1196_0_main_Load(EOS, i71, i129) → f1199_0_main_Load(EOS, i71, i129, i71)
f1199_0_main_Load(EOS, i71, i129, i71) → f1201_0_main_LE(EOS, i71, i129, i71, i129)
f1201_0_main_LE(EOS, i71, i129, i71, i129) → f1204_0_main_LE(EOS, i71, i129, i71, i129)
f1201_0_main_LE(EOS, i71, i129, i71, i129) → f1205_0_main_LE(EOS, i71, i129, i71, i129)
f1204_0_main_LE(EOS, i71, i129, i71, i129) → f1207_0_main_Inc(EOS, i71) | <=(i71, i129)
f1207_0_main_Inc(EOS, i71) → f1211_0_main_JMP(EOS, +(i71, -1)) | >=(i71, 0)
f1211_0_main_JMP(EOS, i131) → f1220_0_main_Load(EOS, i131)
f1220_0_main_Load(EOS, i131) → f278_0_main_Load(EOS, i131)
f278_0_main_Load(EOS, i29) → f295_0_main_LT(EOS, i29, i29)
f1205_0_main_LE(EOS, i71, i129, i71, i129) → f1209_0_main_ConstantStackPush(EOS, i71, i129) | >(i71, i129)
f1209_0_main_ConstantStackPush(EOS, i71, i129) → f1213_0_main_Load(EOS, i71, i129, 2)
f1213_0_main_Load(EOS, i71, i129, matching1) → f1222_0_main_IntArithmetic(EOS, i71, 2, i129) | =(matching1, 2)
f1222_0_main_IntArithmetic(EOS, i71, matching1, i129) → f1420_0_main_Store(EOS, i71, *(2, i129)) | &&(>=(i129, 1), =(matching1, 2))
f1420_0_main_Store(EOS, i71, i147) → f1422_0_main_JMP(EOS, i71, i147)
f1422_0_main_JMP(EOS, i71, i147) → f1429_0_main_Load(EOS, i71, i147)
f1429_0_main_Load(EOS, i71, i147) → f1196_0_main_Load(EOS, i71, i147)
Combined rules. Obtained 2 IRules
P rules:
f1201_0_main_LE(EOS, x0, x1, x0, x1) → f1201_0_main_LE(EOS, -(x0, 1), 1, -(x0, 1), 1) | &&(>(+(x0, 1), 1), >=(x1, x0))
f1201_0_main_LE(EOS, x0, x1, x0, x1) → f1201_0_main_LE(EOS, x0, *(2, x1), x0, *(2, x1)) | &&(<(x1, x0), >(+(x1, 1), 1))
Filtered ground terms:
f1201_0_main_LE(x1, x2, x3, x4, x5) → f1201_0_main_LE(x2, x3, x4, x5)
Cond_f1201_0_main_LE(x1, x2, x3, x4, x5, x6) → Cond_f1201_0_main_LE(x1, x3, x4, x5, x6)
Cond_f1201_0_main_LE1(x1, x2, x3, x4, x5, x6) → Cond_f1201_0_main_LE1(x1, x3, x4, x5, x6)
Filtered duplicate terms:
f1201_0_main_LE(x1, x2, x3, x4) → f1201_0_main_LE(x3, x4)
Cond_f1201_0_main_LE(x1, x2, x3, x4, x5) → Cond_f1201_0_main_LE(x1, x4, x5)
Cond_f1201_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f1201_0_main_LE1(x1, x4, x5)
Filtered unneeded terms:
Cond_f1201_0_main_LE(x1, x2, x3) → Cond_f1201_0_main_LE(x1, x2)
Prepared 2 rules for path length conversion:
P rules:
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(-(x0, 1), 1) | &&(>(+(x0, 1), 1), >=(x1, x0))
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(x0, *(2, x1)) | &&(<(x1, x0), >(+(x1, 1), 1))
Finished conversion. Obtained 2 rules.
P rules:
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(-(x0, 1), 1) | &&(>(x0, 0), >=(x1, x0))
f1201_0_main_LE(x2, x3) → f1201_0_main_LE(x2, *(2, x3)) | &&(<(x3, x2), >(x3, 0))
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: