0 JBC
↳1 JBCToGraph (⇒, 137 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 36 ms)
↳6 intTRS
↳7 TerminationGraphProcessor (⇒, 37 ms)
↳8 intTRS
↳9 PolynomialOrderProcessor (⇔, 0 ms)
↳10 YES
package Nest;
public class Nest{
public static int nest(int x){
if (x == 0) return 0;
else return nest(nest(x-1));
}
public static void main(final String[] args) {
final int x = args[0].length();
final int y = nest(x);
}
}
Generated rules. Obtained 20 IRules
P rules:
f131_0_nest_NE(EOS, i23, i23, i23) → f136_0_nest_NE(EOS, i23, i23, i23)
f136_0_nest_NE(EOS, i23, i23, i23) → f139_0_nest_Load(EOS, i23, i23) | >(i23, 0)
f139_0_nest_Load(EOS, i23, i23) → f143_0_nest_ConstantStackPush(EOS, i23, i23)
f143_0_nest_ConstantStackPush(EOS, i23, i23) → f150_0_nest_IntArithmetic(EOS, i23, i23, 1)
f150_0_nest_IntArithmetic(EOS, i23, i23, matching1) → f157_0_nest_InvokeMethod(EOS, i23, -(i23, 1)) | &&(>(i23, 0), =(matching1, 1))
f157_0_nest_InvokeMethod(EOS, i23, i24) → f205_0_nest_Load(EOS, i24, i24)
f157_0_nest_InvokeMethod(EOS, i23, i24) → f205_1_nest_Load(EOS, i23, i24, i24)
f205_0_nest_Load(EOS, i24, i24) → f210_0_nest_Load(EOS, i24, i24)
f210_0_nest_Load(EOS, i24, i24) → f130_0_nest_Load(EOS, i24, i24)
f130_0_nest_Load(EOS, i18, i18) → f131_0_nest_NE(EOS, i18, i18, i18)
f234_0_nest_Return(EOS, i23, matching1, matching2, matching3) → f238_0_nest_InvokeMethod(EOS, i23, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
f238_0_nest_InvokeMethod(EOS, i23, matching1) → f325_0_nest_InvokeMethod(EOS, i23, 0) | =(matching1, 0)
f325_0_nest_InvokeMethod(EOS, i23, matching1) → f336_0_nest_Load(EOS, 0, 0) | =(matching1, 0)
f325_0_nest_InvokeMethod(EOS, i23, matching1) → f336_1_nest_Load(EOS, i23, 0, 0) | =(matching1, 0)
f336_0_nest_Load(EOS, matching1, matching2) → f340_0_nest_Load(EOS, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
f340_0_nest_Load(EOS, matching1, matching2) → f130_0_nest_Load(EOS, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
f399_0_nest_Return(EOS, i23, i54, matching1) → f314_0_nest_Return(EOS, i23, i54, 0) | =(matching1, 0)
f314_0_nest_Return(EOS, i23, i42, matching1) → f325_0_nest_InvokeMethod(EOS, i23, 0) | =(matching1, 0)
f205_1_nest_Load(EOS, i23, matching1, matching2) → f234_0_nest_Return(EOS, i23, 0, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
f205_1_nest_Load(EOS, i23, i54, i54) → f399_0_nest_Return(EOS, i23, i54, 0)
Combined rules. Obtained 5 IRules
P rules:
f325_0_nest_InvokeMethod(EOS, i23, 0) → f336_1_nest_Load(EOS, i23, 0, 0)
f131_0_nest_NE(EOS, x0, x0, x0) → f131_0_nest_NE(EOS, -(x0, 1), -(x0, 1), -(x0, 1)) | >(x0, 0)
f325_0_nest_InvokeMethod(EOS, x0, 0) → f131_0_nest_NE(EOS, 0, 0, 0)
f131_0_nest_NE(EOS, 1, 1, 1) → f325_0_nest_InvokeMethod(EOS, 1, 0)
f131_0_nest_NE(EOS, x0, x0, x0) → f325_0_nest_InvokeMethod(EOS, x0, 0) | >(x0, 0)
Filtered ground terms:
f325_0_nest_InvokeMethod(x1, x2, x3) → f325_0_nest_InvokeMethod(x2)
f336_1_nest_Load(x1, x2, x3, x4) → f336_1_nest_Load(x2)
f131_0_nest_NE(x1, x2, x3, x4) → f131_0_nest_NE(x2, x3, x4)
Cond_f131_0_nest_NE(x1, x2, x3, x4, x5) → Cond_f131_0_nest_NE(x1, x3, x4, x5)
Cond_f131_0_nest_NE1(x1, x2, x3, x4, x5) → Cond_f131_0_nest_NE1(x1, x3, x4, x5)
Filtered duplicate terms:
f131_0_nest_NE(x1, x2, x3) → f131_0_nest_NE(x3)
Cond_f131_0_nest_NE(x1, x2, x3, x4) → Cond_f131_0_nest_NE(x1, x4)
Cond_f131_0_nest_NE1(x1, x2, x3, x4) → Cond_f131_0_nest_NE1(x1, x4)
Filtered unneeded terms:
Cond_f131_0_nest_NE1(x1, x2) → Cond_f131_0_nest_NE1(x1)
Prepared 5 rules for path length conversion:
P rules:
f325_0_nest_InvokeMethod(i23) → f336_1_nest_Load(i23)
f131_0_nest_NE(x0) → f131_0_nest_NE(-(x0, 1)) | >(x0, 0)
f325_0_nest_InvokeMethod(x0) → f131_0_nest_NE(0)
f131_0_nest_NE(1) → f325_0_nest_InvokeMethod(1)
f131_0_nest_NE(x0) → f325_0_nest_InvokeMethod(x0) | >(x0, 0)
Finished conversion. Obtained 4 rules.
P rules:
f131_0_nest_NE(x1) → f131_0_nest_NE(-(x1, 1)) | >(x1, 0)
f325_0_nest_InvokeMethod(x2) → f131_0_nest_NE(0)
f131_0_nest_NE(c1) → f325_0_nest_InvokeMethod(1) | =(1, c1)
f131_0_nest_NE(x3) → f325_0_nest_InvokeMethod(x3) | >(x3, 0)
Constructed the termination graph and obtained one non-trivial SCC.
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: