0 JBC
↳1 JBCToGraph (⇒, 716 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 26 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇔, 0 ms)
↳8 YES
public class GCD4 {
public static int mod(int a, int b) {
while(a>=b && b > 0) {
a -= b;
}
return a;
}
public static int gcd(int a, int b) {
int tmp;
while(b > 0 && a > 0) {
tmp = b;
b = mod(a, b);
a = tmp;
}
return a;
}
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
gcd(x, y);
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
Generated rules. Obtained 33 IRules
P rules:
f1315_0_gcd_LE(EOS, i182, i191, i191) → f1317_0_gcd_LE(EOS, i182, i191, i191)
f1317_0_gcd_LE(EOS, i182, i191, i191) → f1321_0_gcd_Load(EOS, i182, i191) | >(i191, 0)
f1321_0_gcd_Load(EOS, i182, i191) → f1325_0_gcd_LE(EOS, i182, i191, i182)
f1325_0_gcd_LE(EOS, i193, i191, i193) → f1329_0_gcd_LE(EOS, i193, i191, i193)
f1329_0_gcd_LE(EOS, i193, i191, i193) → f1336_0_gcd_Load(EOS, i193, i191) | >(i193, 0)
f1336_0_gcd_Load(EOS, i193, i191) → f1342_0_gcd_Store(EOS, i193, i191, i191)
f1342_0_gcd_Store(EOS, i193, i191, i191) → f1345_0_gcd_Load(EOS, i193, i191, i191)
f1345_0_gcd_Load(EOS, i193, i191, i191) → f1350_0_gcd_Load(EOS, i191, i191, i193)
f1350_0_gcd_Load(EOS, i191, i191, i193) → f1353_0_gcd_InvokeMethod(EOS, i191, i193, i191)
f1353_0_gcd_InvokeMethod(EOS, i191, i193, i191) → f1355_0_mod_Load(EOS, i191, i193, i191, i193, i191)
f1355_0_mod_Load(EOS, i191, i193, i191, i193, i191) → f1669_0_mod_Load(EOS, i191, i193, i191, i193, i191)
f1669_0_mod_Load(EOS, i191, i193, i191, i281, i191) → f1671_0_mod_Load(EOS, i191, i193, i191, i281, i191, i281)
f1671_0_mod_Load(EOS, i191, i193, i191, i281, i191, i281) → f1672_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191)
f1672_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191) → f1674_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191)
f1672_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191) → f1675_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191)
f1674_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191) → f1676_0_mod_Load(EOS, i191, i193, i191, i281) | <(i281, i191)
f1676_0_mod_Load(EOS, i191, i193, i191, i281) → f1679_0_mod_Return(EOS, i191, i193, i191, i281)
f1679_0_mod_Return(EOS, i191, i193, i191, i281) → f1682_0_gcd_Store(EOS, i191, i281)
f1682_0_gcd_Store(EOS, i191, i281) → f1685_0_gcd_Load(EOS, i281, i191)
f1685_0_gcd_Load(EOS, i281, i191) → f1688_0_gcd_Store(EOS, i281, i191)
f1688_0_gcd_Store(EOS, i281, i191) → f1690_0_gcd_JMP(EOS, i191, i281)
f1690_0_gcd_JMP(EOS, i191, i281) → f1695_0_gcd_Load(EOS, i191, i281)
f1695_0_gcd_Load(EOS, i191, i281) → f1310_0_gcd_Load(EOS, i191, i281)
f1310_0_gcd_Load(EOS, i182, i183) → f1315_0_gcd_LE(EOS, i182, i183, i183)
f1675_0_mod_LT(EOS, i191, i193, i191, i281, i191, i281, i191) → f1678_0_mod_Load(EOS, i191, i193, i191, i281, i191) | >=(i281, i191)
f1678_0_mod_Load(EOS, i191, i193, i191, i281, i191) → f1680_0_mod_LE(EOS, i191, i193, i191, i281, i191, i191)
f1680_0_mod_LE(EOS, i191, i193, i191, i281, i191, i191) → f1684_0_mod_Load(EOS, i191, i193, i191, i281, i191) | >(i191, 0)
f1684_0_mod_Load(EOS, i191, i193, i191, i281, i191) → f1686_0_mod_Load(EOS, i191, i193, i191, i191, i281)
f1686_0_mod_Load(EOS, i191, i193, i191, i191, i281) → f1689_0_mod_IntArithmetic(EOS, i191, i193, i191, i191, i281, i191)
f1689_0_mod_IntArithmetic(EOS, i191, i193, i191, i191, i281, i191) → f1692_0_mod_Store(EOS, i191, i193, i191, i191, -(i281, i191)) | >(i191, 0)
f1692_0_mod_Store(EOS, i191, i193, i191, i191, i283) → f1697_0_mod_JMP(EOS, i191, i193, i191, i283, i191)
f1697_0_mod_JMP(EOS, i191, i193, i191, i283, i191) → f2113_0_mod_Load(EOS, i191, i193, i191, i283, i191)
f2113_0_mod_Load(EOS, i191, i193, i191, i283, i191) → f1669_0_mod_Load(EOS, i191, i193, i191, i283, i191)
Combined rules. Obtained 2 IRules
P rules:
f1672_0_mod_LT(EOS, x0, x1, x0, x2, x0, x2, x0) → f1672_0_mod_LT(EOS, x2, x0, x2, x0, x2, x0, x2) | &&(&&(>(x2, 0), >(x0, 0)), <(x2, x0))
f1672_0_mod_LT(EOS, x0, x1, x0, x2, x0, x2, x0) → f1672_0_mod_LT(EOS, x0, x1, x0, -(x2, x0), x0, -(x2, x0), x0) | &&(>=(x2, x0), >(x0, 0))
Filtered ground terms:
f1672_0_mod_LT(x1, x2, x3, x4, x5, x6, x7, x8) → f1672_0_mod_LT(x2, x3, x4, x5, x6, x7, x8)
Cond_f1672_0_mod_LT(x1, x2, x3, x4, x5, x6, x7, x8, x9) → Cond_f1672_0_mod_LT(x1, x3, x4, x5, x6, x7, x8, x9)
Cond_f1672_0_mod_LT1(x1, x2, x3, x4, x5, x6, x7, x8, x9) → Cond_f1672_0_mod_LT1(x1, x3, x4, x5, x6, x7, x8, x9)
Filtered duplicate terms:
f1672_0_mod_LT(x1, x2, x3, x4, x5, x6, x7) → f1672_0_mod_LT(x2, x6, x7)
Cond_f1672_0_mod_LT(x1, x2, x3, x4, x5, x6, x7, x8) → Cond_f1672_0_mod_LT(x1, x3, x7, x8)
Cond_f1672_0_mod_LT1(x1, x2, x3, x4, x5, x6, x7, x8) → Cond_f1672_0_mod_LT1(x1, x3, x7, x8)
Filtered unneeded terms:
Cond_f1672_0_mod_LT(x1, x2, x3, x4) → Cond_f1672_0_mod_LT(x1, x3, x4)
Cond_f1672_0_mod_LT1(x1, x2, x3, x4) → Cond_f1672_0_mod_LT1(x1, x3, x4)
f1672_0_mod_LT(x1, x2, x3) → f1672_0_mod_LT(x2, x3)
Prepared 2 rules for path length conversion:
P rules:
f1672_0_mod_LT(x2, x0) → f1672_0_mod_LT(x0, x2) | &&(&&(>(x2, 0), >(x0, 0)), <(x2, x0))
f1672_0_mod_LT(x2, x0) → f1672_0_mod_LT(-(x2, x0), x0) | &&(>=(x2, x0), >(x0, 0))
Finished conversion. Obtained 2 rules.
P rules:
f1672_0_mod_LT(x0, x1) → f1672_0_mod_LT(x1, x0) | &&(&&(>(x1, x0), >(x0, 0)), >(x1, 0))
f1672_0_mod_LT(x2, x3) → f1672_0_mod_LT(-(x2, x3), x3) | &&(<=(x3, x2), >(x3, 0))
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: