0 JBC
↳1 JBCToGraph (⇒, 474 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 85 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 PastaC7 {
public static void main(String[] args) {
Random.args = args;
int i = Random.random();
int j = Random.random();
int k = Random.random();
while (i <= 100 && j <= k) {
int t = i;
i = j;
j = i + 1;
k--;
}
}
}
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 19 IRules
P rules:
f1077_0_main_ConstantStackPush(EOS, i210, i211, i212, i210) → f1081_0_main_GT(EOS, i210, i211, i212, i210, 100)
f1081_0_main_GT(EOS, i224, i211, i212, i224, matching1) → f1084_0_main_GT(EOS, i224, i211, i212, i224, 100) | =(matching1, 100)
f1084_0_main_GT(EOS, i224, i211, i212, i224, matching1) → f1087_0_main_Load(EOS, i224, i211, i212) | &&(<=(i224, 100), =(matching1, 100))
f1087_0_main_Load(EOS, i224, i211, i212) → f1091_0_main_Load(EOS, i224, i211, i212, i211)
f1091_0_main_Load(EOS, i224, i211, i212, i211) → f1094_0_main_GT(EOS, i224, i211, i212, i211, i212)
f1094_0_main_GT(EOS, i224, i211, i212, i211, i212) → f1097_0_main_GT(EOS, i224, i211, i212, i211, i212)
f1097_0_main_GT(EOS, i224, i211, i212, i211, i212) → f1106_0_main_Load(EOS, i224, i211, i212) | <=(i211, i212)
f1106_0_main_Load(EOS, i224, i211, i212) → f1109_0_main_Store(EOS, i211, i212, i224)
f1109_0_main_Store(EOS, i211, i212, i224) → f1110_0_main_Load(EOS, i211, i212)
f1110_0_main_Load(EOS, i211, i212) → f1113_0_main_Store(EOS, i212, i211)
f1113_0_main_Store(EOS, i212, i211) → f1115_0_main_Load(EOS, i211, i212)
f1115_0_main_Load(EOS, i211, i212) → f1116_0_main_ConstantStackPush(EOS, i211, i212, i211)
f1116_0_main_ConstantStackPush(EOS, i211, i212, i211) → f1118_0_main_IntArithmetic(EOS, i211, i212, i211, 1)
f1118_0_main_IntArithmetic(EOS, i211, i212, i211, matching1) → f1120_0_main_Store(EOS, i211, i212, +(i211, 1)) | &&(>=(i211, 0), =(matching1, 1))
f1120_0_main_Store(EOS, i211, i212, i230) → f1122_0_main_Inc(EOS, i211, i230, i212)
f1122_0_main_Inc(EOS, i211, i230, i212) → f1124_0_main_JMP(EOS, i211, i230, +(i212, -1))
f1124_0_main_JMP(EOS, i211, i230, i231) → f1146_0_main_Load(EOS, i211, i230, i231)
f1146_0_main_Load(EOS, i211, i230, i231) → f1073_0_main_Load(EOS, i211, i230, i231)
f1073_0_main_Load(EOS, i210, i211, i212) → f1077_0_main_ConstantStackPush(EOS, i210, i211, i212, i210)
Combined rules. Obtained 1 IRules
P rules:
f1077_0_main_ConstantStackPush(EOS, x0, x1, x2, x0) → f1077_0_main_ConstantStackPush(EOS, x1, +(x1, 1), -(x2, 1), x1) | &&(&&(>=(x2, x1), <=(x0, 100)), >(+(x1, 1), 0))
Filtered ground terms:
f1077_0_main_ConstantStackPush(x1, x2, x3, x4, x5) → f1077_0_main_ConstantStackPush(x2, x3, x4, x5)
Cond_f1077_0_main_ConstantStackPush(x1, x2, x3, x4, x5, x6) → Cond_f1077_0_main_ConstantStackPush(x1, x3, x4, x5, x6)
Filtered duplicate terms:
f1077_0_main_ConstantStackPush(x1, x2, x3, x4) → f1077_0_main_ConstantStackPush(x2, x3, x4)
Cond_f1077_0_main_ConstantStackPush(x1, x2, x3, x4, x5) → Cond_f1077_0_main_ConstantStackPush(x1, x3, x4, x5)
Filtered unneeded terms:
Cond_f1077_0_main_ConstantStackPush(x1, x2, x3, x4) → Cond_f1077_0_main_ConstantStackPush(x1, x2, x3)
Prepared 1 rules for path length conversion:
P rules:
f1077_0_main_ConstantStackPush(x1, x2, x0) → f1077_0_main_ConstantStackPush(+(x1, 1), -(x2, 1), x1) | &&(&&(>=(x2, x1), <=(x0, 100)), >(+(x1, 1), 0))
Finished conversion. Obtained 1 rules.
P rules:
f1077_0_main_ConstantStackPush(x0, x1, x2) → f1077_0_main_ConstantStackPush(+(x0, 1), -(x1, 1), x0) | &&(&&(<=(x2, 100), >(x0, -1)), >=(x1, x0))
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: