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

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


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:
PastaC2.main([Ljava/lang/String;)V: Graph of 128 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: PastaC2.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 28 IRules

P rules:
f784_0_main_LT(EOS, i61, i61) → f787_0_main_LT(EOS, i61, i61)
f787_0_main_LT(EOS, i61, i61) → f790_0_main_Load(EOS, i61) | >=(i61, 0)
f790_0_main_Load(EOS, i61) → f792_0_main_ConstantStackPush(EOS, i61)
f792_0_main_ConstantStackPush(EOS, i61) → f794_0_main_IntArithmetic(EOS, i61, 1)
f794_0_main_IntArithmetic(EOS, i61, matching1) → f796_0_main_Store(EOS, +(i61, 1)) | &&(>=(i61, 0), =(matching1, 1))
f796_0_main_Store(EOS, i62) → f798_0_main_ConstantStackPush(EOS, i62)
f798_0_main_ConstantStackPush(EOS, i62) → f799_0_main_Store(EOS, i62, 1)
f799_0_main_Store(EOS, i62, matching1) → f802_0_main_Load(EOS, i62, 1) | =(matching1, 1)
f802_0_main_Load(EOS, i62, matching1) → f817_0_main_Load(EOS, i62, 1) | =(matching1, 1)
f817_0_main_Load(EOS, i62, i64) → f839_0_main_Load(EOS, i62, i64)
f839_0_main_Load(EOS, i62, i67) → f862_0_main_Load(EOS, i62, i67)
f862_0_main_Load(EOS, i62, i70) → f885_0_main_Load(EOS, i62, i70)
f885_0_main_Load(EOS, i62, i73) → f886_0_main_Load(EOS, i62, i73, i62)
f886_0_main_Load(EOS, i62, i73, i62) → f889_0_main_LT(EOS, i62, i73, i62, i73)
f889_0_main_LT(EOS, i62, i73, i62, i73) → f890_0_main_LT(EOS, i62, i73, i62, i73)
f889_0_main_LT(EOS, i62, i73, i62, i73) → f891_0_main_LT(EOS, i62, i73, i62, i73)
f890_0_main_LT(EOS, i62, i73, i62, i73) → f893_0_main_Load(EOS, i62) | <(i62, i73)
f893_0_main_Load(EOS, i62) → f896_0_main_ConstantStackPush(EOS, i62)
f896_0_main_ConstantStackPush(EOS, i62) → f899_0_main_IntArithmetic(EOS, i62, 2)
f899_0_main_IntArithmetic(EOS, i62, matching1) → f905_0_main_Store(EOS, -(i62, 2)) | &&(>(i62, 0), =(matching1, 2))
f905_0_main_Store(EOS, i77) → f1115_0_main_JMP(EOS, i77)
f1115_0_main_JMP(EOS, i77) → f1120_0_main_Load(EOS, i77)
f1120_0_main_Load(EOS, i77) → f781_0_main_Load(EOS, i77)
f781_0_main_Load(EOS, i58) → f784_0_main_LT(EOS, i58, i58)
f891_0_main_LT(EOS, i62, i73, i62, i73) → f894_0_main_Inc(EOS, i62, i73) | >=(i62, i73)
f894_0_main_Inc(EOS, i62, i73) → f898_0_main_JMP(EOS, i62, +(i73, 1)) | >(i73, 0)
f898_0_main_JMP(EOS, i62, i75) → f904_0_main_Load(EOS, i62, i75)
f904_0_main_Load(EOS, i62, i75) → f885_0_main_Load(EOS, i62, i75)

Combined rules. Obtained 2 IRules

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

Filtered ground terms:


f889_0_main_LT(x1, x2, x3, x4, x5) → f889_0_main_LT(x2, x3, x4, x5)
Cond_f889_0_main_LT(x1, x2, x3, x4, x5, x6) → Cond_f889_0_main_LT(x1, x3, x4, x5, x6)
Cond_f889_0_main_LT1(x1, x2, x3, x4, x5, x6) → Cond_f889_0_main_LT1(x1, x3, x4, x5, x6)

Filtered duplicate terms:


f889_0_main_LT(x1, x2, x3, x4) → f889_0_main_LT(x3, x4)
Cond_f889_0_main_LT(x1, x2, x3, x4, x5) → Cond_f889_0_main_LT(x1, x4, x5)
Cond_f889_0_main_LT1(x1, x2, x3, x4, x5) → Cond_f889_0_main_LT1(x1, x4, x5)

Filtered unneeded terms:


Cond_f889_0_main_LT(x1, x2, x3) → Cond_f889_0_main_LT(x1, x2)

Prepared 2 rules for path length conversion:

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

Finished conversion. Obtained 2 rules.

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

(6) Obligation:

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

(7) PolynomialOrderProcessor (SOUND transformation)

Found the following polynomial interpretation:


[f889_0_main_LT(x5, x7)] = -2 + x5

Therefore the following rule(s) have been dropped:


f889_0_main_LT(x0, x1) → f889_0_main_LT(-(x0, 1), 1) | &&(>(x0, 1), >(x1, x0))

(8) Obligation:

Rules:
f889_0_main_LT(x2, x3) → f889_0_main_LT(x2, +(x3, 1)) | &&(<=(x3, x2), >(x3, 0))

(9) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


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

Therefore the following rule(s) have been dropped:


f889_0_main_LT(x0, x1) → f889_0_main_LT(x0, +(x1, 1)) | &&(<=(x1, x0), >(x1, 0))

(10) YES