0 JBC
↳1 JBCToGraph (⇒, 378 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 66 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇒, 0 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 PastaB12 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
while (x > 0 || y > 0) {
if (x > 0) {
x--;
} else if (y > 0) {
y--;
} else {
continue;
}
}
}
}
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 20 IRules
P rules:
f348_0_main_GT(EOS, matching1, i48, matching2) → f356_0_main_GT(EOS, 0, i48, 0) | &&(=(matching1, 0), =(matching2, 0))
f348_0_main_GT(EOS, i56, i48, i56) → f357_0_main_GT(EOS, i56, i48, i56)
f356_0_main_GT(EOS, matching1, i48, matching2) → f374_0_main_Load(EOS, 0, i48) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f374_0_main_Load(EOS, matching1, i48) → f386_0_main_LE(EOS, 0, i48, i48) | =(matching1, 0)
f386_0_main_LE(EOS, matching1, i64, i64) → f399_0_main_LE(EOS, 0, i64, i64) | =(matching1, 0)
f399_0_main_LE(EOS, matching1, i64, i64) → f417_0_main_Load(EOS, 0, i64) | &&(>(i64, 0), =(matching1, 0))
f417_0_main_Load(EOS, matching1, i64) → f435_0_main_LE(EOS, 0, i64, 0) | =(matching1, 0)
f435_0_main_LE(EOS, matching1, i64, matching2) → f476_0_main_Load(EOS, 0, i64) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f476_0_main_Load(EOS, matching1, i64) → f914_0_main_LE(EOS, 0, i64, i64) | =(matching1, 0)
f914_0_main_LE(EOS, matching1, i64, i64) → f924_0_main_Inc(EOS, 0, i64) | &&(>(i64, 0), =(matching1, 0))
f924_0_main_Inc(EOS, matching1, i64) → f931_0_main_JMP(EOS, 0, +(i64, -1)) | &&(>(i64, 0), =(matching1, 0))
f931_0_main_JMP(EOS, matching1, i160) → f942_0_main_Load(EOS, 0, i160) | =(matching1, 0)
f942_0_main_Load(EOS, matching1, i160) → f338_0_main_Load(EOS, 0, i160) | =(matching1, 0)
f338_0_main_Load(EOS, i18, i48) → f348_0_main_GT(EOS, i18, i48, i18)
f357_0_main_GT(EOS, i56, i48, i56) → f376_0_main_Load(EOS, i56, i48) | >(i56, 0)
f376_0_main_Load(EOS, i56, i48) → f389_0_main_LE(EOS, i56, i48, i56)
f389_0_main_LE(EOS, i56, i48, i56) → f401_0_main_Inc(EOS, i56, i48) | >(i56, 0)
f401_0_main_Inc(EOS, i56, i48) → f419_0_main_JMP(EOS, +(i56, -1), i48) | >(i56, 0)
f419_0_main_JMP(EOS, i66, i48) → f465_0_main_Load(EOS, i66, i48)
f465_0_main_Load(EOS, i66, i48) → f338_0_main_Load(EOS, i66, i48)
Combined rules. Obtained 2 IRules
P rules:
f348_0_main_GT(EOS, 0, x1, 0) → f348_0_main_GT(EOS, 0, -(x1, 1), 0) | >(x1, 0)
f348_0_main_GT(EOS, x0, x1, x0) → f348_0_main_GT(EOS, -(x0, 1), x1, -(x0, 1)) | >(x0, 0)
Filtered ground terms:
f348_0_main_GT(x1, x2, x3, x4) → f348_0_main_GT(x2, x3, x4)
Cond_f348_0_main_GT(x1, x2, x3, x4, x5) → Cond_f348_0_main_GT(x1, x4)
Cond_f348_0_main_GT1(x1, x2, x3, x4, x5) → Cond_f348_0_main_GT1(x1, x3, x4, x5)
Filtered duplicate terms:
f348_0_main_GT(x1, x2, x3) → f348_0_main_GT(x2, x3)
Cond_f348_0_main_GT1(x1, x2, x3, x4) → Cond_f348_0_main_GT1(x1, x3, x4)
Prepared 2 rules for path length conversion:
P rules:
f348_0_main_GT(x1, 0) → f348_0_main_GT(-(x1, 1), 0) | >(x1, 0)
f348_0_main_GT(x1, x0) → f348_0_main_GT(x1, -(x0, 1)) | >(x0, 0)
Finished conversion. Obtained 2 rules.
P rules:
f348_0_main_GT(x0, c0) → f348_0_main_GT(-(x0, 1), 0) | &&(>(x0, 0), =(0, c0))
f348_0_main_GT(x1, x2) → f348_0_main_GT(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: