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

while (x > 0 && y > 0) {
if (x > y) {
while (x > 0) {
x--;
}
} else {
while (y > 0) {
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:
PastaB18.main([Ljava/lang/String;)V: Graph of 198 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: PastaB18.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 32 IRules

P rules:
f370_0_main_LE(EOS, i60, i50, i60) → f379_0_main_LE(EOS, i60, i50, i60)
f379_0_main_LE(EOS, i60, i50, i60) → f399_0_main_Load(EOS, i60, i50) | >(i60, 0)
f399_0_main_Load(EOS, i60, i50) → f412_0_main_LE(EOS, i60, i50, i50)
f412_0_main_LE(EOS, i60, i68, i68) → f421_0_main_LE(EOS, i60, i68, i68)
f421_0_main_LE(EOS, i60, i68, i68) → f446_0_main_Load(EOS, i60, i68) | >(i68, 0)
f446_0_main_Load(EOS, i60, i68) → f461_0_main_Load(EOS, i60, i68, i60)
f461_0_main_Load(EOS, i60, i68, i60) → f474_0_main_LE(EOS, i60, i68, i60, i68)
f474_0_main_LE(EOS, i60, i68, i60, i68) → f486_0_main_LE(EOS, i60, i68, i60, i68)
f474_0_main_LE(EOS, i60, i68, i60, i68) → f487_0_main_LE(EOS, i60, i68, i60, i68)
f486_0_main_LE(EOS, i60, i68, i60, i68) → f503_0_main_Load(EOS, i60, i68) | <=(i60, i68)
f503_0_main_Load(EOS, i60, i68) → f571_0_main_Load(EOS, i60, i68)
f571_0_main_Load(EOS, i60, i88) → f602_0_main_LE(EOS, i60, i88, i88)
f602_0_main_LE(EOS, i60, matching1, matching2) → f613_0_main_LE(EOS, i60, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
f602_0_main_LE(EOS, i60, i104, i104) → f614_0_main_LE(EOS, i60, i104, i104)
f613_0_main_LE(EOS, i60, matching1, matching2) → f652_0_main_Load(EOS, i60, 0) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f652_0_main_Load(EOS, i60, matching1) → f361_0_main_Load(EOS, i60, 0) | =(matching1, 0)
f361_0_main_Load(EOS, i18, i50) → f370_0_main_LE(EOS, i18, i50, i18)
f614_0_main_LE(EOS, i60, i104, i104) → f654_0_main_Inc(EOS, i60, i104) | >(i104, 0)
f654_0_main_Inc(EOS, i60, i104) → f1134_0_main_JMP(EOS, i60, +(i104, -1)) | >(i104, 0)
f1134_0_main_JMP(EOS, i60, i219) → f1376_0_main_Load(EOS, i60, i219)
f1376_0_main_Load(EOS, i60, i219) → f571_0_main_Load(EOS, i60, i219)
f487_0_main_LE(EOS, i60, i68, i60, i68) → f505_0_main_Load(EOS, i60, i68) | >(i60, i68)
f505_0_main_Load(EOS, i60, i68) → f593_0_main_Load(EOS, i60, i68)
f593_0_main_Load(EOS, i94, i68) → f607_0_main_LE(EOS, i94, i68, i94)
f607_0_main_LE(EOS, matching1, i68, matching2) → f617_0_main_LE(EOS, 0, i68, 0) | &&(=(matching1, 0), =(matching2, 0))
f607_0_main_LE(EOS, i105, i68, i105) → f618_0_main_LE(EOS, i105, i68, i105)
f617_0_main_LE(EOS, matching1, i68, matching2) → f665_0_main_Load(EOS, 0, i68) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
f665_0_main_Load(EOS, matching1, i68) → f361_0_main_Load(EOS, 0, i68) | =(matching1, 0)
f618_0_main_LE(EOS, i105, i68, i105) → f668_0_main_Inc(EOS, i105, i68) | >(i105, 0)
f668_0_main_Inc(EOS, i105, i68) → f1373_0_main_JMP(EOS, +(i105, -1), i68) | >(i105, 0)
f1373_0_main_JMP(EOS, i277, i68) → f1379_0_main_Load(EOS, i277, i68)
f1379_0_main_Load(EOS, i277, i68) → f593_0_main_Load(EOS, i277, i68)

Combined rules. Obtained 6 IRules

P rules:
f370_0_main_LE(EOS, x0, x1, x0) → f602_0_main_LE(EOS, x0, x1, x1) | &&(&&(>=(x1, x0), >(x0, 0)), >(x1, 0))
f602_0_main_LE(EOS, x0, 0, 0) → f370_0_main_LE(EOS, x0, 0, x0)
f602_0_main_LE(EOS, x0, x1, x1) → f602_0_main_LE(EOS, x0, -(x1, 1), -(x1, 1)) | >(x1, 0)
f370_0_main_LE(EOS, x0, x1, x0) → f607_0_main_LE(EOS, x0, x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <(x1, x0))
f607_0_main_LE(EOS, 0, x1, 0) → f370_0_main_LE(EOS, 0, x1, 0)
f607_0_main_LE(EOS, x0, x1, x0) → f607_0_main_LE(EOS, -(x0, 1), x1, -(x0, 1)) | >(x0, 0)

Filtered ground terms:


f370_0_main_LE(x1, x2, x3, x4) → f370_0_main_LE(x2, x3, x4)
Cond_f370_0_main_LE(x1, x2, x3, x4, x5) → Cond_f370_0_main_LE(x1, x3, x4, x5)
f602_0_main_LE(x1, x2, x3, x4) → f602_0_main_LE(x2, x3, x4)
Cond_f602_0_main_LE(x1, x2, x3, x4, x5) → Cond_f602_0_main_LE(x1, x3, x4, x5)
Cond_f370_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f370_0_main_LE1(x1, x3, x4, x5)
f607_0_main_LE(x1, x2, x3, x4) → f607_0_main_LE(x2, x3, x4)
Cond_f607_0_main_LE(x1, x2, x3, x4, x5) → Cond_f607_0_main_LE(x1, x3, x4, x5)

Filtered duplicate terms:


f370_0_main_LE(x1, x2, x3) → f370_0_main_LE(x2, x3)
Cond_f370_0_main_LE(x1, x2, x3, x4) → Cond_f370_0_main_LE(x1, x3, x4)
f602_0_main_LE(x1, x2, x3) → f602_0_main_LE(x1, x3)
Cond_f602_0_main_LE(x1, x2, x3, x4) → Cond_f602_0_main_LE(x1, x2, x4)
Cond_f370_0_main_LE1(x1, x2, x3, x4) → Cond_f370_0_main_LE1(x1, x3, x4)
f607_0_main_LE(x1, x2, x3) → f607_0_main_LE(x2, x3)
Cond_f607_0_main_LE(x1, x2, x3, x4) → Cond_f607_0_main_LE(x1, x3, x4)

Prepared 6 rules for path length conversion:

P rules:
f370_0_main_LE(x1, x0) → f602_0_main_LE(x0, x1) | &&(&&(>=(x1, x0), >(x0, 0)), >(x1, 0))
f602_0_main_LE(x0, 0) → f370_0_main_LE(0, x0)
f602_0_main_LE(x0, x1) → f602_0_main_LE(x0, -(x1, 1)) | >(x1, 0)
f370_0_main_LE(x1, x0) → f607_0_main_LE(x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <(x1, x0))
f607_0_main_LE(x1, 0) → f370_0_main_LE(x1, 0)
f607_0_main_LE(x1, x0) → f607_0_main_LE(x1, -(x0, 1)) | >(x0, 0)

Finished conversion. Obtained 6 rules.

P rules:
f370_0_main_LE(x0, x1) → f602_0_main_LE(x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <=(x1, x0))
f602_0_main_LE(x2, c0) → f370_0_main_LE(0, x2) | =(0, c0)
f602_0_main_LE(x3, x4) → f602_0_main_LE(x3, -(x4, 1)) | >(x4, 0)
f370_0_main_LE(x5, x6) → f607_0_main_LE(x5, x6) | &&(&&(>(x6, x5), >(x5, 0)), >(x6, 0))
f607_0_main_LE(x7, c0) → f370_0_main_LE(x7, 0) | =(0, c0)
f607_0_main_LE(x8, x9) → f607_0_main_LE(x8, -(x9, 1)) | >(x9, 0)

(6) Obligation:

Rules:
f370_0_main_LE(x0, x1) → f602_0_main_LE(x1, x0) | &&(&&(>(x1, 0), >(x0, 0)), <=(x1, x0))
f602_0_main_LE(x2, c0) → f370_0_main_LE(0, x2) | =(0, c0)
f602_0_main_LE(x3, x4) → f602_0_main_LE(x3, -(x4, 1)) | >(x4, 0)
f370_0_main_LE(x5, x6) → f607_0_main_LE(x5, x6) | &&(&&(>(x6, x5), >(x5, 0)), >(x6, 0))
f607_0_main_LE(x7, c0) → f370_0_main_LE(x7, 0) | =(0, c0)
f607_0_main_LE(x8, x9) → f607_0_main_LE(x8, -(x9, 1)) | >(x9, 0)

(7) TerminationGraphProcessor (SOUND transformation)

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


(8) Complex Obligation (AND)

(9) Obligation:

Rules:
f607_0_main_LE(x10, x11) → f607_0_main_LE(x10, -(x11, 1)) | >(x11, 0)

(10) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f607_0_main_LE(x3, x5)] = x5

Therefore the following rule(s) have been dropped:


f607_0_main_LE(x0, x1) → f607_0_main_LE(x0, -(x1, 1)) | >(x1, 0)

(11) YES

(12) Obligation:

Rules:
f602_0_main_LE(x4, x5) → f602_0_main_LE(x4, -(x5, 1)) | >(x5, 0)

(13) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f602_0_main_LE(x3, x5)] = x5

Therefore the following rule(s) have been dropped:


f602_0_main_LE(x0, x1) → f602_0_main_LE(x0, -(x1, 1)) | >(x1, 0)

(14) YES