0 JBC
↳1 JBCToGraph (⇒, 414 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 41 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇔, 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 PastaA9 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z = Random.random();
if (y > 0) {
while (x >= z) {
z += 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:
f676_0_main_Load(EOS, i18, i97, i88, i18) → f686_0_main_LT(EOS, i18, i97, i88, i18, i88)
f686_0_main_LT(EOS, i18, i97, i88, i18, i88) → f704_0_main_LT(EOS, i18, i97, i88, i18, i88)
f704_0_main_LT(EOS, i18, i97, i88, i18, i88) → f733_0_main_Load(EOS, i18, i97, i88) | >=(i18, i88)
f733_0_main_Load(EOS, i18, i97, i88) → f751_0_main_Load(EOS, i18, i97, i88)
f751_0_main_Load(EOS, i18, i97, i88) → f764_0_main_IntArithmetic(EOS, i18, i97, i88, i97)
f764_0_main_IntArithmetic(EOS, i18, i97, i88, i97) → f783_0_main_Store(EOS, i18, i97, +(i88, i97)) | &&(>=(i88, 0), >(i97, 0))
f783_0_main_Store(EOS, i18, i97, i108) → f797_0_main_JMP(EOS, i18, i97, i108)
f797_0_main_JMP(EOS, i18, i97, i108) → f834_0_main_Load(EOS, i18, i97, i108)
f834_0_main_Load(EOS, i18, i97, i108) → f663_0_main_Load(EOS, i18, i97, i108)
f663_0_main_Load(EOS, i18, i97, i88) → f676_0_main_Load(EOS, i18, i97, i88, i18)
Combined rules. Obtained 1 IRules
P rules:
f676_0_main_Load(EOS, x0, x1, x2, x0) → f676_0_main_Load(EOS, x0, x1, +(x2, x1), x0) | &&(&&(>(+(x2, 1), 0), >(x1, 0)), <=(x2, x0))
Filtered ground terms:
f676_0_main_Load(x1, x2, x3, x4, x5) → f676_0_main_Load(x2, x3, x4, x5)
Cond_f676_0_main_Load(x1, x2, x3, x4, x5, x6) → Cond_f676_0_main_Load(x1, x3, x4, x5, x6)
Filtered duplicate terms:
f676_0_main_Load(x1, x2, x3, x4) → f676_0_main_Load(x2, x3, x4)
Cond_f676_0_main_Load(x1, x2, x3, x4, x5) → Cond_f676_0_main_Load(x1, x3, x4, x5)
Prepared 1 rules for path length conversion:
P rules:
f676_0_main_Load(x1, x2, x0) → f676_0_main_Load(x1, +(x2, x1), x0) | &&(&&(>(+(x2, 1), 0), >(x1, 0)), <=(x2, x0))
Finished conversion. Obtained 1 rules.
P rules:
f676_0_main_Load(x0, x1, x2) → f676_0_main_Load(x0, +(x1, x0), x2) | &&(&&(>=(x2, x1), >(x0, 0)), >(x1, -1))
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: