0 JBC
↳1 JBCToGraph (⇒, 357 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 0 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 PastaA1 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
while (x > 0) {
int y = 0;
while (y < x) {
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 21 IRules
P rules:
f146_0_main_LE(EOS, i22, i22) → f149_0_main_LE(EOS, i22, i22)
f149_0_main_LE(EOS, i22, i22) → f158_0_main_ConstantStackPush(EOS, i22) | >(i22, 0)
f158_0_main_ConstantStackPush(EOS, i22) → f166_0_main_Store(EOS, i22, 0)
f166_0_main_Store(EOS, i22, matching1) → f171_0_main_Load(EOS, i22, 0) | =(matching1, 0)
f171_0_main_Load(EOS, i22, matching1) → f251_0_main_Load(EOS, i22, 0) | =(matching1, 0)
f251_0_main_Load(EOS, i22, i24) → f365_0_main_Load(EOS, i22, i24)
f365_0_main_Load(EOS, i22, i34) → f602_0_main_Load(EOS, i22, i34)
f602_0_main_Load(EOS, i22, i44) → f782_0_main_Load(EOS, i22, i44)
f782_0_main_Load(EOS, i22, i52) → f877_0_main_Load(EOS, i22, i52, i52)
f877_0_main_Load(EOS, i22, i52, i52) → f879_0_main_GE(EOS, i22, i52, i52, i22)
f879_0_main_GE(EOS, i22, i52, i52, i22) → f881_0_main_GE(EOS, i22, i52, i52, i22)
f879_0_main_GE(EOS, i22, i52, i52, i22) → f882_0_main_GE(EOS, i22, i52, i52, i22)
f881_0_main_GE(EOS, i22, i52, i52, i22) → f884_0_main_Inc(EOS, i22) | >=(i52, i22)
f884_0_main_Inc(EOS, i22) → f888_0_main_JMP(EOS, +(i22, -1)) | >(i22, 0)
f888_0_main_JMP(EOS, i55) → f896_0_main_Load(EOS, i55)
f896_0_main_Load(EOS, i55) → f143_0_main_Load(EOS, i55)
f143_0_main_Load(EOS, i18) → f146_0_main_LE(EOS, i18, i18)
f882_0_main_GE(EOS, i22, i52, i52, i22) → f886_0_main_Inc(EOS, i22, i52) | <(i52, i22)
f886_0_main_Inc(EOS, i22, i52) → f890_0_main_JMP(EOS, i22, +(i52, 1)) | >=(i52, 0)
f890_0_main_JMP(EOS, i22, i56) → f903_0_main_Load(EOS, i22, i56)
f903_0_main_Load(EOS, i22, i56) → f782_0_main_Load(EOS, i22, i56)
Combined rules. Obtained 2 IRules
P rules:
f879_0_main_GE(EOS, x0, x1, x1, x0) → f879_0_main_GE(EOS, -(x0, 1), 0, 0, -(x0, 1)) | &&(>(x0, 1), >=(x1, x0))
f879_0_main_GE(EOS, x0, x1, x1, x0) → f879_0_main_GE(EOS, x0, +(x1, 1), +(x1, 1), x0) | &&(<(x1, x0), >(+(x1, 1), 0))
Filtered ground terms:
f879_0_main_GE(x1, x2, x3, x4, x5) → f879_0_main_GE(x2, x3, x4, x5)
Cond_f879_0_main_GE(x1, x2, x3, x4, x5, x6) → Cond_f879_0_main_GE(x1, x3, x4, x5, x6)
Cond_f879_0_main_GE1(x1, x2, x3, x4, x5, x6) → Cond_f879_0_main_GE1(x1, x3, x4, x5, x6)
Filtered duplicate terms:
f879_0_main_GE(x1, x2, x3, x4) → f879_0_main_GE(x3, x4)
Cond_f879_0_main_GE(x1, x2, x3, x4, x5) → Cond_f879_0_main_GE(x1, x4, x5)
Cond_f879_0_main_GE1(x1, x2, x3, x4, x5) → Cond_f879_0_main_GE1(x1, x4, x5)
Filtered unneeded terms:
Cond_f879_0_main_GE(x1, x2, x3) → Cond_f879_0_main_GE(x1, x3)
Prepared 2 rules for path length conversion:
P rules:
f879_0_main_GE(x1, x0) → f879_0_main_GE(0, -(x0, 1)) | &&(>(x0, 1), >=(x1, x0))
f879_0_main_GE(x1, x0) → f879_0_main_GE(+(x1, 1), x0) | &&(<(x1, x0), >(+(x1, 1), 0))
Finished conversion. Obtained 2 rules.
P rules:
f879_0_main_GE(x0, x1) → f879_0_main_GE(0, -(x1, 1)) | &&(<=(x1, x0), >(x1, 1))
f879_0_main_GE(x2, x3) → f879_0_main_GE(+(x2, 1), x3) | &&(>(x2, -1), >(x3, x2))
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: