(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 PastaA1 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
while (x > 0) {
int y = 0;
while (y < x) {
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:
PastaA1.main([Ljava/lang/String;)V: Graph of 120 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: PastaA1.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 21 IRules

P rules:
f146_0_main_LE(EOS, i22, i22) → f149_0_main_LE(EOS, i22, i22)
f149_0_main_LE(EOS, i22, i22) → f158_0_main_ConstantStackPush(EOS, i22) | >(i22, 0)
f158_0_main_ConstantStackPush(EOS, i22) → f166_0_main_Store(EOS, i22, 0)
f166_0_main_Store(EOS, i22, matching1) → f171_0_main_Load(EOS, i22, 0) | =(matching1, 0)
f171_0_main_Load(EOS, i22, matching1) → f251_0_main_Load(EOS, i22, 0) | =(matching1, 0)
f251_0_main_Load(EOS, i22, i24) → f365_0_main_Load(EOS, i22, i24)
f365_0_main_Load(EOS, i22, i34) → f602_0_main_Load(EOS, i22, i34)
f602_0_main_Load(EOS, i22, i44) → f782_0_main_Load(EOS, i22, i44)
f782_0_main_Load(EOS, i22, i52) → f877_0_main_Load(EOS, i22, i52, i52)
f877_0_main_Load(EOS, i22, i52, i52) → f879_0_main_GE(EOS, i22, i52, i52, i22)
f879_0_main_GE(EOS, i22, i52, i52, i22) → f881_0_main_GE(EOS, i22, i52, i52, i22)
f879_0_main_GE(EOS, i22, i52, i52, i22) → f882_0_main_GE(EOS, i22, i52, i52, i22)
f881_0_main_GE(EOS, i22, i52, i52, i22) → f884_0_main_Inc(EOS, i22) | >=(i52, i22)
f884_0_main_Inc(EOS, i22) → f888_0_main_JMP(EOS, +(i22, -1)) | >(i22, 0)
f888_0_main_JMP(EOS, i55) → f896_0_main_Load(EOS, i55)
f896_0_main_Load(EOS, i55) → f143_0_main_Load(EOS, i55)
f143_0_main_Load(EOS, i18) → f146_0_main_LE(EOS, i18, i18)
f882_0_main_GE(EOS, i22, i52, i52, i22) → f886_0_main_Inc(EOS, i22, i52) | <(i52, i22)
f886_0_main_Inc(EOS, i22, i52) → f890_0_main_JMP(EOS, i22, +(i52, 1)) | >=(i52, 0)
f890_0_main_JMP(EOS, i22, i56) → f903_0_main_Load(EOS, i22, i56)
f903_0_main_Load(EOS, i22, i56) → f782_0_main_Load(EOS, i22, i56)

Combined rules. Obtained 2 IRules

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

Filtered ground terms:


f879_0_main_GE(x1, x2, x3, x4, x5) → f879_0_main_GE(x2, x3, x4, x5)
Cond_f879_0_main_GE(x1, x2, x3, x4, x5, x6) → Cond_f879_0_main_GE(x1, x3, x4, x5, x6)
Cond_f879_0_main_GE1(x1, x2, x3, x4, x5, x6) → Cond_f879_0_main_GE1(x1, x3, x4, x5, x6)

Filtered duplicate terms:


f879_0_main_GE(x1, x2, x3, x4) → f879_0_main_GE(x3, x4)
Cond_f879_0_main_GE(x1, x2, x3, x4, x5) → Cond_f879_0_main_GE(x1, x4, x5)
Cond_f879_0_main_GE1(x1, x2, x3, x4, x5) → Cond_f879_0_main_GE1(x1, x4, x5)

Filtered unneeded terms:


Cond_f879_0_main_GE(x1, x2, x3) → Cond_f879_0_main_GE(x1, x3)

Prepared 2 rules for path length conversion:

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

Finished conversion. Obtained 2 rules.

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

(6) Obligation:

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

(7) PolynomialOrderProcessor (SOUND transformation)

Found the following polynomial interpretation:


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

Therefore the following rule(s) have been dropped:


f879_0_main_GE(x0, x1) → f879_0_main_GE(0, -(x1, 1)) | &&(<=(x1, x0), >(x1, 1))

(8) Obligation:

Rules:
f879_0_main_GE(x2, x3) → f879_0_main_GE(+(x2, 1), x3) | &&(>(x2, -1), >(x3, x2))

(9) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


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

Therefore the following rule(s) have been dropped:


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

(10) YES