0 JBC
↳1 JBCToGraph (⇒, 541 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 36 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 PastaA10 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
while (x != y) {
if (x > y) {
y++;
} else {
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:
f316_0_main_Load(EOS, i18, i44, i18) → f324_0_main_EQ(EOS, i18, i44, i18, i44)
f324_0_main_EQ(EOS, i18, i44, i18, i44) → f341_0_main_EQ(EOS, i18, i44, i18, i44)
f341_0_main_EQ(EOS, i18, i44, i18, i44) → f354_0_main_Load(EOS, i18, i44) | !(=(i18, i44))
f354_0_main_Load(EOS, i18, i44) → f363_0_main_Load(EOS, i18, i44, i18)
f363_0_main_Load(EOS, i18, i44, i18) → f375_0_main_LE(EOS, i18, i44, i18, i44)
f375_0_main_LE(EOS, i18, i44, i18, i44) → f390_0_main_LE(EOS, i18, i44, i18, i44)
f375_0_main_LE(EOS, i18, i44, i18, i44) → f391_0_main_LE(EOS, i18, i44, i18, i44)
f390_0_main_LE(EOS, i18, i44, i18, i44) → f402_0_main_Inc(EOS, i18, i44) | <=(i18, i44)
f402_0_main_Inc(EOS, i18, i44) → f416_0_main_JMP(EOS, +(i18, 1), i44) | >=(i18, 0)
f416_0_main_JMP(EOS, i52, i44) → f461_0_main_Load(EOS, i52, i44)
f461_0_main_Load(EOS, i52, i44) → f308_0_main_Load(EOS, i52, i44)
f308_0_main_Load(EOS, i18, i44) → f316_0_main_Load(EOS, i18, i44, i18)
f391_0_main_LE(EOS, i18, i44, i18, i44) → f405_0_main_Inc(EOS, i18, i44) | >(i18, i44)
f405_0_main_Inc(EOS, i18, i44) → f418_0_main_JMP(EOS, i18, +(i44, 1)) | >=(i44, 0)
f418_0_main_JMP(EOS, i18, i53) → f469_0_main_Load(EOS, i18, i53)
f469_0_main_Load(EOS, i18, i53) → f308_0_main_Load(EOS, i18, i53)
Combined rules. Obtained 2 IRules
P rules:
f316_0_main_Load(EOS, x0, x1, x0) → f316_0_main_Load(EOS, +(x0, 1), x1, +(x0, 1)) | &&(>(+(x0, 1), 0), >(x1, x0))
f316_0_main_Load(EOS, x0, x1, x0) → f316_0_main_Load(EOS, x0, +(x1, 1), x0) | &&(<(x1, x0), >(+(x1, 1), 0))
Filtered ground terms:
f316_0_main_Load(x1, x2, x3, x4) → f316_0_main_Load(x2, x3, x4)
Cond_f316_0_main_Load(x1, x2, x3, x4, x5) → Cond_f316_0_main_Load(x1, x3, x4, x5)
Cond_f316_0_main_Load1(x1, x2, x3, x4, x5) → Cond_f316_0_main_Load1(x1, x3, x4, x5)
Filtered duplicate terms:
f316_0_main_Load(x1, x2, x3) → f316_0_main_Load(x2, x3)
Cond_f316_0_main_Load(x1, x2, x3, x4) → Cond_f316_0_main_Load(x1, x3, x4)
Cond_f316_0_main_Load1(x1, x2, x3, x4) → Cond_f316_0_main_Load1(x1, x3, x4)
Prepared 2 rules for path length conversion:
P rules:
f316_0_main_Load(x1, x0) → f316_0_main_Load(x1, +(x0, 1)) | &&(>(+(x0, 1), 0), >(x1, x0))
f316_0_main_Load(x1, x0) → f316_0_main_Load(+(x1, 1), x0) | &&(<(x1, x0), >(+(x1, 1), 0))
Finished conversion. Obtained 2 rules.
P rules:
f316_0_main_Load(x0, x1) → f316_0_main_Load(x0, +(x1, 1)) | &&(<(x1, x0), >(x1, -1))
f316_0_main_Load(x2, x3) → f316_0_main_Load(+(x2, 1), x3) | &&(>(x2, -1), >(x3, x2))
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: