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