0 JBC
↳1 JBCToGraph (⇒, 814 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 AND
↳5 JBCTerminationSCC
↳6 SCCToIntTRSProof (⇒, 16 ms)
↳7 intTRS
↳8 TerminationGraphProcessor (⇒, 1 ms)
↳9 AND
↳10 intTRS
↳11 PolynomialOrderProcessor (⇔, 0 ms)
↳12 YES
↳13 intTRS
↳14 PolynomialOrderProcessor (⇔, 0 ms)
↳15 YES
↳16 JBCTerminationSCC
↳17 SCCToIntTRSProof (⇒, 34 ms)
↳18 intTRS
↳19 PolynomialOrderProcessor (⇔, 0 ms)
↳20 YES
public class TimesPlusUserDef {
public static void main(String[] args) {
int x, y;
x = args[0].length();
y = args[1].length();
times(x, y);
}
public static int times(int x, int y) {
if (y == 0)
return 0;
if (y > 0)
return plus(times(x, y - 1), x);
return 0;
}
public static int plus(int x, int y) {
if (y > 0) {
return 1 + plus(x, y-1);
} else if (x > 0) {
return 1 + plus(x-1, y);
} else {
return 0;
}
}
}
Generated rules. Obtained 26 IRules
P rules:
f1801_0_plus_LE(EOS, i653, matching1, i653, matching2, matching3) → f1802_0_plus_LE(EOS, i653, 0, i653, 0, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
f1801_0_plus_LE(EOS, i653, i656, i653, i656, i656) → f1803_0_plus_LE(EOS, i653, i656, i653, i656, i656)
f1802_0_plus_LE(EOS, i653, matching1, i653, matching2, matching3) → f1804_0_plus_Load(EOS, i653, 0, i653, 0) | &&(&&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0)), =(matching3, 0))
f1804_0_plus_Load(EOS, i653, matching1, i653, matching2) → f1807_0_plus_LE(EOS, i653, 0, i653, 0, i653) | &&(=(matching1, 0), =(matching2, 0))
f1807_0_plus_LE(EOS, i658, matching1, i658, matching2, i658) → f1811_0_plus_LE(EOS, i658, 0, i658, 0, i658) | &&(=(matching1, 0), =(matching2, 0))
f1811_0_plus_LE(EOS, i658, matching1, i658, matching2, i658) → f1816_0_plus_ConstantStackPush(EOS, i658, 0, i658, 0) | &&(&&(>(i658, 0), =(matching1, 0)), =(matching2, 0))
f1816_0_plus_ConstantStackPush(EOS, i658, matching1, i658, matching2) → f1822_0_plus_Load(EOS, i658, 0, i658, 0, 1) | &&(=(matching1, 0), =(matching2, 0))
f1822_0_plus_Load(EOS, i658, matching1, i658, matching2, matching3) → f1825_0_plus_ConstantStackPush(EOS, i658, 0, 0, 1, i658) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 1))
f1825_0_plus_ConstantStackPush(EOS, i658, matching1, matching2, matching3, i658) → f1832_0_plus_IntArithmetic(EOS, i658, 0, 0, 1, i658, 1) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 1))
f1832_0_plus_IntArithmetic(EOS, i658, matching1, matching2, matching3, i658, matching4) → f1838_0_plus_Load(EOS, i658, 0, 0, 1, -(i658, 1)) | &&(&&(&&(&&(>(i658, 0), =(matching1, 0)), =(matching2, 0)), =(matching3, 1)), =(matching4, 1))
f1838_0_plus_Load(EOS, i658, matching1, matching2, matching3, i662) → f1847_0_plus_InvokeMethod(EOS, i658, 0, 1, i662, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 1))
f1847_0_plus_InvokeMethod(EOS, i658, matching1, matching2, i662, matching3) → f1861_0_plus_Load(EOS, i662, 0, i662, 0) | &&(&&(=(matching1, 0), =(matching2, 1)), =(matching3, 0))
f1847_0_plus_InvokeMethod(EOS, i658, matching1, matching2, i662, matching3) → f1861_1_plus_Load(EOS, i658, 0, 1, i662, 0, i662, 0) | &&(&&(=(matching1, 0), =(matching2, 1)), =(matching3, 0))
f1861_0_plus_Load(EOS, i662, matching1, i662, matching2) → f1872_0_plus_Load(EOS, i662, 0, i662, 0) | &&(=(matching1, 0), =(matching2, 0))
f1872_0_plus_Load(EOS, i662, matching1, i662, matching2) → f1799_0_plus_Load(EOS, i662, 0, i662, 0) | &&(=(matching1, 0), =(matching2, 0))
f1799_0_plus_Load(EOS, i653, i654, i653, i654) → f1801_0_plus_LE(EOS, i653, i654, i653, i654, i654)
f1803_0_plus_LE(EOS, i653, i656, i653, i656, i656) → f1806_0_plus_ConstantStackPush(EOS, i653, i656, i653, i656) | >(i656, 0)
f1806_0_plus_ConstantStackPush(EOS, i653, i656, i653, i656) → f1809_0_plus_Load(EOS, i653, i656, i653, i656, 1)
f1809_0_plus_Load(EOS, i653, i656, i653, i656, matching1) → f1812_0_plus_Load(EOS, i653, i656, i653, i656, 1, i653) | =(matching1, 1)
f1812_0_plus_Load(EOS, i653, i656, i653, i656, matching1, i653) → f1817_0_plus_ConstantStackPush(EOS, i653, i656, i653, i656, 1, i653, i656) | =(matching1, 1)
f1817_0_plus_ConstantStackPush(EOS, i653, i656, i653, i656, matching1, i653, i656) → f1823_0_plus_IntArithmetic(EOS, i653, i656, i653, i656, 1, i653, i656, 1) | =(matching1, 1)
f1823_0_plus_IntArithmetic(EOS, i653, i656, i653, i656, matching1, i653, i656, matching2) → f1827_0_plus_InvokeMethod(EOS, i653, i656, i653, i656, 1, i653, -(i656, 1)) | &&(&&(>(i656, 0), =(matching1, 1)), =(matching2, 1))
f1827_0_plus_InvokeMethod(EOS, i653, i656, i653, i656, matching1, i653, i661) → f1835_0_plus_Load(EOS, i653, i661, i653, i661) | =(matching1, 1)
f1827_0_plus_InvokeMethod(EOS, i653, i656, i653, i656, matching1, i653, i661) → f1835_1_plus_Load(EOS, i653, i656, i653, i656, 1, i653, i661, i653, i661) | =(matching1, 1)
f1835_0_plus_Load(EOS, i653, i661, i653, i661) → f1841_0_plus_Load(EOS, i653, i661, i653, i661)
f1841_0_plus_Load(EOS, i653, i661, i653, i661) → f1799_0_plus_Load(EOS, i653, i661, i653, i661)
Combined rules. Obtained 4 IRules
P rules:
f1801_0_plus_LE(EOS, x0, 0, x0, 0, 0) → f1861_1_plus_Load(EOS, x0, 0, 1, -(x0, 1), 0, -(x0, 1), 0) | >(x0, 0)
f1801_0_plus_LE(EOS, x0, 0, x0, 0, 0) → f1801_0_plus_LE(EOS, -(x0, 1), 0, -(x0, 1), 0, 0) | >(x0, 0)
f1801_0_plus_LE(EOS, x0, x1, x0, x1, x1) → f1835_1_plus_Load(EOS, x0, x1, x0, x1, 1, x0, -(x1, 1), x0, -(x1, 1)) | >(x1, 0)
f1801_0_plus_LE(EOS, x0, x1, x0, x1, x1) → f1801_0_plus_LE(EOS, x0, -(x1, 1), x0, -(x1, 1), -(x1, 1)) | >(x1, 0)
Filtered ground terms:
f1801_0_plus_LE(x1, x2, x3, x4, x5, x6) → f1801_0_plus_LE(x2, x3, x4, x5, x6)
Cond_f1801_0_plus_LE(x1, x2, x3, x4, x5, x6, x7) → Cond_f1801_0_plus_LE(x1, x3, x5)
f1861_1_plus_Load(x1, x2, x3, x4, x5, x6, x7, x8) → f1861_1_plus_Load(x2, x5, x7)
Cond_f1801_0_plus_LE1(x1, x2, x3, x4, x5, x6, x7) → Cond_f1801_0_plus_LE1(x1, x3, x5)
Cond_f1801_0_plus_LE2(x1, x2, x3, x4, x5, x6, x7) → Cond_f1801_0_plus_LE2(x1, x3, x4, x5, x6, x7)
f1835_1_plus_Load(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) → f1835_1_plus_Load(x2, x3, x4, x5, x7, x8, x9, x10)
Cond_f1801_0_plus_LE3(x1, x2, x3, x4, x5, x6, x7) → Cond_f1801_0_plus_LE3(x1, x3, x4, x5, x6, x7)
Filtered duplicate terms:
f1801_0_plus_LE(x1, x2, x3, x4, x5) → f1801_0_plus_LE(x3, x5)
Cond_f1801_0_plus_LE(x1, x2, x3) → Cond_f1801_0_plus_LE(x1, x3)
f1861_1_plus_Load(x1, x2, x3) → f1861_1_plus_Load(x3)
Cond_f1801_0_plus_LE1(x1, x2, x3) → Cond_f1801_0_plus_LE1(x1, x3)
Cond_f1801_0_plus_LE2(x1, x2, x3, x4, x5, x6) → Cond_f1801_0_plus_LE2(x1, x4, x6)
f1835_1_plus_Load(x1, x2, x3, x4, x5, x6, x7, x8) → f1835_1_plus_Load(x7, x8)
Cond_f1801_0_plus_LE3(x1, x2, x3, x4, x5, x6) → Cond_f1801_0_plus_LE3(x1, x4, x6)
Filtered unneeded terms:
Cond_f1801_0_plus_LE(x1, x2) → Cond_f1801_0_plus_LE(x1)
Cond_f1801_0_plus_LE2(x1, x2, x3) → Cond_f1801_0_plus_LE2(x1)
Prepared 4 rules for path length conversion:
P rules:
f1801_0_plus_LE(x0, 0) → f1861_1_plus_Load(-(x0, 1)) | >(x0, 0)
f1801_0_plus_LE(x0, 0) → f1801_0_plus_LE(-(x0, 1), 0) | >(x0, 0)
f1801_0_plus_LE(x0, x1) → f1835_1_plus_Load(x0, -(x1, 1)) | >(x1, 0)
f1801_0_plus_LE(x0, x1) → f1801_0_plus_LE(x0, -(x1, 1)) | >(x1, 0)
Finished conversion. Obtained 2 rules.
P rules:
f1801_0_plus_LE(x1, c0) → f1801_0_plus_LE(-(x1, 1), 0) | &&(>(x1, 0), =(0, c0))
f1801_0_plus_LE(x4, x5) → f1801_0_plus_LE(x4, -(x5, 1)) | >(x5, 0)
Constructed the termination graph and obtained 2 non-trivial SCCs.
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped:
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped:
Generated rules. Obtained 13 IRules
P rules:
f286_0_times_NE(EOS, i18, i43, i18, i43, i43) → f290_0_times_NE(EOS, i18, i43, i18, i43, i43)
f290_0_times_NE(EOS, i18, i43, i18, i43, i43) → f295_0_times_Load(EOS, i18, i43, i18, i43) | >(i43, 0)
f295_0_times_Load(EOS, i18, i43, i18, i43) → f311_0_times_LE(EOS, i18, i43, i18, i43, i43)
f311_0_times_LE(EOS, i18, i43, i18, i43, i43) → f326_0_times_Load(EOS, i18, i43, i18, i43) | >(i43, 0)
f326_0_times_Load(EOS, i18, i43, i18, i43) → f342_0_times_Load(EOS, i18, i43, i18, i43, i18)
f342_0_times_Load(EOS, i18, i43, i18, i43, i18) → f398_0_times_ConstantStackPush(EOS, i18, i43, i18, i18, i43)
f398_0_times_ConstantStackPush(EOS, i18, i43, i18, i18, i43) → f405_0_times_IntArithmetic(EOS, i18, i43, i18, i18, i43, 1)
f405_0_times_IntArithmetic(EOS, i18, i43, i18, i18, i43, matching1) → f409_0_times_InvokeMethod(EOS, i18, i43, i18, i18, -(i43, 1)) | &&(>(i43, 0), =(matching1, 1))
f409_0_times_InvokeMethod(EOS, i18, i43, i18, i18, i60) → f417_0_times_Load(EOS, i18, i60, i18, i60)
f409_0_times_InvokeMethod(EOS, i18, i43, i18, i18, i60) → f417_1_times_Load(EOS, i18, i43, i18, i18, i60, i18, i60)
f417_0_times_Load(EOS, i18, i60, i18, i60) → f425_0_times_Load(EOS, i18, i60, i18, i60)
f425_0_times_Load(EOS, i18, i60, i18, i60) → f279_0_times_Load(EOS, i18, i60, i18, i60)
f279_0_times_Load(EOS, i18, i36, i18, i36) → f286_0_times_NE(EOS, i18, i36, i18, i36, i36)
Combined rules. Obtained 2 IRules
P rules:
f286_0_times_NE(EOS, x0, x1, x0, x1, x1) → f417_1_times_Load(EOS, x0, x1, x0, x0, -(x1, 1), x0, -(x1, 1)) | >(x1, 0)
f286_0_times_NE(EOS, x0, x1, x0, x1, x1) → f286_0_times_NE(EOS, x0, -(x1, 1), x0, -(x1, 1), -(x1, 1)) | >(x1, 0)
Filtered ground terms:
f286_0_times_NE(x1, x2, x3, x4, x5, x6) → f286_0_times_NE(x2, x3, x4, x5, x6)
Cond_f286_0_times_NE(x1, x2, x3, x4, x5, x6, x7) → Cond_f286_0_times_NE(x1, x3, x4, x5, x6, x7)
f417_1_times_Load(x1, x2, x3, x4, x5, x6, x7, x8) → f417_1_times_Load(x2, x3, x4, x5, x6, x7, x8)
Cond_f286_0_times_NE1(x1, x2, x3, x4, x5, x6, x7) → Cond_f286_0_times_NE1(x1, x3, x4, x5, x6, x7)
Filtered duplicate terms:
f286_0_times_NE(x1, x2, x3, x4, x5) → f286_0_times_NE(x3, x5)
Cond_f286_0_times_NE(x1, x2, x3, x4, x5, x6) → Cond_f286_0_times_NE(x1, x4, x6)
f417_1_times_Load(x1, x2, x3, x4, x5, x6, x7) → f417_1_times_Load(x6, x7)
Cond_f286_0_times_NE1(x1, x2, x3, x4, x5, x6) → Cond_f286_0_times_NE1(x1, x4, x6)
Filtered unneeded terms:
Cond_f286_0_times_NE(x1, x2, x3) → Cond_f286_0_times_NE(x1)
Cond_f286_0_times_NE1(x1, x2, x3) → Cond_f286_0_times_NE1(x1, x3)
f286_0_times_NE(x1, x2) → f286_0_times_NE(x2)
Prepared 2 rules for path length conversion:
P rules:
f286_0_times_NE(x1) → f417_1_times_Load(x0, -(x1, 1)) | >(x1, 0)
f286_0_times_NE(x1) → f286_0_times_NE(-(x1, 1)) | >(x1, 0)
Finished conversion. Obtained 1 rules.
P rules:
f286_0_times_NE(x2) → f286_0_times_NE(-(x2, 1)) | >(x2, 0)
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: