(0) Obligation:

JBC Problem based on JBC Program:
/**
* Abstract class to provide some additional mathematical functions
* which are not provided by java.lang.Math.
*
* @author fuhs
*/
public abstract class AProVEMath {

/**
* Returns <code>base<sup>exponent</sup></code>.
* Works considerably faster than java.lang.Math.pow(double, double).
*
* @param base base of the power
* @param exponent non-negative exponent of the power
* @return base<sup>exponent</sup>
*/
public static int power (int base, int exponent) {
if (exponent == 0) {
return 1;
}
else if (exponent == 1) {
return base;
}
else if (base == 2) {
return base << (exponent-1);
}
else {
int result = 1;
while (exponent > 0) {
if (exponent % 2 == 1) {
result *= base;
}
base *= base;
exponent /= 2;
}
return result;
}
}

public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
power(x, 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:
AProVEMath.main([Ljava/lang/String;)V: Graph of 235 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: AProVEMath.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 26 IRules

P rules:
f905_0_power_LE(EOS, i183, i183) → f908_0_power_LE(EOS, i183, i183)
f908_0_power_LE(EOS, i183, i183) → f913_0_power_Load(EOS, i183) | >(i183, 0)
f913_0_power_Load(EOS, i183) → f917_0_power_ConstantStackPush(EOS, i183, i183)
f917_0_power_ConstantStackPush(EOS, i183, i183) → f923_0_power_IntArithmetic(EOS, i183, i183, 2)
f923_0_power_IntArithmetic(EOS, i183, i183, matching1) → f934_0_power_ConstantStackPush(EOS, i183, %(i183, 2)) | =(matching1, 2)
f934_0_power_ConstantStackPush(EOS, i183, i184) → f940_0_power_NE(EOS, i183, i184, 1)
f940_0_power_NE(EOS, i183, matching1, matching2) → f942_0_power_NE(EOS, i183, 0, 1) | &&(&&(=(i184, 0), =(matching1, 0)), =(matching2, 1))
f940_0_power_NE(EOS, i183, matching1, matching2) → f943_0_power_NE(EOS, i183, 1, 1) | &&(&&(=(i184, 1), =(matching1, 1)), =(matching2, 1))
f942_0_power_NE(EOS, i183, matching1, matching2) → f945_0_power_Load(EOS, i183) | &&(=(matching1, 0), =(matching2, 1))
f945_0_power_Load(EOS, i183) → f972_0_power_Load(EOS, i183)
f972_0_power_Load(EOS, i183) → f975_0_power_Load(EOS, i183)
f975_0_power_Load(EOS, i183) → f977_0_power_IntArithmetic(EOS, i183)
f977_0_power_IntArithmetic(EOS, i183) → f979_0_power_Store(EOS, i183)
f979_0_power_Store(EOS, i183) → f981_0_power_Load(EOS, i183)
f981_0_power_Load(EOS, i183) → f984_0_power_ConstantStackPush(EOS, i183)
f984_0_power_ConstantStackPush(EOS, i183) → f986_0_power_IntArithmetic(EOS, i183, 2)
f986_0_power_IntArithmetic(EOS, i183, matching1) → f988_0_power_Store(EOS, /(i183, 2)) | &&(>=(i183, 1), =(matching1, 2))
f988_0_power_Store(EOS, i205) → f990_0_power_JMP(EOS, i205)
f990_0_power_JMP(EOS, i205) → f1020_0_power_Load(EOS, i205)
f1020_0_power_Load(EOS, i205) → f900_0_power_Load(EOS, i205)
f900_0_power_Load(EOS, i176) → f905_0_power_LE(EOS, i176, i176)
f943_0_power_NE(EOS, i183, matching1, matching2) → f947_0_power_Load(EOS, i183) | &&(=(matching1, 1), =(matching2, 1))
f947_0_power_Load(EOS, i183) → f951_0_power_Load(EOS, i183)
f951_0_power_Load(EOS, i183) → f955_0_power_IntArithmetic(EOS, i183)
f955_0_power_IntArithmetic(EOS, i183) → f960_0_power_Store(EOS, i183)
f960_0_power_Store(EOS, i183) → f972_0_power_Load(EOS, i183)

Combined rules. Obtained 2 IRules

P rules:
f905_0_power_LE(EOS, x0, x0) → f905_0_power_LE(EOS, /(x0, 2), /(x0, 2)) | &&(=(%(x0, 2), 0), >(+(x0, 1), 1))
f905_0_power_LE(EOS, x0, x0) → f905_0_power_LE(EOS, /(x0, 2), /(x0, 2)) | &&(=(%(x0, 2), 1), >(+(x0, 1), 1))

Filtered ground terms:


f905_0_power_LE(x1, x2, x3) → f905_0_power_LE(x2, x3)
Cond_f905_0_power_LE(x1, x2, x3, x4) → Cond_f905_0_power_LE(x1, x3, x4)
Cond_f905_0_power_LE1(x1, x2, x3, x4) → Cond_f905_0_power_LE1(x1, x3, x4)

Filtered duplicate terms:


f905_0_power_LE(x1, x2) → f905_0_power_LE(x2)
Cond_f905_0_power_LE(x1, x2, x3) → Cond_f905_0_power_LE(x1, x3)
Cond_f905_0_power_LE1(x1, x2, x3) → Cond_f905_0_power_LE1(x1, x3)

Prepared 2 rules for path length conversion:

P rules:
f905_0_power_LE(x0) → f905_0_power_LE(/(x0, 2)) | &&(=(%(x0, 2), 0), >(+(x0, 1), 1))
f905_0_power_LE(x0) → f905_0_power_LE(/(x0, 2)) | &&(=(%(x0, 2), 1), >(+(x0, 1), 1))

Finished conversion. Obtained 4 rules.

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

(6) Obligation:

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

(7) PolynomialOrderProcessor (EQUIVALENT transformation)

Found the following polynomial interpretation:


[f905_0_power_LE(x11)] = -1 + 4·x11
[f905_0_power_LE'(x14)] = 2·x14

Therefore the following rule(s) have been dropped:


f905_0_power_LE(x0) → f905_0_power_LE'(x0) | &&(=(-(x0, *(2, x1)), 0), >(x0, 0))
f905_0_power_LE'(x2) → f905_0_power_LE(x3) | &&(&&(&&(&&(&&(>(x2, 0), >=(-(x2, *(2, x4)), 0)), =(-(x2, *(2, x4)), 0)), <(-(x2, *(2, x4)), 2)), <(-(x2, *(2, x3)), 2)), >=(-(x2, *(2, x3)), 0))
f905_0_power_LE(x5) → f905_0_power_LE'(x5) | &&(=(-(x5, *(2, x6)), 1), >(x5, 0))
f905_0_power_LE'(x7) → f905_0_power_LE(x8) | &&(&&(&&(&&(&&(>(x7, 0), >=(-(x7, *(2, x9)), 0)), =(-(x7, *(2, x9)), 1)), <(-(x7, *(2, x9)), 2)), <(-(x7, *(2, x8)), 2)), >=(-(x7, *(2, x8)), 0))

(8) YES