(0) Obligation:

JBC Problem based on JBC Program:
public class LogBuiltIn{
public static int log(int x) {

int res = 0;

while (x > 1) {

x = x/2;
res++;

}

return res;

}


public static void main(String[] args) {
Random.args = args;
int x = Random.random();
log(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:
LogBuiltIn.main([Ljava/lang/String;)V: Graph of 122 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: LogBuiltIn.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 11 IRules

P rules:
f445_0_log_ConstantStackPush(EOS, i81, i81) → f448_0_log_LE(EOS, i81, i81, 1)
f448_0_log_LE(EOS, i91, i91, matching1) → f452_0_log_LE(EOS, i91, i91, 1) | =(matching1, 1)
f452_0_log_LE(EOS, i91, i91, matching1) → f456_0_log_Load(EOS, i91) | &&(>(i91, 1), =(matching1, 1))
f456_0_log_Load(EOS, i91) → f461_0_log_ConstantStackPush(EOS, i91)
f461_0_log_ConstantStackPush(EOS, i91) → f465_0_log_IntArithmetic(EOS, i91, 2)
f465_0_log_IntArithmetic(EOS, i91, matching1) → f470_0_log_Store(EOS, /(i91, 2)) | &&(>(i91, 1), =(matching1, 2))
f470_0_log_Store(EOS, i93) → f474_0_log_Inc(EOS, i93)
f474_0_log_Inc(EOS, i93) → f477_0_log_JMP(EOS, i93)
f477_0_log_JMP(EOS, i93) → f503_0_log_Load(EOS, i93)
f503_0_log_Load(EOS, i93) → f441_0_log_Load(EOS, i93)
f441_0_log_Load(EOS, i81) → f445_0_log_ConstantStackPush(EOS, i81, i81)

Combined rules. Obtained 1 IRules

P rules:
f445_0_log_ConstantStackPush(EOS, x0, x0) → f445_0_log_ConstantStackPush(EOS, /(x0, 2), /(x0, 2)) | >(x0, 1)

Filtered ground terms:


f445_0_log_ConstantStackPush(x1, x2, x3) → f445_0_log_ConstantStackPush(x2, x3)
Cond_f445_0_log_ConstantStackPush(x1, x2, x3, x4) → Cond_f445_0_log_ConstantStackPush(x1, x3, x4)

Filtered duplicate terms:


f445_0_log_ConstantStackPush(x1, x2) → f445_0_log_ConstantStackPush(x2)
Cond_f445_0_log_ConstantStackPush(x1, x2, x3) → Cond_f445_0_log_ConstantStackPush(x1, x3)

Prepared 1 rules for path length conversion:

P rules:
f445_0_log_ConstantStackPush(x0) → f445_0_log_ConstantStackPush(/(x0, 2)) | >(x0, 1)

Finished conversion. Obtained 2 rules.

P rules:
f445_0_log_ConstantStackPush(x0) → f445_0_log_ConstantStackPush'(x0) | >(x0, 1)
f445_0_log_ConstantStackPush'(x0) → f445_0_log_ConstantStackPush(arith) | &&(&&(>(x0, 1), <(-(x0, *(2, arith)), 2)), >=(-(x0, *(2, arith)), 0))

(6) Obligation:

Rules:
f445_0_log_ConstantStackPush(x0) → f445_0_log_ConstantStackPush'(x0) | >(x0, 1)
f445_0_log_ConstantStackPush'(x0) → f445_0_log_ConstantStackPush(arith) | &&(&&(>(x0, 1), <(-(x0, *(2, arith)), 2)), >=(-(x0, *(2, arith)), 0))

(7) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f445_0_log_ConstantStackPush(x4)] = -1 + 2·x4
[f445_0_log_ConstantStackPush'(x7)] = x7

Therefore the following rule(s) have been dropped:


f445_0_log_ConstantStackPush(x0) → f445_0_log_ConstantStackPush'(x0) | >(x0, 1)
f445_0_log_ConstantStackPush'(x1) → f445_0_log_ConstantStackPush(x2) | &&(&&(>(x1, 1), <(-(x1, *(2, x2)), 2)), >=(-(x1, *(2, x2)), 0))

(8) YES