0 JBC
↳1 JBCToGraph (⇒, 411 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 56 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇒, 0 ms)
↳8 intTRS
↳9 TerminationGraphProcessor (⇔, 0 ms)
↳10 YES
public class HanoiR {
private void solve(int h, int from, int to, int support) {
if (h < 1) return;
else if (h == 1) {
//System.out.println("from " + from + " to " + to + "\n");
}
else {
solve(h - 1, from, support, to);
//System.out.println("from " + from + " to " + to + "\n");
solve(h - 1, support, to, from);
}
}
public static void main(String[] args) {
Random.args = args;
new HanoiR().solve(Random.random(),1,2,3);
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
if (index >= args.length)
return 0;
String string = args[index];
index++;
return string.length();
}
}
Generated rules. Obtained 35 IRules
P rules:
f830_0_solve_ConstantStackPush(EOS, i202, i202, i202) → f833_0_solve_GE(EOS, i202, i202, i202, 1)
f833_0_solve_GE(EOS, i212, i212, i212, matching1) → f837_0_solve_GE(EOS, i212, i212, i212, 1) | =(matching1, 1)
f837_0_solve_GE(EOS, i212, i212, i212, matching1) → f840_0_solve_Load(EOS, i212, i212) | &&(>=(i212, 1), =(matching1, 1))
f840_0_solve_Load(EOS, i212, i212) → f844_0_solve_ConstantStackPush(EOS, i212, i212, i212)
f844_0_solve_ConstantStackPush(EOS, i212, i212, i212) → f898_0_solve_NE(EOS, i212, i212, i212, 1)
f898_0_solve_NE(EOS, i241, i241, i241, matching1) → f908_0_solve_NE(EOS, i241, i241, i241, 1) | =(matching1, 1)
f908_0_solve_NE(EOS, i241, i241, i241, matching1) → f920_0_solve_Load(EOS, i241, i241) | &&(>(i241, 1), =(matching1, 1))
f920_0_solve_Load(EOS, i241, i241) → f924_0_solve_Load(EOS, i241, i241)
f924_0_solve_Load(EOS, i241, i241) → f927_0_solve_ConstantStackPush(EOS, i241, i241, i241)
f927_0_solve_ConstantStackPush(EOS, i241, i241, i241) → f956_0_solve_IntArithmetic(EOS, i241, i241, i241, 1)
f956_0_solve_IntArithmetic(EOS, i241, i241, i241, matching1) → f963_0_solve_Load(EOS, i241, i241, -(i241, 1)) | &&(>(i241, 0), =(matching1, 1))
f963_0_solve_Load(EOS, i241, i241, i260) → f965_0_solve_Load(EOS, i241, i241, i260)
f965_0_solve_Load(EOS, i241, i241, i260) → f966_0_solve_Load(EOS, i241, i241, i260)
f966_0_solve_Load(EOS, i241, i241, i260) → f968_0_solve_InvokeMethod(EOS, i241, i241, i260)
f968_0_solve_InvokeMethod(EOS, i241, i241, i260) → f969_0_solve_Load(EOS, i260, i260)
f968_0_solve_InvokeMethod(EOS, i241, i241, i260) → f969_1_solve_Load(EOS, i241, i241, i260, i260)
f969_0_solve_Load(EOS, i260, i260) → f971_0_solve_Load(EOS, i260, i260)
f971_0_solve_Load(EOS, i260, i260) → f828_0_solve_Load(EOS, i260, i260)
f828_0_solve_Load(EOS, i202, i202) → f830_0_solve_ConstantStackPush(EOS, i202, i202, i202)
f997_0_solve_Return(EOS, i241, i241, matching1) → f1121_0_solve_Return(EOS, i241, i241, 1) | =(matching1, 1)
f1121_0_solve_Return(EOS, i241, i241, i418) → f1124_0_solve_Load(EOS, i241, i241)
f1124_0_solve_Load(EOS, i241, i241) → f1126_0_solve_Load(EOS, i241, i241)
f1126_0_solve_Load(EOS, i241, i241) → f1127_0_solve_ConstantStackPush(EOS, i241, i241)
f1127_0_solve_ConstantStackPush(EOS, i241, i241) → f1129_0_solve_IntArithmetic(EOS, i241, i241, 1)
f1129_0_solve_IntArithmetic(EOS, i241, i241, matching1) → f1130_0_solve_Load(EOS, i241, -(i241, 1)) | &&(>(i241, 0), =(matching1, 1))
f1130_0_solve_Load(EOS, i241, i428) → f1132_0_solve_Load(EOS, i241, i428)
f1132_0_solve_Load(EOS, i241, i428) → f1133_0_solve_Load(EOS, i241, i428)
f1133_0_solve_Load(EOS, i241, i428) → f1135_0_solve_InvokeMethod(EOS, i241, i428)
f1135_0_solve_InvokeMethod(EOS, i241, i428) → f1136_0_solve_Load(EOS, i428, i428)
f1135_0_solve_InvokeMethod(EOS, i241, i428) → f1136_1_solve_Load(EOS, i241, i428, i428)
f1136_0_solve_Load(EOS, i428, i428) → f1138_0_solve_Load(EOS, i428, i428)
f1138_0_solve_Load(EOS, i428, i428) → f828_0_solve_Load(EOS, i428, i428)
f1307_0_solve_Return(EOS, i241, i241, i602) → f1121_0_solve_Return(EOS, i241, i241, i602)
f969_1_solve_Load(EOS, i241, i241, matching1, matching2) → f997_0_solve_Return(EOS, i241, i241, 1) | &&(=(matching1, 1), =(matching2, 1))
f969_1_solve_Load(EOS, i241, i241, i602, i602) → f1307_0_solve_Return(EOS, i241, i241, i602)
Combined rules. Obtained 5 IRules
P rules:
f1135_0_solve_InvokeMethod(EOS, i241, i428) → f1136_1_solve_Load(EOS, i241, i428, i428)
f830_0_solve_ConstantStackPush(EOS, x0, x0, x0) → f830_0_solve_ConstantStackPush(EOS, -(x0, 1), -(x0, 1), -(x0, 1)) | >(x0, 1)
f1135_0_solve_InvokeMethod(EOS, x0, x1) → f830_0_solve_ConstantStackPush(EOS, x1, x1, x1)
f830_0_solve_ConstantStackPush(EOS, 2, 2, 2) → f1135_0_solve_InvokeMethod(EOS, 2, 1)
f830_0_solve_ConstantStackPush(EOS, x0, x0, x0) → f1135_0_solve_InvokeMethod(EOS, x0, -(x0, 1)) | >(x0, 1)
Filtered ground terms:
f1135_0_solve_InvokeMethod(x1, x2, x3) → f1135_0_solve_InvokeMethod(x2, x3)
f1136_1_solve_Load(x1, x2, x3, x4) → f1136_1_solve_Load(x2, x3, x4)
f830_0_solve_ConstantStackPush(x1, x2, x3, x4) → f830_0_solve_ConstantStackPush(x2, x3, x4)
Cond_f830_0_solve_ConstantStackPush(x1, x2, x3, x4, x5) → Cond_f830_0_solve_ConstantStackPush(x1, x3, x4, x5)
Cond_f830_0_solve_ConstantStackPush1(x1, x2, x3, x4, x5) → Cond_f830_0_solve_ConstantStackPush1(x1, x3, x4, x5)
Filtered duplicate terms:
f1136_1_solve_Load(x1, x2, x3) → f1136_1_solve_Load(x1, x3)
f830_0_solve_ConstantStackPush(x1, x2, x3) → f830_0_solve_ConstantStackPush(x3)
Cond_f830_0_solve_ConstantStackPush(x1, x2, x3, x4) → Cond_f830_0_solve_ConstantStackPush(x1, x4)
Cond_f830_0_solve_ConstantStackPush1(x1, x2, x3, x4) → Cond_f830_0_solve_ConstantStackPush1(x1, x4)
Filtered unneeded terms:
f1135_0_solve_InvokeMethod(x1, x2) → f1135_0_solve_InvokeMethod(x2)
Prepared 5 rules for path length conversion:
P rules:
f1135_0_solve_InvokeMethod(i428) → f1136_1_solve_Load(i241, i428)
f830_0_solve_ConstantStackPush(x0) → f830_0_solve_ConstantStackPush(-(x0, 1)) | >(x0, 1)
f1135_0_solve_InvokeMethod(x1) → f830_0_solve_ConstantStackPush(x1)
f830_0_solve_ConstantStackPush(2) → f1135_0_solve_InvokeMethod(1)
f830_0_solve_ConstantStackPush(x0) → f1135_0_solve_InvokeMethod(-(x0, 1)) | >(x0, 1)
Finished conversion. Obtained 4 rules.
P rules:
f830_0_solve_ConstantStackPush(x2) → f830_0_solve_ConstantStackPush(-(x2, 1)) | >(x2, 1)
f1135_0_solve_InvokeMethod(x3) → f830_0_solve_ConstantStackPush(x3)
f830_0_solve_ConstantStackPush(c2) → f1135_0_solve_InvokeMethod(1) | =(2, c2)
f830_0_solve_ConstantStackPush(x4) → f1135_0_solve_InvokeMethod(-(x4, 1)) | >(x4, 1)
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped:
Constructed the termination graph and obtained no non-trivial SCC(s).