0 JBC
↳1 JBCToGraph (⇒, 407 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 17 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇒, 3 ms)
↳8 intTRS
↳9 PolynomialOrderProcessor (⇔, 0 ms)
↳10 YES
public class McCarthyIterative {
public static int main(int x) {
int c = 1;
while (c > 0) {
if (x > 100) {
x -= 10;
c--;
} else {
x += 11;
c++;
}
}
return x;
}
public static void main(String[] args) {
Random.args = args;
main(Random.random());
}
}
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 17 IRules
P rules:
f727_0_main_LE(EOS, i113, i179, i179) → f730_0_main_LE(EOS, i113, i179, i179)
f730_0_main_LE(EOS, i113, i179, i179) → f733_0_main_Load(EOS, i113, i179) | >(i179, 0)
f733_0_main_Load(EOS, i113, i179) → f736_0_main_ConstantStackPush(EOS, i113, i179, i113)
f736_0_main_ConstantStackPush(EOS, i113, i179, i113) → f740_0_main_LE(EOS, i113, i179, i113, 100)
f740_0_main_LE(EOS, i185, i179, i185, matching1) → f744_0_main_LE(EOS, i185, i179, i185, 100) | =(matching1, 100)
f740_0_main_LE(EOS, i186, i179, i186, matching1) → f745_0_main_LE(EOS, i186, i179, i186, 100) | =(matching1, 100)
f744_0_main_LE(EOS, i185, i179, i185, matching1) → f748_0_main_Inc(EOS, i185, i179) | &&(<=(i185, 100), =(matching1, 100))
f748_0_main_Inc(EOS, i185, i179) → f751_0_main_Inc(EOS, +(i185, 11), i179)
f751_0_main_Inc(EOS, i187, i179) → f754_0_main_JMP(EOS, i187, +(i179, 1)) | >(i179, 0)
f754_0_main_JMP(EOS, i187, i189) → f760_0_main_Load(EOS, i187, i189)
f760_0_main_Load(EOS, i187, i189) → f479_0_main_Load(EOS, i187, i189)
f479_0_main_Load(EOS, i113, i114) → f727_0_main_LE(EOS, i113, i114, i114)
f745_0_main_LE(EOS, i186, i179, i186, matching1) → f750_0_main_Inc(EOS, i186, i179) | &&(>(i186, 100), =(matching1, 100))
f750_0_main_Inc(EOS, i186, i179) → f753_0_main_Inc(EOS, +(i186, -10), i179) | >(i186, 0)
f753_0_main_Inc(EOS, i188, i179) → f756_0_main_JMP(EOS, i188, +(i179, -1)) | >(i179, 0)
f756_0_main_JMP(EOS, i188, i190) → f765_0_main_Load(EOS, i188, i190)
f765_0_main_Load(EOS, i188, i190) → f479_0_main_Load(EOS, i188, i190)
Combined rules. Obtained 2 IRules
P rules:
f727_0_main_LE(EOS, x0, x1, x1) → f727_0_main_LE(EOS, +(x0, 11), +(x1, 1), +(x1, 1)) | &&(>(x1, 0), <=(x0, 100))
f727_0_main_LE(EOS, x0, x1, x1) → f727_0_main_LE(EOS, -(x0, 10), -(x1, 1), -(x1, 1)) | &&(>(x1, 0), >(x0, 100))
Filtered ground terms:
f727_0_main_LE(x1, x2, x3, x4) → f727_0_main_LE(x2, x3, x4)
Cond_f727_0_main_LE(x1, x2, x3, x4, x5) → Cond_f727_0_main_LE(x1, x3, x4, x5)
Cond_f727_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f727_0_main_LE1(x1, x3, x4, x5)
Filtered duplicate terms:
f727_0_main_LE(x1, x2, x3) → f727_0_main_LE(x1, x3)
Cond_f727_0_main_LE(x1, x2, x3, x4) → Cond_f727_0_main_LE(x1, x2, x4)
Cond_f727_0_main_LE1(x1, x2, x3, x4) → Cond_f727_0_main_LE1(x1, x2, x4)
Prepared 2 rules for path length conversion:
P rules:
f727_0_main_LE(x0, x1) → f727_0_main_LE(+(x0, 11), +(x1, 1)) | &&(>(x1, 0), <=(x0, 100))
f727_0_main_LE(x0, x1) → f727_0_main_LE(-(x0, 10), -(x1, 1)) | &&(>(x1, 0), >(x0, 100))
Finished conversion. Obtained 2 rules.
P rules:
f727_0_main_LE(x0, x1) → f727_0_main_LE(+(x0, 11), +(x1, 1)) | &&(<=(x0, 100), >(x1, 0))
f727_0_main_LE(x2, x3) → f727_0_main_LE(-(x2, 10), -(x3, 1)) | &&(>(x2, 100), >(x3, 0))
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: