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

while (x > 0 && y > 0) {
if (Random.random() < 42) {
x--;
y = Random.random();
} 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:
PastaC9.main([Ljava/lang/String;)V: Graph of 322 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: PastaC9.main([Ljava/lang/String;)V
SCC calls the following helper methods:
Performed SCC analyses:
  • Used field analysis yielded the following read fields:
    • java.lang.String: [count]
  • Marker field analysis yielded the following relations that could be markers:

(5) SCCToIntTRSProof (SOUND transformation)

Transformed FIGraph SCCs to intTRSs. Log:

Generated rules. Obtained 54 IRules

P rules:
f1335_0_main_LE(EOS, i401, i391, i401) → f1338_0_main_LE(EOS, i401, i391, i401)
f1338_0_main_LE(EOS, i401, i391, i401) → f1341_0_main_Load(EOS, i401, i391) | >(i401, 0)
f1341_0_main_Load(EOS, i401, i391) → f1344_0_main_LE(EOS, i401, i391, i391)
f1344_0_main_LE(EOS, i401, i403, i403) → f1348_0_main_LE(EOS, i401, i403, i403)
f1348_0_main_LE(EOS, i401, i403, i403) → f1353_0_main_InvokeMethod(EOS, i401, i403) | >(i403, 0)
f1353_0_main_InvokeMethod(EOS, i401, i403) → f1355_0_random_FieldAccess(EOS, i401, i403)
f1355_0_random_FieldAccess(EOS, i401, i403) → f1357_0_random_FieldAccess(EOS, i401, i403)
f1357_0_random_FieldAccess(EOS, i401, i403) → f1363_0_random_ArrayAccess(EOS, i401, i403)
f1363_0_random_ArrayAccess(EOS, i401, i403) → f1365_0_random_ArrayAccess(EOS, i401, i403)
f1365_0_random_ArrayAccess(EOS, i401, i403) → f1370_0_random_Store(EOS, i401, i403, o588)
f1370_0_random_Store(EOS, i401, i403, o588) → f1376_0_random_FieldAccess(EOS, i401, i403, o588)
f1376_0_random_FieldAccess(EOS, i401, i403, o588) → f1379_0_random_ConstantStackPush(EOS, i401, i403, o588)
f1379_0_random_ConstantStackPush(EOS, i401, i403, o588) → f1386_0_random_IntArithmetic(EOS, i401, i403, o588)
f1386_0_random_IntArithmetic(EOS, i401, i403, o588) → f1392_0_random_FieldAccess(EOS, i401, i403, o588)
f1392_0_random_FieldAccess(EOS, i401, i403, o588) → f1394_0_random_Load(EOS, i401, i403, o588)
f1394_0_random_Load(EOS, i401, i403, o588) → f1405_0_random_InvokeMethod(EOS, i401, i403, o588)
f1405_0_random_InvokeMethod(EOS, i401, i403, java.lang.Object(o617sub)) → f1410_0_random_InvokeMethod(EOS, i401, i403, java.lang.Object(o617sub))
f1410_0_random_InvokeMethod(EOS, i401, i403, java.lang.Object(o617sub)) → f1413_0_length_Load(EOS, i401, i403, java.lang.Object(o617sub), java.lang.Object(o617sub))
f1413_0_length_Load(EOS, i401, i403, java.lang.Object(o617sub), java.lang.Object(o617sub)) → f1430_0_length_FieldAccess(EOS, i401, i403, java.lang.Object(o617sub), java.lang.Object(o617sub))
f1430_0_length_FieldAccess(EOS, i401, i403, java.lang.Object(java.lang.String(o629sub, i437)), java.lang.Object(java.lang.String(o629sub, i437))) → f1433_0_length_FieldAccess(EOS, i401, i403, java.lang.Object(java.lang.String(o629sub, i437)), java.lang.Object(java.lang.String(o629sub, i437))) | >=(i437, 0)
f1433_0_length_FieldAccess(EOS, i401, i403, java.lang.Object(java.lang.String(o629sub, i437)), java.lang.Object(java.lang.String(o629sub, i437))) → f1443_0_length_Return(EOS, i401, i403, java.lang.Object(java.lang.String(o629sub, i437)), i437)
f1443_0_length_Return(EOS, i401, i403, java.lang.Object(java.lang.String(o629sub, i437)), i437) → f1450_0_random_Return(EOS, i401, i403, i437)
f1450_0_random_Return(EOS, i401, i403, i437) → f1452_0_main_ConstantStackPush(EOS, i401, i403, i437)
f1452_0_main_ConstantStackPush(EOS, i401, i403, i437) → f1462_0_main_GE(EOS, i401, i403, i437, 42)
f1462_0_main_GE(EOS, i401, i403, i453, matching1) → f1470_0_main_GE(EOS, i401, i403, i453, 42) | =(matching1, 42)
f1462_0_main_GE(EOS, i401, i403, i454, matching1) → f1471_0_main_GE(EOS, i401, i403, i454, 42) | =(matching1, 42)
f1470_0_main_GE(EOS, i401, i403, i453, matching1) → f1475_0_main_Inc(EOS, i401) | &&(<(i453, 42), =(matching1, 42))
f1475_0_main_Inc(EOS, i401) → f1490_0_main_InvokeMethod(EOS, +(i401, -1)) | >(i401, 0)
f1490_0_main_InvokeMethod(EOS, i462) → f1505_0_random_FieldAccess(EOS, i462)
f1505_0_random_FieldAccess(EOS, i462) → f2191_0_random_FieldAccess(EOS, i462)
f2191_0_random_FieldAccess(EOS, i462) → f2208_0_random_ArrayAccess(EOS, i462)
f2208_0_random_ArrayAccess(EOS, i462) → f2219_0_random_ArrayAccess(EOS, i462)
f2219_0_random_ArrayAccess(EOS, i462) → f2232_0_random_Store(EOS, i462, o885)
f2232_0_random_Store(EOS, i462, o885) → f2242_0_random_FieldAccess(EOS, i462, o885)
f2242_0_random_FieldAccess(EOS, i462, o885) → f2250_0_random_ConstantStackPush(EOS, i462, o885)
f2250_0_random_ConstantStackPush(EOS, i462, o885) → f2267_0_random_IntArithmetic(EOS, i462, o885)
f2267_0_random_IntArithmetic(EOS, i462, o885) → f2280_0_random_FieldAccess(EOS, i462, o885)
f2280_0_random_FieldAccess(EOS, i462, o885) → f2289_0_random_Load(EOS, i462, o885)
f2289_0_random_Load(EOS, i462, o885) → f2309_0_random_InvokeMethod(EOS, i462, o885)
f2309_0_random_InvokeMethod(EOS, i462, java.lang.Object(o967sub)) → f2315_0_random_InvokeMethod(EOS, i462, java.lang.Object(o967sub))
f2315_0_random_InvokeMethod(EOS, i462, java.lang.Object(o967sub)) → f2322_0_length_Load(EOS, i462, java.lang.Object(o967sub), java.lang.Object(o967sub))
f2322_0_length_Load(EOS, i462, java.lang.Object(o967sub), java.lang.Object(o967sub)) → f2342_0_length_FieldAccess(EOS, i462, java.lang.Object(o967sub), java.lang.Object(o967sub))
f2342_0_length_FieldAccess(EOS, i462, java.lang.Object(java.lang.String(o989sub, i738)), java.lang.Object(java.lang.String(o989sub, i738))) → f2344_0_length_FieldAccess(EOS, i462, java.lang.Object(java.lang.String(o989sub, i738)), java.lang.Object(java.lang.String(o989sub, i738))) | >=(i738, 0)
f2344_0_length_FieldAccess(EOS, i462, java.lang.Object(java.lang.String(o989sub, i738)), java.lang.Object(java.lang.String(o989sub, i738))) → f2359_0_length_Return(EOS, i462, java.lang.Object(java.lang.String(o989sub, i738)), i738)
f2359_0_length_Return(EOS, i462, java.lang.Object(java.lang.String(o989sub, i738)), i738) → f2366_0_random_Return(EOS, i462, i738)
f2366_0_random_Return(EOS, i462, i738) → f2369_0_main_Store(EOS, i462, i738)
f2369_0_main_Store(EOS, i462, i738) → f2380_0_main_JMP(EOS, i462, i738)
f2380_0_main_JMP(EOS, i462, i738) → f2393_0_main_Load(EOS, i462, i738)
f2393_0_main_Load(EOS, i462, i738) → f1329_0_main_Load(EOS, i462, i738)
f1329_0_main_Load(EOS, i390, i391) → f1335_0_main_LE(EOS, i390, i391, i390)
f1471_0_main_GE(EOS, i401, i403, i454, matching1) → f1477_0_main_Inc(EOS, i401, i403) | &&(>=(i454, 42), =(matching1, 42))
f1477_0_main_Inc(EOS, i401, i403) → f1492_0_main_JMP(EOS, i401, +(i403, -1)) | >(i403, 0)
f1492_0_main_JMP(EOS, i401, i463) → f1521_0_main_Load(EOS, i401, i463)
f1521_0_main_Load(EOS, i401, i463) → f1329_0_main_Load(EOS, i401, i463)

Combined rules. Obtained 2 IRules

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

Filtered ground terms:


f1335_0_main_LE(x1, x2, x3, x4) → f1335_0_main_LE(x2, x3, x4)
Cond_f1335_0_main_LE(x1, x2, x3, x4, x5, x6) → Cond_f1335_0_main_LE(x1, x3, x4, x5, x6)
Cond_f1335_0_main_LE1(x1, x2, x3, x4, x5) → Cond_f1335_0_main_LE1(x1, x3, x4, x5)

Filtered duplicate terms:


f1335_0_main_LE(x1, x2, x3) → f1335_0_main_LE(x2, x3)
Cond_f1335_0_main_LE(x1, x2, x3, x4, x5) → Cond_f1335_0_main_LE(x1, x3, x4, x5)
Cond_f1335_0_main_LE1(x1, x2, x3, x4) → Cond_f1335_0_main_LE1(x1, x3, x4)

Filtered unneeded terms:


Cond_f1335_0_main_LE(x1, x2, x3, x4) → Cond_f1335_0_main_LE(x1, x3, x4)

Prepared 2 rules for path length conversion:

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

Finished conversion. Obtained 2 rules.

P rules:
f1335_0_main_LE(x0, x1) → f1335_0_main_LE(x2, -(x1, 1)) | &&(&&(>(x2, -1), >(x0, 0)), >(x1, 0))
f1335_0_main_LE(x3, x4) → f1335_0_main_LE(-(x3, 1), x4) | &&(>(x3, 0), >(x4, 0))

(6) Obligation:

Rules:
f1335_0_main_LE(x0, x1) → f1335_0_main_LE(x2, -(x1, 1)) | &&(&&(>(x2, -1), >(x0, 0)), >(x1, 0))
f1335_0_main_LE(x3, x4) → f1335_0_main_LE(-(x3, 1), x4) | &&(>(x3, 0), >(x4, 0))

(7) PolynomialOrderProcessor (SOUND transformation)

Found the following polynomial interpretation:


[f1335_0_main_LE(x6, x8)] = x8

Therefore the following rule(s) have been dropped:


f1335_0_main_LE(x0, x1) → f1335_0_main_LE(x2, -(x1, 1)) | &&(&&(>(x2, -1), >(x0, 0)), >(x1, 0))

(8) Obligation:

Rules:
f1335_0_main_LE(x3, x4) → f1335_0_main_LE(-(x3, 1), x4) | &&(>(x3, 0), >(x4, 0))

(9) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f1335_0_main_LE(x3, x5)] = x3

Therefore the following rule(s) have been dropped:


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

(10) YES