(0) Obligation:

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


(1) JBCToGraph (SOUND transformation)

Constructed TerminationGraph.

(2) Obligation:

Termination Graph based on JBC Program:
GCD4.main([Ljava/lang/String;)V: Graph of 212 nodes with 1 SCC.


(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: GCD4.main([Ljava/lang/String;)V
SCC calls the following helper methods:
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 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))

(6) Obligation:

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))

(7) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f1672_0_mod_LT(x5, x7)] = x5 + 2·x7

Therefore the following rule(s) have been dropped:


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))

(8) YES