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

while (x + y > 0) {
if (x > y) {
x--;
} else if (x == y) {
x--;
} else {
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:
PastaB11.main([Ljava/lang/String;)V: Graph of 199 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: PastaB11.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 26 IRules

P rules:
f2689_0_main_Load(EOS, i134, i926, i134) → f2692_0_main_IntArithmetic(EOS, i134, i926, i134, i926)
f2692_0_main_IntArithmetic(EOS, i134, i926, i134, i926) → f2694_0_main_LE(EOS, i134, i926, +(i134, i926))
f2694_0_main_LE(EOS, i134, i926, i940) → f2700_0_main_LE(EOS, i134, i926, i940)
f2700_0_main_LE(EOS, i134, i926, i940) → f2704_0_main_Load(EOS, i134, i926) | >(i940, 0)
f2704_0_main_Load(EOS, i134, i926) → f2709_0_main_Load(EOS, i134, i926, i134)
f2709_0_main_Load(EOS, i134, i926, i134) → f2711_0_main_LE(EOS, i134, i926, i134, i926)
f2711_0_main_LE(EOS, i134, i926, i134, i926) → f2714_0_main_LE(EOS, i134, i926, i134, i926)
f2711_0_main_LE(EOS, i134, i926, i134, i926) → f2715_0_main_LE(EOS, i134, i926, i134, i926)
f2714_0_main_LE(EOS, i134, i926, i134, i926) → f2717_0_main_Load(EOS, i134, i926) | <=(i134, i926)
f2717_0_main_Load(EOS, i134, i926) → f2721_0_main_Load(EOS, i134, i926, i134)
f2721_0_main_Load(EOS, i134, i926, i134) → f2725_0_main_NE(EOS, i134, i926, i134, i926)
f2725_0_main_NE(EOS, i134, i926, i134, i926) → f2741_0_main_NE(EOS, i134, i926, i134, i926)
f2725_0_main_NE(EOS, i926, i926, i926, i926) → f2742_0_main_NE(EOS, i926, i926, i926, i926)
f2741_0_main_NE(EOS, i134, i926, i134, i926) → f3277_0_main_Inc(EOS, i134, i926) | !(=(i134, i926))
f3277_0_main_Inc(EOS, i134, i926) → f3282_0_main_JMP(EOS, i134, +(i926, -1))
f3282_0_main_JMP(EOS, i134, i1158) → f3292_0_main_Load(EOS, i134, i1158)
f3292_0_main_Load(EOS, i134, i1158) → f2683_0_main_Load(EOS, i134, i1158)
f2683_0_main_Load(EOS, i134, i926) → f2689_0_main_Load(EOS, i134, i926, i134)
f2742_0_main_NE(EOS, i926, i926, i926, i926) → f3280_0_main_Inc(EOS, i926, i926)
f3280_0_main_Inc(EOS, i926, i926) → f3284_0_main_JMP(EOS, +(i926, -1), i926)
f3284_0_main_JMP(EOS, i1159, i926) → f3300_0_main_Load(EOS, i1159, i926)
f3300_0_main_Load(EOS, i1159, i926) → f2683_0_main_Load(EOS, i1159, i926)
f2715_0_main_LE(EOS, i134, i926, i134, i926) → f2719_0_main_Inc(EOS, i134, i926) | >(i134, i926)
f2719_0_main_Inc(EOS, i134, i926) → f2723_0_main_JMP(EOS, +(i134, -1), i926)
f2723_0_main_JMP(EOS, i941, i926) → f2738_0_main_Load(EOS, i941, i926)
f2738_0_main_Load(EOS, i941, i926) → f2683_0_main_Load(EOS, i941, i926)

Combined rules. Obtained 3 IRules

P rules:
f2689_0_main_Load(EOS, x0, x1, x0) → f2689_0_main_Load(EOS, x0, -(x1, 1), x0) | &&(>(+(x0, x1), 0), >(x1, x0))
f2689_0_main_Load(EOS, x0, x0, x0) → f2689_0_main_Load(EOS, -(x0, 1), x0, -(x0, 1)) | >(+(x0, x0), 0)
f2689_0_main_Load(EOS, x0, x1, x0) → f2689_0_main_Load(EOS, -(x0, 1), x1, -(x0, 1)) | &&(>(+(x0, x1), 0), <(x1, x0))

Filtered ground terms:


f2689_0_main_Load(x1, x2, x3, x4) → f2689_0_main_Load(x2, x3, x4)
Cond_f2689_0_main_Load(x1, x2, x3, x4, x5) → Cond_f2689_0_main_Load(x1, x3, x4, x5)
Cond_f2689_0_main_Load1(x1, x2, x3, x4, x5) → Cond_f2689_0_main_Load1(x1, x3, x4, x5)
Cond_f2689_0_main_Load2(x1, x2, x3, x4, x5) → Cond_f2689_0_main_Load2(x1, x3, x4, x5)

Filtered duplicate terms:


f2689_0_main_Load(x1, x2, x3) → f2689_0_main_Load(x2, x3)
Cond_f2689_0_main_Load(x1, x2, x3, x4) → Cond_f2689_0_main_Load(x1, x3, x4)
Cond_f2689_0_main_Load1(x1, x2, x3, x4) → Cond_f2689_0_main_Load1(x1, x4)
Cond_f2689_0_main_Load2(x1, x2, x3, x4) → Cond_f2689_0_main_Load2(x1, x3, x4)

Prepared 3 rules for path length conversion:

P rules:
f2689_0_main_Load(x1, x0) → f2689_0_main_Load(-(x1, 1), x0) | &&(>(+(x0, x1), 0), >(x1, x0))
f2689_0_main_Load(x0, x0) → f2689_0_main_Load(x0, -(x0, 1)) | >(+(x0, x0), 0)
f2689_0_main_Load(x1, x0) → f2689_0_main_Load(x1, -(x0, 1)) | &&(>(+(x0, x1), 0), <(x1, x0))

Finished conversion. Obtained 3 rules.

P rules:
f2689_0_main_Load(x0, x1) → f2689_0_main_Load(-(x0, 1), x1) | &&(>(+(x1, x0), 0), <(x1, x0))
f2689_0_main_Load(x2, x21) → f2689_0_main_Load(x2, -(x2, 1)) | &&(>(+(x2, x2), 0), =(x2, x21))
f2689_0_main_Load(x3, x4) → f2689_0_main_Load(x3, -(x4, 1)) | &&(>(+(x4, x3), 0), >(x4, x3))

(6) Obligation:

Rules:
f2689_0_main_Load(x0, x1) → f2689_0_main_Load(-(x0, 1), x1) | &&(>(+(x1, x0), 0), <(x1, x0))
f2689_0_main_Load(x2, x21) → f2689_0_main_Load(x2, -(x2, 1)) | &&(>(+(x2, x2), 0), =(x2, x21))
f2689_0_main_Load(x3, x4) → f2689_0_main_Load(x3, -(x4, 1)) | &&(>(+(x4, x3), 0), >(x4, x3))

(7) TerminationGraphProcessor (SOUND transformation)

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


(8) Complex Obligation (AND)

(9) Obligation:

Rules:
f2689_0_main_Load(x4, x5) → f2689_0_main_Load(x4, -(x5, 1)) | &&(>(+(x5, x4), 0), >(x5, x4))

(10) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f2689_0_main_Load(x3, x5)] = -x3 + x5

Therefore the following rule(s) have been dropped:


f2689_0_main_Load(x0, x1) → f2689_0_main_Load(x0, -(x1, 1)) | &&(>(+(x1, x0), 0), >(x1, x0))

(11) YES

(12) Obligation:

Rules:
f2689_0_main_Load(x0, x1) → f2689_0_main_Load(-(x0, 1), x1) | &&(>(+(x1, x0), 0), <(x1, x0))
f2689_0_main_Load(x2, x3) → f2689_0_main_Load(x2, -(x2, 1)) | &&(>(+(x2, x2), 0), =(x2, x3))

(13) PolynomialOrderProcessor (SOUND transformation)

Found the following polynomial interpretation:


[f2689_0_main_Load(x5, x7)] = x7

Therefore the following rule(s) have been dropped:


f2689_0_main_Load(x2, x3) → f2689_0_main_Load(x2, -(x2, 1)) | &&(>(+(x2, x2), 0), =(x2, x3))

(14) Obligation:

Rules:
f2689_0_main_Load(x0, x1) → f2689_0_main_Load(-(x0, 1), x1) | &&(>(+(x1, x0), 0), <(x1, x0))

(15) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


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

Therefore the following rule(s) have been dropped:


f2689_0_main_Load(x0, x1) → f2689_0_main_Load(-(x0, 1), x1) | &&(>(+(x1, x0), 0), <(x1, x0))

(16) YES