(0) Obligation:

JBC Problem based on JBC Program:
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;
}
}


(1) JBCToGraph (SOUND transformation)

Constructed TerminationGraph.

(2) Obligation:

Termination Graph based on JBC Program:
TerminatorRec02.main([Ljava/lang/String;)V: Graph of 37 nodes with 0 SCCs.

TerminatorRec02.fact(I)I: Graph of 29 nodes with 0 SCCs.


(3) TerminationGraphToSCCProof (SOUND transformation)

Splitted TerminationGraph to 1 SCCs.

(4) Obligation:

SCC of termination graph based on JBC Program.
SCC contains nodes from the following methods: TerminatorRec02.fact(I)I
SCC calls the following helper methods: TerminatorRec02.fact(I)I
Performed SCC analyses:
  • Used field analysis yielded the following read fields:
  • Marker field analysis yielded the following relations that could be markers:

(5) SCCToIntTRSProof (SOUND transformation)

Transformed FIGraph SCCs to intTRSs. Log:

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)

(6) Obligation:

Rules:
f73_0_fact_ConstantStackPush(x1) → f73_0_fact_ConstantStackPush(-(x1, 1)) | >(x1, 1)

(7) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f73_0_fact_ConstantStackPush(x2)] = x2

Therefore the following rule(s) have been dropped:


f73_0_fact_ConstantStackPush(x0) → f73_0_fact_ConstantStackPush(-(x0, 1)) | >(x0, 1)

(8) YES