0 JBC
↳1 JBCToGraph (⇒, 1201 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 76 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇒, 0 ms)
↳8 AND
↳9 intTRS
↳10 PolynomialOrderProcessor (⇔, 0 ms)
↳11 YES
↳12 intTRS
↳13 PolynomialOrderProcessor (⇒, 0 ms)
↳14 intTRS
↳15 PolynomialOrderProcessor (⇔, 0 ms)
↳16 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 PastaB11 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
while (x + y > 0) {
if (x > y) {
x--;
} else if (x == y) {
x--;
} else {
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 26 IRules
P rules:
f2689_0_main_Load(EOS, i134, i926, i134) → f2692_0_main_IntArithmetic(EOS, i134, i926, i134, i926)
f2692_0_main_IntArithmetic(EOS, i134, i926, i134, i926) → f2694_0_main_LE(EOS, i134, i926, +(i134, i926))
f2694_0_main_LE(EOS, i134, i926, i940) → f2700_0_main_LE(EOS, i134, i926, i940)
f2700_0_main_LE(EOS, i134, i926, i940) → f2704_0_main_Load(EOS, i134, i926) | >(i940, 0)
f2704_0_main_Load(EOS, i134, i926) → f2709_0_main_Load(EOS, i134, i926, i134)
f2709_0_main_Load(EOS, i134, i926, i134) → f2711_0_main_LE(EOS, i134, i926, i134, i926)
f2711_0_main_LE(EOS, i134, i926, i134, i926) → f2714_0_main_LE(EOS, i134, i926, i134, i926)
f2711_0_main_LE(EOS, i134, i926, i134, i926) → f2715_0_main_LE(EOS, i134, i926, i134, i926)
f2714_0_main_LE(EOS, i134, i926, i134, i926) → f2717_0_main_Load(EOS, i134, i926) | <=(i134, i926)
f2717_0_main_Load(EOS, i134, i926) → f2721_0_main_Load(EOS, i134, i926, i134)
f2721_0_main_Load(EOS, i134, i926, i134) → f2725_0_main_NE(EOS, i134, i926, i134, i926)
f2725_0_main_NE(EOS, i134, i926, i134, i926) → f2741_0_main_NE(EOS, i134, i926, i134, i926)
f2725_0_main_NE(EOS, i926, i926, i926, i926) → f2742_0_main_NE(EOS, i926, i926, i926, i926)
f2741_0_main_NE(EOS, i134, i926, i134, i926) → f3277_0_main_Inc(EOS, i134, i926) | !(=(i134, i926))
f3277_0_main_Inc(EOS, i134, i926) → f3282_0_main_JMP(EOS, i134, +(i926, -1))
f3282_0_main_JMP(EOS, i134, i1158) → f3292_0_main_Load(EOS, i134, i1158)
f3292_0_main_Load(EOS, i134, i1158) → f2683_0_main_Load(EOS, i134, i1158)
f2683_0_main_Load(EOS, i134, i926) → f2689_0_main_Load(EOS, i134, i926, i134)
f2742_0_main_NE(EOS, i926, i926, i926, i926) → f3280_0_main_Inc(EOS, i926, i926)
f3280_0_main_Inc(EOS, i926, i926) → f3284_0_main_JMP(EOS, +(i926, -1), i926)
f3284_0_main_JMP(EOS, i1159, i926) → f3300_0_main_Load(EOS, i1159, i926)
f3300_0_main_Load(EOS, i1159, i926) → f2683_0_main_Load(EOS, i1159, i926)
f2715_0_main_LE(EOS, i134, i926, i134, i926) → f2719_0_main_Inc(EOS, i134, i926) | >(i134, i926)
f2719_0_main_Inc(EOS, i134, i926) → f2723_0_main_JMP(EOS, +(i134, -1), i926)
f2723_0_main_JMP(EOS, i941, i926) → f2738_0_main_Load(EOS, i941, i926)
f2738_0_main_Load(EOS, i941, i926) → f2683_0_main_Load(EOS, i941, i926)
Combined rules. Obtained 3 IRules
P rules:
f2689_0_main_Load(EOS, x0, x1, x0) → f2689_0_main_Load(EOS, x0, -(x1, 1), x0) | &&(>(+(x0, x1), 0), >(x1, x0))
f2689_0_main_Load(EOS, x0, x0, x0) → f2689_0_main_Load(EOS, -(x0, 1), x0, -(x0, 1)) | >(+(x0, x0), 0)
f2689_0_main_Load(EOS, x0, x1, x0) → f2689_0_main_Load(EOS, -(x0, 1), x1, -(x0, 1)) | &&(>(+(x0, x1), 0), <(x1, x0))
Filtered ground terms:
f2689_0_main_Load(x1, x2, x3, x4) → f2689_0_main_Load(x2, x3, x4)
Cond_f2689_0_main_Load(x1, x2, x3, x4, x5) → Cond_f2689_0_main_Load(x1, x3, x4, x5)
Cond_f2689_0_main_Load1(x1, x2, x3, x4, x5) → Cond_f2689_0_main_Load1(x1, x3, x4, x5)
Cond_f2689_0_main_Load2(x1, x2, x3, x4, x5) → Cond_f2689_0_main_Load2(x1, x3, x4, x5)
Filtered duplicate terms:
f2689_0_main_Load(x1, x2, x3) → f2689_0_main_Load(x2, x3)
Cond_f2689_0_main_Load(x1, x2, x3, x4) → Cond_f2689_0_main_Load(x1, x3, x4)
Cond_f2689_0_main_Load1(x1, x2, x3, x4) → Cond_f2689_0_main_Load1(x1, x4)
Cond_f2689_0_main_Load2(x1, x2, x3, x4) → Cond_f2689_0_main_Load2(x1, x3, x4)
Prepared 3 rules for path length conversion:
P rules:
f2689_0_main_Load(x1, x0) → f2689_0_main_Load(-(x1, 1), x0) | &&(>(+(x0, x1), 0), >(x1, x0))
f2689_0_main_Load(x0, x0) → f2689_0_main_Load(x0, -(x0, 1)) | >(+(x0, x0), 0)
f2689_0_main_Load(x1, x0) → f2689_0_main_Load(x1, -(x0, 1)) | &&(>(+(x0, x1), 0), <(x1, x0))
Finished conversion. Obtained 3 rules.
P rules:
f2689_0_main_Load(x0, x1) → f2689_0_main_Load(-(x0, 1), x1) | &&(>(+(x1, x0), 0), <(x1, x0))
f2689_0_main_Load(x2, x21) → f2689_0_main_Load(x2, -(x2, 1)) | &&(>(+(x2, x2), 0), =(x2, x21))
f2689_0_main_Load(x3, x4) → f2689_0_main_Load(x3, -(x4, 1)) | &&(>(+(x4, x3), 0), >(x4, x3))
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:
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: