0 JBC
↳1 JBCToGraph (⇒, 335 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 35 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇔, 0 ms)
↳8 YES
public class PlusSwap{
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z;
int res = 0;
while (y > 0) {
z = x;
x = y-1;
y = z;
res++;
}
res = res + 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 14 IRules
P rules:
f729_0_main_LE(EOS, i130, i143, i143) → f733_0_main_LE(EOS, i130, i143, i143)
f733_0_main_LE(EOS, i130, i143, i143) → f738_0_main_Load(EOS, i130, i143) | >(i143, 0)
f738_0_main_Load(EOS, i130, i143) → f742_0_main_Store(EOS, i143, i130)
f742_0_main_Store(EOS, i143, i130) → f746_0_main_Load(EOS, i143, i130)
f746_0_main_Load(EOS, i143, i130) → f750_0_main_ConstantStackPush(EOS, i130, i143)
f750_0_main_ConstantStackPush(EOS, i130, i143) → f755_0_main_IntArithmetic(EOS, i130, i143, 1)
f755_0_main_IntArithmetic(EOS, i130, i143, matching1) → f759_0_main_Store(EOS, i130, -(i143, 1)) | &&(>(i143, 0), =(matching1, 1))
f759_0_main_Store(EOS, i130, i147) → f761_0_main_Load(EOS, i147, i130)
f761_0_main_Load(EOS, i147, i130) → f764_0_main_Store(EOS, i147, i130)
f764_0_main_Store(EOS, i147, i130) → f766_0_main_Inc(EOS, i147, i130)
f766_0_main_Inc(EOS, i147, i130) → f768_0_main_JMP(EOS, i147, i130)
f768_0_main_JMP(EOS, i147, i130) → f795_0_main_Load(EOS, i147, i130)
f795_0_main_Load(EOS, i147, i130) → f725_0_main_Load(EOS, i147, i130)
f725_0_main_Load(EOS, i130, i131) → f729_0_main_LE(EOS, i130, i131, i131)
Combined rules. Obtained 1 IRules
P rules:
f729_0_main_LE(EOS, x0, x1, x1) → f729_0_main_LE(EOS, -(x1, 1), x0, x0) | >(x1, 0)
Filtered ground terms:
f729_0_main_LE(x1, x2, x3, x4) → f729_0_main_LE(x2, x3, x4)
Cond_f729_0_main_LE(x1, x2, x3, x4, x5) → Cond_f729_0_main_LE(x1, x3, x4, x5)
Filtered duplicate terms:
f729_0_main_LE(x1, x2, x3) → f729_0_main_LE(x1, x3)
Cond_f729_0_main_LE(x1, x2, x3, x4) → Cond_f729_0_main_LE(x1, x2, x4)
Prepared 1 rules for path length conversion:
P rules:
f729_0_main_LE(x0, x1) → f729_0_main_LE(-(x1, 1), x0) | >(x1, 0)
Finished conversion. Obtained 1 rules.
P rules:
f729_0_main_LE(x0, x1) → f729_0_main_LE(-(x1, 1), x0) | >(x1, 0)
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: