0 JBC
↳1 JBCToGraph (⇒, 255 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 8 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇔, 6 ms)
↳8 YES
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();
}
}
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))
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped: