(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 PastaB17 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z = Random.random();

while (x > z) {
while (y > z) {
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:
PastaB17.main([Ljava/lang/String;)V: Graph of 255 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: PastaB17.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 16 IRules

P rules:
f2471_0_main_Load(EOS, i558, i559, i102, i558) → f2473_0_main_LE(EOS, i558, i559, i102, i558, i102)
f2473_0_main_LE(EOS, i558, i559, i102, i558, i102) → f2476_0_main_LE(EOS, i558, i559, i102, i558, i102)
f2476_0_main_LE(EOS, i558, i559, i102, i558, i102) → f2480_0_main_Load(EOS, i558, i559, i102) | >(i558, i102)
f2480_0_main_Load(EOS, i558, i559, i102) → f2484_0_main_Load(EOS, i558, i559, i102, i559)
f2484_0_main_Load(EOS, i558, i559, i102, i559) → f2487_0_main_LE(EOS, i558, i559, i102, i559, i102)
f2487_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2490_0_main_LE(EOS, i558, i559, i102, i559, i102)
f2487_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2491_0_main_LE(EOS, i558, i559, i102, i559, i102)
f2490_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2492_0_main_Inc(EOS, i558, i559, i102) | <=(i559, i102)
f2492_0_main_Inc(EOS, i558, i559, i102) → f2498_0_main_JMP(EOS, +(i558, -1), i559, i102)
f2498_0_main_JMP(EOS, i565, i559, i102) → f2515_0_main_Load(EOS, i565, i559, i102)
f2515_0_main_Load(EOS, i565, i559, i102) → f2467_0_main_Load(EOS, i565, i559, i102)
f2467_0_main_Load(EOS, i558, i559, i102) → f2471_0_main_Load(EOS, i558, i559, i102, i558)
f2491_0_main_LE(EOS, i558, i559, i102, i559, i102) → f2495_0_main_Inc(EOS, i558, i559, i102) | >(i559, i102)
f2495_0_main_Inc(EOS, i558, i559, i102) → f2500_0_main_JMP(EOS, i558, +(i559, -1), i102)
f2500_0_main_JMP(EOS, i558, i566, i102) → f2529_0_main_Load(EOS, i558, i566, i102)
f2529_0_main_Load(EOS, i558, i566, i102) → f2480_0_main_Load(EOS, i558, i566, i102)

Combined rules. Obtained 2 IRules

P rules:
f2487_0_main_LE(EOS, x0, x1, x2, x1, x2) → f2487_0_main_LE(EOS, -(x0, 1), x1, x2, x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(EOS, x0, x1, x2, x1, x2) → f2487_0_main_LE(EOS, x0, -(x1, 1), x2, -(x1, 1), x2) | <(x2, x1)

Filtered ground terms:


f2487_0_main_LE(x1, x2, x3, x4, x5, x6) → f2487_0_main_LE(x2, x3, x4, x5, x6)
Cond_f2487_0_main_LE(x1, x2, x3, x4, x5, x6, x7) → Cond_f2487_0_main_LE(x1, x3, x4, x5, x6, x7)
Cond_f2487_0_main_LE1(x1, x2, x3, x4, x5, x6, x7) → Cond_f2487_0_main_LE1(x1, x3, x4, x5, x6, x7)

Filtered duplicate terms:


f2487_0_main_LE(x1, x2, x3, x4, x5) → f2487_0_main_LE(x1, x4, x5)
Cond_f2487_0_main_LE(x1, x2, x3, x4, x5, x6) → Cond_f2487_0_main_LE(x1, x2, x5, x6)
Cond_f2487_0_main_LE1(x1, x2, x3, x4, x5, x6) → Cond_f2487_0_main_LE1(x1, x2, x5, x6)

Prepared 2 rules for path length conversion:

P rules:
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(x0, -(x1, 1), x2) | <(x2, x1)

Finished conversion. Obtained 2 rules.

P rules:
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(x3, x4, x5) → f2487_0_main_LE(x3, -(x4, 1), x5) | <(x5, x4)

(6) Obligation:

Rules:
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))
f2487_0_main_LE(x3, x4, x5) → f2487_0_main_LE(x3, -(x4, 1), x5) | <(x5, x4)

(7) TerminationGraphProcessor (SOUND transformation)

Constructed the termination graph and obtained 2 non-trivial SCCs.


(8) Complex Obligation (AND)

(9) Obligation:

Rules:
f2487_0_main_LE(x3, x4, x5) → f2487_0_main_LE(x3, -(x4, 1), x5) | <(x5, x4)

(10) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f2487_0_main_LE(x4, x6, x8)] = x6 - x8

Therefore the following rule(s) have been dropped:


f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(x0, -(x1, 1), x2) | <(x2, x1)

(11) YES

(12) Obligation:

Rules:
f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))

(13) LinearRankingProcessor (EQUIVALENT transformation)

Linear ranking:


[f2487_0_main_LE(x)] = 1·x1 + (-1)·x3

where x = (x1, ... ,xn).



Therefore the following rule(s) have been dropped:


f2487_0_main_LE(x0, x1, x2) → f2487_0_main_LE(-(x0, 1), x1, x2) | &&(<(x2, -(x0, 1)), >=(x2, x1))

(14) YES