(0) Obligation:

JBC Problem based on JBC Program:
/**
* Example taken from "A Term Rewriting Approach to the Automated Termination
* Analysis of Imperative Programs" (http://www.cs.unm.edu/~spf/papers/2009-02.pdf)
* and converted to Java.
*/

public class PastaC1 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();

while (x >= 0) {
int y = 1;
while (x > y) {
y = 2*y;
}
x--;
}
}
}


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:
PastaC1.main([Ljava/lang/String;)V: Graph of 124 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: PastaC1.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 24 IRules

P rules:
f295_0_main_LT(EOS, i38, i38) → f310_0_main_LT(EOS, i38, i38)
f310_0_main_LT(EOS, i38, i38) → f320_0_main_ConstantStackPush(EOS, i38) | >=(i38, 0)
f320_0_main_ConstantStackPush(EOS, i38) → f328_0_main_Store(EOS, i38, 1)
f328_0_main_Store(EOS, i38, matching1) → f334_0_main_Load(EOS, i38, 1) | =(matching1, 1)
f334_0_main_Load(EOS, i38, matching1) → f691_0_main_Load(EOS, i38, 1) | =(matching1, 1)
f691_0_main_Load(EOS, i71, i72) → f827_0_main_Load(EOS, i71, i72)
f827_0_main_Load(EOS, i71, i93) → f946_0_main_Load(EOS, i71, i93)
f946_0_main_Load(EOS, i71, i110) → f1196_0_main_Load(EOS, i71, i110)
f1196_0_main_Load(EOS, i71, i129) → f1199_0_main_Load(EOS, i71, i129, i71)
f1199_0_main_Load(EOS, i71, i129, i71) → f1201_0_main_LE(EOS, i71, i129, i71, i129)
f1201_0_main_LE(EOS, i71, i129, i71, i129) → f1204_0_main_LE(EOS, i71, i129, i71, i129)
f1201_0_main_LE(EOS, i71, i129, i71, i129) → f1205_0_main_LE(EOS, i71, i129, i71, i129)
f1204_0_main_LE(EOS, i71, i129, i71, i129) → f1207_0_main_Inc(EOS, i71) | <=(i71, i129)
f1207_0_main_Inc(EOS, i71) → f1211_0_main_JMP(EOS, +(i71, -1)) | >=(i71, 0)
f1211_0_main_JMP(EOS, i131) → f1220_0_main_Load(EOS, i131)
f1220_0_main_Load(EOS, i131) → f278_0_main_Load(EOS, i131)
f278_0_main_Load(EOS, i29) → f295_0_main_LT(EOS, i29, i29)
f1205_0_main_LE(EOS, i71, i129, i71, i129) → f1209_0_main_ConstantStackPush(EOS, i71, i129) | >(i71, i129)
f1209_0_main_ConstantStackPush(EOS, i71, i129) → f1213_0_main_Load(EOS, i71, i129, 2)
f1213_0_main_Load(EOS, i71, i129, matching1) → f1222_0_main_IntArithmetic(EOS, i71, 2, i129) | =(matching1, 2)
f1222_0_main_IntArithmetic(EOS, i71, matching1, i129) → f1420_0_main_Store(EOS, i71, *(2, i129)) | &&(>=(i129, 1), =(matching1, 2))
f1420_0_main_Store(EOS, i71, i147) → f1422_0_main_JMP(EOS, i71, i147)
f1422_0_main_JMP(EOS, i71, i147) → f1429_0_main_Load(EOS, i71, i147)
f1429_0_main_Load(EOS, i71, i147) → f1196_0_main_Load(EOS, i71, i147)

Combined rules. Obtained 2 IRules

P rules:
f1201_0_main_LE(EOS, x0, x1, x0, x1) → f1201_0_main_LE(EOS, -(x0, 1), 1, -(x0, 1), 1) | &&(>(+(x0, 1), 1), >=(x1, x0))
f1201_0_main_LE(EOS, x0, x1, x0, x1) → f1201_0_main_LE(EOS, x0, *(2, x1), x0, *(2, x1)) | &&(<(x1, x0), >(+(x1, 1), 1))

Filtered ground terms:


f1201_0_main_LE(x1, x2, x3, x4, x5) → f1201_0_main_LE(x2, x3, x4, x5)
Cond_f1201_0_main_LE(x1, x2, x3, x4, x5, x6) → Cond_f1201_0_main_LE(x1, x3, x4, x5, x6)
Cond_f1201_0_main_LE1(x1, x2, x3, x4, x5, x6) → Cond_f1201_0_main_LE1(x1, x3, x4, x5, x6)

Filtered duplicate terms:


f1201_0_main_LE(x1, x2, x3, x4) → f1201_0_main_LE(x3, x4)
Cond_f1201_0_main_LE(x1, x2, x3, x4, x5) → Cond_f1201_0_main_LE(x1, x4, x5)
Cond_f1201_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f1201_0_main_LE1(x1, x4, x5)

Filtered unneeded terms:


Cond_f1201_0_main_LE(x1, x2, x3) → Cond_f1201_0_main_LE(x1, x2)

Prepared 2 rules for path length conversion:

P rules:
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(-(x0, 1), 1) | &&(>(+(x0, 1), 1), >=(x1, x0))
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(x0, *(2, x1)) | &&(<(x1, x0), >(+(x1, 1), 1))

Finished conversion. Obtained 2 rules.

P rules:
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(-(x0, 1), 1) | &&(>(x0, 0), >=(x1, x0))
f1201_0_main_LE(x2, x3) → f1201_0_main_LE(x2, *(2, x3)) | &&(<(x3, x2), >(x3, 0))

(6) Obligation:

Rules:
f1201_0_main_LE(x0, x1) → f1201_0_main_LE(-(x0, 1), 1) | &&(>(x0, 0), >=(x1, x0))
f1201_0_main_LE(x2, x3) → f1201_0_main_LE(x2, *(2, x3)) | &&(<(x3, x2), >(x3, 0))

(7) PolynomialOrderProcessor (SOUND transformation)

Found the following polynomial interpretation:


[f1201_0_main_LE(x5, x7)] = x5

Therefore the following rule(s) have been dropped:


f1201_0_main_LE(x0, x1) → f1201_0_main_LE(-(x0, 1), 1) | &&(>(x0, 0), >=(x1, x0))

(8) Obligation:

Rules:
f1201_0_main_LE(x2, x3) → f1201_0_main_LE(x2, *(2, x3)) | &&(<(x3, x2), >(x3, 0))

(9) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f1201_0_main_LE(x3, x5)] = x3 - x5

Therefore the following rule(s) have been dropped:


f1201_0_main_LE(x0, x1) → f1201_0_main_LE(x0, *(2, x1)) | &&(<(x1, x0), >(x1, 0))

(10) YES