0 JBC
↳1 JBCToGraph (⇒, 288 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 0 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇔, 0 ms)
↳8 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 PastaB3 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
if (x > 0) {
while (x > y) {
y = x+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 10 IRules
P rules:
f394_0_main_Load(EOS, i53, i47, i53) → f402_0_main_LE(EOS, i53, i47, i53, i47)
f402_0_main_LE(EOS, i53, i47, i53, i47) → f412_0_main_LE(EOS, i53, i47, i53, i47)
f412_0_main_LE(EOS, i53, i47, i53, i47) → f444_0_main_Load(EOS, i53, i47) | >(i53, i47)
f444_0_main_Load(EOS, i53, i47) → f464_0_main_Load(EOS, i53, i47, i53)
f464_0_main_Load(EOS, i53, i47, i53) → f479_0_main_IntArithmetic(EOS, i53, i53, i47)
f479_0_main_IntArithmetic(EOS, i53, i53, i47) → f501_0_main_Store(EOS, i53, +(i53, i47)) | &&(>(i53, 0), >=(i47, 0))
f501_0_main_Store(EOS, i53, i62) → f517_0_main_JMP(EOS, i53, i62)
f517_0_main_JMP(EOS, i53, i62) → f568_0_main_Load(EOS, i53, i62)
f568_0_main_Load(EOS, i53, i62) → f386_0_main_Load(EOS, i53, i62)
f386_0_main_Load(EOS, i53, i47) → f394_0_main_Load(EOS, i53, i47, i53)
Combined rules. Obtained 1 IRules
P rules:
f394_0_main_Load(EOS, x0, x1, x0) → f394_0_main_Load(EOS, x0, +(x0, x1), x0) | &&(&&(>(+(x1, 1), 0), >(x0, 0)), <(x1, x0))
Filtered ground terms:
f394_0_main_Load(x1, x2, x3, x4) → f394_0_main_Load(x2, x3, x4)
Cond_f394_0_main_Load(x1, x2, x3, x4, x5) → Cond_f394_0_main_Load(x1, x3, x4, x5)
Filtered duplicate terms:
f394_0_main_Load(x1, x2, x3) → f394_0_main_Load(x2, x3)
Cond_f394_0_main_Load(x1, x2, x3, x4) → Cond_f394_0_main_Load(x1, x3, x4)
Prepared 1 rules for path length conversion:
P rules:
f394_0_main_Load(x1, x0) → f394_0_main_Load(+(x0, x1), x0) | &&(&&(>(+(x1, 1), 0), >(x0, 0)), <(x1, x0))
Finished conversion. Obtained 1 rules.
P rules:
f394_0_main_Load(x0, x1) → f394_0_main_Load(+(x1, x0), x1) | &&(&&(>(x1, x0), >(x0, -1)), >(x1, 0))
Constructed the termination graph and obtained no non-trivial SCC(s).