0 JBC
↳1 JBCToGraph (⇒, 340 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 19 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 PastaC2 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
while (x >= 0) {
x = x+1;
int y = 1;
while (x >= y) {
y++;
}
x = x-2;
}
}
}
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 28 IRules
P rules:
f784_0_main_LT(EOS, i61, i61) → f787_0_main_LT(EOS, i61, i61)
f787_0_main_LT(EOS, i61, i61) → f790_0_main_Load(EOS, i61) | >=(i61, 0)
f790_0_main_Load(EOS, i61) → f792_0_main_ConstantStackPush(EOS, i61)
f792_0_main_ConstantStackPush(EOS, i61) → f794_0_main_IntArithmetic(EOS, i61, 1)
f794_0_main_IntArithmetic(EOS, i61, matching1) → f796_0_main_Store(EOS, +(i61, 1)) | &&(>=(i61, 0), =(matching1, 1))
f796_0_main_Store(EOS, i62) → f798_0_main_ConstantStackPush(EOS, i62)
f798_0_main_ConstantStackPush(EOS, i62) → f799_0_main_Store(EOS, i62, 1)
f799_0_main_Store(EOS, i62, matching1) → f802_0_main_Load(EOS, i62, 1) | =(matching1, 1)
f802_0_main_Load(EOS, i62, matching1) → f817_0_main_Load(EOS, i62, 1) | =(matching1, 1)
f817_0_main_Load(EOS, i62, i64) → f839_0_main_Load(EOS, i62, i64)
f839_0_main_Load(EOS, i62, i67) → f862_0_main_Load(EOS, i62, i67)
f862_0_main_Load(EOS, i62, i70) → f885_0_main_Load(EOS, i62, i70)
f885_0_main_Load(EOS, i62, i73) → f886_0_main_Load(EOS, i62, i73, i62)
f886_0_main_Load(EOS, i62, i73, i62) → f889_0_main_LT(EOS, i62, i73, i62, i73)
f889_0_main_LT(EOS, i62, i73, i62, i73) → f890_0_main_LT(EOS, i62, i73, i62, i73)
f889_0_main_LT(EOS, i62, i73, i62, i73) → f891_0_main_LT(EOS, i62, i73, i62, i73)
f890_0_main_LT(EOS, i62, i73, i62, i73) → f893_0_main_Load(EOS, i62) | <(i62, i73)
f893_0_main_Load(EOS, i62) → f896_0_main_ConstantStackPush(EOS, i62)
f896_0_main_ConstantStackPush(EOS, i62) → f899_0_main_IntArithmetic(EOS, i62, 2)
f899_0_main_IntArithmetic(EOS, i62, matching1) → f905_0_main_Store(EOS, -(i62, 2)) | &&(>(i62, 0), =(matching1, 2))
f905_0_main_Store(EOS, i77) → f1115_0_main_JMP(EOS, i77)
f1115_0_main_JMP(EOS, i77) → f1120_0_main_Load(EOS, i77)
f1120_0_main_Load(EOS, i77) → f781_0_main_Load(EOS, i77)
f781_0_main_Load(EOS, i58) → f784_0_main_LT(EOS, i58, i58)
f891_0_main_LT(EOS, i62, i73, i62, i73) → f894_0_main_Inc(EOS, i62, i73) | >=(i62, i73)
f894_0_main_Inc(EOS, i62, i73) → f898_0_main_JMP(EOS, i62, +(i73, 1)) | >(i73, 0)
f898_0_main_JMP(EOS, i62, i75) → f904_0_main_Load(EOS, i62, i75)
f904_0_main_Load(EOS, i62, i75) → f885_0_main_Load(EOS, i62, i75)
Combined rules. Obtained 2 IRules
P rules:
f889_0_main_LT(EOS, x0, x1, x0, x1) → f889_0_main_LT(EOS, -(x0, 1), 1, -(x0, 1), 1) | &&(>(x1, x0), >(+(x0, 1), 2))
f889_0_main_LT(EOS, x0, x1, x0, x1) → f889_0_main_LT(EOS, x0, +(x1, 1), x0, +(x1, 1)) | &&(<=(x1, x0), >(x1, 0))
Filtered ground terms:
f889_0_main_LT(x1, x2, x3, x4, x5) → f889_0_main_LT(x2, x3, x4, x5)
Cond_f889_0_main_LT(x1, x2, x3, x4, x5, x6) → Cond_f889_0_main_LT(x1, x3, x4, x5, x6)
Cond_f889_0_main_LT1(x1, x2, x3, x4, x5, x6) → Cond_f889_0_main_LT1(x1, x3, x4, x5, x6)
Filtered duplicate terms:
f889_0_main_LT(x1, x2, x3, x4) → f889_0_main_LT(x3, x4)
Cond_f889_0_main_LT(x1, x2, x3, x4, x5) → Cond_f889_0_main_LT(x1, x4, x5)
Cond_f889_0_main_LT1(x1, x2, x3, x4, x5) → Cond_f889_0_main_LT1(x1, x4, x5)
Filtered unneeded terms:
Cond_f889_0_main_LT(x1, x2, x3) → Cond_f889_0_main_LT(x1, x2)
Prepared 2 rules for path length conversion:
P rules:
f889_0_main_LT(x0, x1) → f889_0_main_LT(-(x0, 1), 1) | &&(>(x1, x0), >(+(x0, 1), 2))
f889_0_main_LT(x0, x1) → f889_0_main_LT(x0, +(x1, 1)) | &&(<=(x1, x0), >(x1, 0))
Finished conversion. Obtained 2 rules.
P rules:
f889_0_main_LT(x0, x1) → f889_0_main_LT(-(x0, 1), 1) | &&(>(x0, 1), >(x1, x0))
f889_0_main_LT(x2, x3) → f889_0_main_LT(x2, +(x3, 1)) | &&(<=(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: