0 JBC
↳1 JBCToGraph (⇒, 1010 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 32 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇒, 0 ms)
↳8 AND
↳9 intTRS
↳10 PolynomialOrderProcessor (⇔, 0 ms)
↳11 YES
↳12 intTRS
↳13 LinearRankingProcessor (⇔, 9 ms)
↳14 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 PastaB17 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z = Random.random();
while (x > z) {
while (y > z) {
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 16 IRules
P rules:
f2471_0_main_Load(EOS, i558, i559, i102, i558) → f2473_0_main_LE(EOS, i558, i559, i102, i558, i102)
f2473_0_main_LE(EOS, i558, i559, i102, i558, i102) → f2476_0_main_LE(EOS, i558, i559, i102, i558, i102)
f2476_0_main_LE(EOS, i558, i559, i102, i558, i102) → f2480_0_main_Load(EOS, i558, i559, i102) | >(i558, i102)
f2480_0_main_Load(EOS, i558, i559, i102) → f2484_0_main_Load(EOS, i558, i559, i102, i559)
f2484_0_main_Load(EOS, i558, i559, i102, i559) → f2487_0_main_LE(EOS, i558, i559, i102, i559, i102)
f2487_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2490_0_main_LE(EOS, i558, i559, i102, i559, i102)
f2487_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2491_0_main_LE(EOS, i558, i559, i102, i559, i102)
f2490_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2492_0_main_Inc(EOS, i558, i559, i102) | <=(i559, i102)
f2492_0_main_Inc(EOS, i558, i559, i102) → f2498_0_main_JMP(EOS, +(i558, -1), i559, i102)
f2498_0_main_JMP(EOS, i565, i559, i102) → f2515_0_main_Load(EOS, i565, i559, i102)
f2515_0_main_Load(EOS, i565, i559, i102) → f2467_0_main_Load(EOS, i565, i559, i102)
f2467_0_main_Load(EOS, i558, i559, i102) → f2471_0_main_Load(EOS, i558, i559, i102, i558)
f2491_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2495_0_main_Inc(EOS, i558, i559, i102) | >(i559, i102)
f2495_0_main_Inc(EOS, i558, i559, i102) → f2500_0_main_JMP(EOS, i558, +(i559, -1), i102)
f2500_0_main_JMP(EOS, i558, i566, i102) → f2529_0_main_Load(EOS, i558, i566, i102)
f2529_0_main_Load(EOS, i558, i566, i102) → f2480_0_main_Load(EOS, i558, i566, i102)
Combined rules. Obtained 2 IRules
P rules:
f2487_0_main_LE(EOS, x0, x1, x2, x1, x2) → f2487_0_main_LE(EOS, -(x0, 1), x1, x2, x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(EOS, x0, x1, x2, x1, x2) → f2487_0_main_LE(EOS, x0, -(x1, 1), x2, -(x1, 1), x2) | <(x2, x1)
Filtered ground terms:
f2487_0_main_LE(x1, x2, x3, x4, x5, x6) → f2487_0_main_LE(x2, x3, x4, x5, x6)
Cond_f2487_0_main_LE(x1, x2, x3, x4, x5, x6, x7) → Cond_f2487_0_main_LE(x1, x3, x4, x5, x6, x7)
Cond_f2487_0_main_LE1(x1, x2, x3, x4, x5, x6, x7) → Cond_f2487_0_main_LE1(x1, x3, x4, x5, x6, x7)
Filtered duplicate terms:
f2487_0_main_LE(x1, x2, x3, x4, x5) → f2487_0_main_LE(x1, x4, x5)
Cond_f2487_0_main_LE(x1, x2, x3, x4, x5, x6) → Cond_f2487_0_main_LE(x1, x2, x5, x6)
Cond_f2487_0_main_LE1(x1, x2, x3, x4, x5, x6) → Cond_f2487_0_main_LE1(x1, x2, x5, x6)
Prepared 2 rules for path length conversion:
P rules:
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(x0, -(x1, 1), x2) | <(x2, x1)
Finished conversion. Obtained 2 rules.
P rules:
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(x3, x4, x5) → f2487_0_main_LE(x3, -(x4, 1), x5) | <(x5, x4)
Constructed the termination graph and obtained 2 non-trivial SCCs.
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: