0 JBC
↳1 JBCToGraph (⇒, 91 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 83 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇔, 0 ms)
↳8 YES
/**
* A recursive loop.
*
* All calls terminate.
*
* Julia + BinTerm prove that all calls terminate.
*
* @author <A HREF="mailto:fausto.spoto@univr.it">Fausto Spoto</A>
*/
public class Double2 {
private static void test(int n) {
for (int i = n - 1; i >= 0; i--)
test(i);
}
public static void main(String[] args) {
test(10);
}
}
Generated rules. Obtained 17 IRules
P rules:
f220_0_test_ConstantStackPush(EOS, i15, i15) → f222_0_test_IntArithmetic(EOS, i15, i15, 1)
f222_0_test_IntArithmetic(EOS, i15, i15, matching1) → f223_0_test_Store(EOS, i15, -(i15, 1)) | =(matching1, 1)
f223_0_test_Store(EOS, i15, i16) → f225_0_test_Load(EOS, i15, i16)
f225_0_test_Load(EOS, i15, i16) → f227_0_test_LT(EOS, i15, i16, i16)
f227_0_test_LT(EOS, i15, i20, i20) → f231_0_test_LT(EOS, i15, i20, i20)
f231_0_test_LT(EOS, i15, i20, i20) → f234_0_test_Load(EOS, i15, i20) | >=(i20, 0)
f234_0_test_Load(EOS, i15, i20) → f237_0_test_InvokeMethod(EOS, i15, i20, i20)
f237_0_test_InvokeMethod(EOS, i15, i20, i20) → f247_0_test_Load(EOS, i20, i20)
f237_0_test_InvokeMethod(EOS, i15, i20, i20) → f247_1_test_Load(EOS, i15, i20, i20, i20)
f247_0_test_Load(EOS, i20, i20) → f254_0_test_Load(EOS, i20, i20)
f254_0_test_Load(EOS, i20, i20) → f218_0_test_Load(EOS, i20, i20)
f218_0_test_Load(EOS, i15, i15) → f220_0_test_ConstantStackPush(EOS, i15, i15)
f266_0_test_Return(EOS, i15, i25, i25) → f268_0_test_Inc(EOS, i15, i25)
f268_0_test_Inc(EOS, i15, i25) → f270_0_test_JMP(EOS, i15, +(i25, -1)) | >=(i25, 0)
f270_0_test_JMP(EOS, i15, i26) → f274_0_test_Load(EOS, i15, i26)
f274_0_test_Load(EOS, i15, i26) → f225_0_test_Load(EOS, i15, i26)
f247_1_test_Load(EOS, i15, i25, i25, i25) → f266_0_test_Return(EOS, i15, i25, i25)
Combined rules. Obtained 2 IRules
P rules:
f237_0_test_InvokeMethod(EOS, x0, x1, x1) → f237_0_test_InvokeMethod(EOS, x1, -(x1, 1), -(x1, 1)) | >(+(x1, 1), 1)
f237_0_test_InvokeMethod(EOS, x0, x1, x1) → f237_0_test_InvokeMethod(EOS, x0, -(x1, 1), -(x1, 1)) | >(+(x1, 1), 1)
Filtered ground terms:
f237_0_test_InvokeMethod(x1, x2, x3, x4) → f237_0_test_InvokeMethod(x2, x3, x4)
Cond_f237_0_test_InvokeMethod(x1, x2, x3, x4, x5) → Cond_f237_0_test_InvokeMethod(x1, x3, x4, x5)
Cond_f237_0_test_InvokeMethod1(x1, x2, x3, x4, x5) → Cond_f237_0_test_InvokeMethod1(x1, x3, x4, x5)
Filtered duplicate terms:
f237_0_test_InvokeMethod(x1, x2, x3) → f237_0_test_InvokeMethod(x1, x3)
Cond_f237_0_test_InvokeMethod(x1, x2, x3, x4) → Cond_f237_0_test_InvokeMethod(x1, x2, x4)
Cond_f237_0_test_InvokeMethod1(x1, x2, x3, x4) → Cond_f237_0_test_InvokeMethod1(x1, x2, x4)
Filtered unneeded terms:
Cond_f237_0_test_InvokeMethod(x1, x2, x3) → Cond_f237_0_test_InvokeMethod(x1, x3)
Cond_f237_0_test_InvokeMethod1(x1, x2, x3) → Cond_f237_0_test_InvokeMethod1(x1, x3)
f237_0_test_InvokeMethod(x1, x2) → f237_0_test_InvokeMethod(x2)
Prepared 1 rules for path length conversion:
P rules:
f237_0_test_InvokeMethod(x1) → f237_0_test_InvokeMethod(-(x1, 1)) | >(+(x1, 1), 1)
Finished conversion. Obtained 1 rules.
P rules:
f237_0_test_InvokeMethod(x0) → f237_0_test_InvokeMethod(-(x0, 1)) | >(x0, 0)
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: