0 JBC
↳1 JBCToGraph (⇒, 105 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 67 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇔, 0 ms)
↳8 YES
public class TerminatorRec02 {
public static void main(String[] args) {
fact(args.length);
}
public static int fact(int x) {
if (x > 1) {
int y = fact(x - 1);
return y * x;
}
return 1;
}
}
Generated rules. Obtained 11 IRules
P rules:
f73_0_fact_ConstantStackPush(EOS, i1, i1, i1) → f78_0_fact_LE(EOS, i1, i1, i1, 1)
f78_0_fact_LE(EOS, i9, i9, i9, matching1) → f82_0_fact_LE(EOS, i9, i9, i9, 1) | =(matching1, 1)
f82_0_fact_LE(EOS, i9, i9, i9, matching1) → f86_0_fact_Load(EOS, i9, i9) | &&(>(i9, 1), =(matching1, 1))
f86_0_fact_Load(EOS, i9, i9) → f90_0_fact_ConstantStackPush(EOS, i9, i9, i9)
f90_0_fact_ConstantStackPush(EOS, i9, i9, i9) → f96_0_fact_IntArithmetic(EOS, i9, i9, i9, 1)
f96_0_fact_IntArithmetic(EOS, i9, i9, i9, matching1) → f125_0_fact_InvokeMethod(EOS, i9, i9, -(i9, 1)) | &&(>(i9, 0), =(matching1, 1))
f125_0_fact_InvokeMethod(EOS, i9, i9, i19) → f128_0_fact_Load(EOS, i19, i19)
f125_0_fact_InvokeMethod(EOS, i9, i9, i19) → f128_1_fact_Load(EOS, i9, i9, i19, i19)
f128_0_fact_Load(EOS, i19, i19) → f132_0_fact_Load(EOS, i19, i19)
f132_0_fact_Load(EOS, i19, i19) → f71_0_fact_Load(EOS, i19, i19)
f71_0_fact_Load(EOS, i1, i1) → f73_0_fact_ConstantStackPush(EOS, i1, i1, i1)
Combined rules. Obtained 2 IRules
P rules:
f73_0_fact_ConstantStackPush(EOS, x0, x0, x0) → f128_1_fact_Load(EOS, x0, x0, -(x0, 1), -(x0, 1)) | >(x0, 1)
f73_0_fact_ConstantStackPush(EOS, x0, x0, x0) → f73_0_fact_ConstantStackPush(EOS, -(x0, 1), -(x0, 1), -(x0, 1)) | >(x0, 1)
Filtered ground terms:
f73_0_fact_ConstantStackPush(x1, x2, x3, x4) → f73_0_fact_ConstantStackPush(x2, x3, x4)
Cond_f73_0_fact_ConstantStackPush(x1, x2, x3, x4, x5) → Cond_f73_0_fact_ConstantStackPush(x1, x3, x4, x5)
f128_1_fact_Load(x1, x2, x3, x4, x5) → f128_1_fact_Load(x2, x3, x4, x5)
Cond_f73_0_fact_ConstantStackPush1(x1, x2, x3, x4, x5) → Cond_f73_0_fact_ConstantStackPush1(x1, x3, x4, x5)
Filtered duplicate terms:
f73_0_fact_ConstantStackPush(x1, x2, x3) → f73_0_fact_ConstantStackPush(x3)
Cond_f73_0_fact_ConstantStackPush(x1, x2, x3, x4) → Cond_f73_0_fact_ConstantStackPush(x1, x4)
f128_1_fact_Load(x1, x2, x3, x4) → f128_1_fact_Load(x4)
Cond_f73_0_fact_ConstantStackPush1(x1, x2, x3, x4) → Cond_f73_0_fact_ConstantStackPush1(x1, x4)
Filtered unneeded terms:
Cond_f73_0_fact_ConstantStackPush(x1, x2) → Cond_f73_0_fact_ConstantStackPush(x1)
Prepared 2 rules for path length conversion:
P rules:
f73_0_fact_ConstantStackPush(x0) → f128_1_fact_Load(-(x0, 1)) | >(x0, 1)
f73_0_fact_ConstantStackPush(x0) → f73_0_fact_ConstantStackPush(-(x0, 1)) | >(x0, 1)
Finished conversion. Obtained 1 rules.
P rules:
f73_0_fact_ConstantStackPush(x1) → f73_0_fact_ConstantStackPush(-(x1, 1)) | >(x1, 1)
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: