0 JBC
↳1 JBCToGraph (⇒, 356 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 3 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇒, 15 ms)
↳8 AND
↳9 intTRS
↳10 PolynomialOrderProcessor (⇔, 0 ms)
↳11 YES
↳12 intTRS
↳13 PolynomialOrderProcessor (⇔, 0 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 PastaB16 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
while (x > 0) {
while (y > 0) {
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 14 IRules
P rules:
f358_0_main_LE(EOS, i62, i53, i62) → f365_0_main_LE(EOS, i62, i53, i62)
f365_0_main_LE(EOS, i62, i53, i62) → f380_0_main_Load(EOS, i62, i53) | >(i62, 0)
f380_0_main_Load(EOS, i62, i53) → f390_0_main_LE(EOS, i62, i53, i53)
f390_0_main_LE(EOS, i62, matching1, matching2) → f396_0_main_LE(EOS, i62, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
f390_0_main_LE(EOS, i62, i70, i70) → f397_0_main_LE(EOS, i62, i70, i70)
f396_0_main_LE(EOS, i62, matching1, matching2) → f406_0_main_Inc(EOS, i62, 0) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f406_0_main_Inc(EOS, i62, matching1) → f418_0_main_JMP(EOS, +(i62, -1), 0) | &&(>(i62, 0), =(matching1, 0))
f418_0_main_JMP(EOS, i73, matching1) → f450_0_main_Load(EOS, i73, 0) | =(matching1, 0)
f450_0_main_Load(EOS, i73, matching1) → f351_0_main_Load(EOS, i73, 0) | =(matching1, 0)
f351_0_main_Load(EOS, i18, i53) → f358_0_main_LE(EOS, i18, i53, i18)
f397_0_main_LE(EOS, i62, i70, i70) → f407_0_main_Inc(EOS, i62, i70) | >(i70, 0)
f407_0_main_Inc(EOS, i62, i70) → f420_0_main_JMP(EOS, i62, +(i70, -1)) | >(i70, 0)
f420_0_main_JMP(EOS, i62, i74) → f459_0_main_Load(EOS, i62, i74)
f459_0_main_Load(EOS, i62, i74) → f380_0_main_Load(EOS, i62, i74)
Combined rules. Obtained 2 IRules
P rules:
f390_0_main_LE(EOS, x0, 0, 0) → f390_0_main_LE(EOS, -(x0, 1), 0, 0) | >(x0, 1)
f390_0_main_LE(EOS, x0, x1, x1) → f390_0_main_LE(EOS, x0, -(x1, 1), -(x1, 1)) | >(x1, 0)
Filtered ground terms:
f390_0_main_LE(x1, x2, x3, x4) → f390_0_main_LE(x2, x3, x4)
Cond_f390_0_main_LE(x1, x2, x3, x4, x5) → Cond_f390_0_main_LE(x1, x3)
Cond_f390_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f390_0_main_LE1(x1, x3, x4, x5)
Filtered duplicate terms:
f390_0_main_LE(x1, x2, x3) → f390_0_main_LE(x1, x3)
Cond_f390_0_main_LE1(x1, x2, x3, x4) → Cond_f390_0_main_LE1(x1, x2, x4)
Prepared 2 rules for path length conversion:
P rules:
f390_0_main_LE(x0, 0) → f390_0_main_LE(-(x0, 1), 0) | >(x0, 1)
f390_0_main_LE(x0, x1) → f390_0_main_LE(x0, -(x1, 1)) | >(x1, 0)
Finished conversion. Obtained 2 rules.
P rules:
f390_0_main_LE(x0, c0) → f390_0_main_LE(-(x0, 1), 0) | &&(>(x0, 1), =(0, c0))
f390_0_main_LE(x1, x2) → f390_0_main_LE(x1, -(x2, 1)) | >(x2, 0)
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: