0 JBC
↳1 JBCToGraph (⇒, 140 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 140 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 220 ms)
↳8 IDP
↳9 IDependencyGraphProof (⇔, 0 ms)
↳10 TRUE
public class LogRecursive {
public static void main(String[] args) {
Random.args = args;
log(Random.random(), Random.random());
}
public static int log(int x, int y) {
if (x >= y && y > 1) {
return 1 + log(x/y, y);
}
return 0;
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
if (args.length <= index) {
return 0;
}
String string = args[index];
index++;
if (string == null) {
return 0;
}
return string.length();
}
}
Generated 16 rules for P and 18 rules for R.
P rules:
373_0_log_Load(EOS(STATIC_373), i66, i67, i66) → 375_0_log_LT(EOS(STATIC_375), i66, i67, i66, i67)
375_0_log_LT(EOS(STATIC_375), i66, i67, i66, i67) → 378_0_log_LT(EOS(STATIC_378), i66, i67, i66, i67)
378_0_log_LT(EOS(STATIC_378), i66, i67, i66, i67) → 382_0_log_Load(EOS(STATIC_382), i66, i67) | >=(i66, i67)
382_0_log_Load(EOS(STATIC_382), i66, i67) → 385_0_log_ConstantStackPush(EOS(STATIC_385), i66, i67, i67)
385_0_log_ConstantStackPush(EOS(STATIC_385), i66, i67, i67) → 389_0_log_LE(EOS(STATIC_389), i66, i67, i67, 1)
389_0_log_LE(EOS(STATIC_389), i66, i78, i78, matching1) → 396_0_log_LE(EOS(STATIC_396), i66, i78, i78, 1) | =(matching1, 1)
396_0_log_LE(EOS(STATIC_396), i66, i78, i78, matching1) → 407_0_log_ConstantStackPush(EOS(STATIC_407), i66, i78) | &&(>(i78, 1), =(matching1, 1))
407_0_log_ConstantStackPush(EOS(STATIC_407), i66, i78) → 412_0_log_Load(EOS(STATIC_412), i66, i78, 1)
412_0_log_Load(EOS(STATIC_412), i66, i78, matching1) → 417_0_log_Load(EOS(STATIC_417), i78, 1, i66) | =(matching1, 1)
417_0_log_Load(EOS(STATIC_417), i78, matching1, i66) → 437_0_log_IntArithmetic(EOS(STATIC_437), i78, 1, i66, i78) | =(matching1, 1)
437_0_log_IntArithmetic(EOS(STATIC_437), i78, matching1, i66, i78) → 449_0_log_Load(EOS(STATIC_449), i78, 1, /(i66, i78)) | &&(>(i78, 1), =(matching1, 1))
449_0_log_Load(EOS(STATIC_449), i78, matching1, i89) → 452_0_log_InvokeMethod(EOS(STATIC_452), 1, i89, i78) | =(matching1, 1)
452_0_log_InvokeMethod(EOS(STATIC_452), matching1, i89, i78) → 453_1_log_InvokeMethod(453_0_log_Load(EOS(STATIC_453), i89, i78), 1, i89, i78) | =(matching1, 1)
453_0_log_Load(EOS(STATIC_453), i89, i78) → 456_0_log_Load(EOS(STATIC_456), i89, i78)
456_0_log_Load(EOS(STATIC_456), i89, i78) → 372_0_log_Load(EOS(STATIC_372), i89, i78)
372_0_log_Load(EOS(STATIC_372), i66, i67) → 373_0_log_Load(EOS(STATIC_373), i66, i67, i66)
R rules:
375_0_log_LT(EOS(STATIC_375), i66, i67, i66, i67) → 377_0_log_LT(EOS(STATIC_377), i66, i67, i66, i67)
377_0_log_LT(EOS(STATIC_377), i66, i67, i66, i67) → 380_0_log_ConstantStackPush(EOS(STATIC_380)) | <(i66, i67)
380_0_log_ConstantStackPush(EOS(STATIC_380)) → 383_0_log_Return(EOS(STATIC_383))
389_0_log_LE(EOS(STATIC_389), i66, i77, i77, matching1) → 395_0_log_LE(EOS(STATIC_395), i66, i77, i77, 1) | =(matching1, 1)
395_0_log_LE(EOS(STATIC_395), i66, i77, i77, matching1) → 405_0_log_ConstantStackPush(EOS(STATIC_405)) | &&(<=(i77, 1), =(matching1, 1))
405_0_log_ConstantStackPush(EOS(STATIC_405)) → 410_0_log_Return(EOS(STATIC_410))
453_1_log_InvokeMethod(383_0_log_Return(EOS(STATIC_383)), matching1, i96, i97) → 467_0_log_Return(EOS(STATIC_467), 1, i96, i97) | =(matching1, 1)
453_1_log_InvokeMethod(472_0_log_Return(EOS(STATIC_472), matching1), matching2, i110, i111) → 494_0_log_Return(EOS(STATIC_494), 1, i110, i111, 1) | &&(=(matching1, 1), =(matching2, 1))
453_1_log_InvokeMethod(715_0_log_Return(EOS(STATIC_715), i298), matching1, i308, i309) → 736_0_log_Return(EOS(STATIC_736), 1, i308, i309, i298) | =(matching1, 1)
467_0_log_Return(EOS(STATIC_467), matching1, i96, i97) → 470_0_log_IntArithmetic(EOS(STATIC_470), 1) | =(matching1, 1)
470_0_log_IntArithmetic(EOS(STATIC_470), matching1) → 472_0_log_Return(EOS(STATIC_472), 1) | =(matching1, 1)
494_0_log_Return(EOS(STATIC_494), matching1, i110, i111, matching2) → 543_0_log_Return(EOS(STATIC_543), 1, i110, i111, 1) | &&(=(matching1, 1), =(matching2, 1))
543_0_log_Return(EOS(STATIC_543), matching1, i141, i137, i140) → 595_0_log_Return(EOS(STATIC_595), 1, i141, i137, i140) | =(matching1, 1)
595_0_log_Return(EOS(STATIC_595), matching1, i183, i179, i182) → 649_0_log_Return(EOS(STATIC_649), 1, i183, i179, i182) | =(matching1, 1)
649_0_log_Return(EOS(STATIC_649), matching1, i231, i227, i230) → 700_0_log_Return(EOS(STATIC_700), 1, i231, i227, i230) | =(matching1, 1)
700_0_log_Return(EOS(STATIC_700), matching1, i278, i274, i277) → 707_0_log_IntArithmetic(EOS(STATIC_707), 1, i277) | =(matching1, 1)
707_0_log_IntArithmetic(EOS(STATIC_707), matching1, i277) → 715_0_log_Return(EOS(STATIC_715), +(1, i277)) | &&(>(i277, 0), =(matching1, 1))
736_0_log_Return(EOS(STATIC_736), matching1, i308, i309, i298) → 700_0_log_Return(EOS(STATIC_700), 1, i308, i309, i298) | =(matching1, 1)
Combined rules. Obtained 1 conditional rules for P and 3 conditional rules for R.
P rules:
373_0_log_Load(EOS(STATIC_373), x0, x1, x0) → 453_1_log_InvokeMethod(373_0_log_Load(EOS(STATIC_373), /(x0, x1), x1, /(x0, x1)), 1, /(x0, x1), x1) | &&(>(x1, 1), <=(x1, x0))
R rules:
453_1_log_InvokeMethod(383_0_log_Return(EOS(STATIC_383)), 1, x1, x2) → 472_0_log_Return(EOS(STATIC_472), 1)
453_1_log_InvokeMethod(715_0_log_Return(EOS(STATIC_715), x0), 1, x2, x3) → 715_0_log_Return(EOS(STATIC_715), +(1, x0)) | >(x0, 0)
453_1_log_InvokeMethod(472_0_log_Return(EOS(STATIC_472), 1), 1, x2, x3) → 715_0_log_Return(EOS(STATIC_715), 2)
Filtered ground terms:
453_1_log_InvokeMethod(x1, x2, x3, x4) → 453_1_log_InvokeMethod(x1, x3, x4)
373_0_log_Load(x1, x2, x3, x4) → 373_0_log_Load(x2, x3, x4)
Cond_373_0_log_Load(x1, x2, x3, x4, x5) → Cond_373_0_log_Load(x1, x3, x4, x5)
715_0_log_Return(x1, x2) → 715_0_log_Return(x2)
472_0_log_Return(x1, x2) → 472_0_log_Return
Cond_453_1_log_InvokeMethod(x1, x2, x3, x4, x5) → Cond_453_1_log_InvokeMethod(x1, x2, x4, x5)
383_0_log_Return(x1) → 383_0_log_Return
Filtered duplicate args:
373_0_log_Load(x1, x2, x3) → 373_0_log_Load(x2, x3)
Cond_373_0_log_Load(x1, x2, x3, x4) → Cond_373_0_log_Load(x1, x3, x4)
Filtered unneeded arguments:
453_1_log_InvokeMethod(x1, x2, x3) → 453_1_log_InvokeMethod(x1)
Cond_453_1_log_InvokeMethod(x1, x2, x3, x4) → Cond_453_1_log_InvokeMethod(x1, x2)
Combined rules. Obtained 1 conditional rules for P and 3 conditional rules for R.
P rules:
373_0_log_Load(x1, x0) → 453_1_log_InvokeMethod(373_0_log_Load(x1, /(x0, x1))) | &&(>(x1, 1), <=(x1, x0))
R rules:
453_1_log_InvokeMethod(383_0_log_Return) → 472_0_log_Return
453_1_log_InvokeMethod(715_0_log_Return(x0)) → 715_0_log_Return(+(1, x0)) | >(x0, 0)
453_1_log_InvokeMethod(472_0_log_Return) → 715_0_log_Return(2)
Performed bisimulation on rules. Used the following equivalence classes: {[383_0_log_Return, 472_0_log_Return]=383_0_log_Return}
Finished conversion. Obtained 2 rules for P and 4 rules for R. System has predefined symbols.
P rules:
373_0_LOG_LOAD(x1, x0) → COND_373_0_LOG_LOAD(&&(>(x1, 1), <=(x1, x0)), x1, x0)
COND_373_0_LOG_LOAD(TRUE, x1, x0) → 373_0_LOG_LOAD(x1, /(x0, x1))
R rules:
453_1_log_InvokeMethod(383_0_log_Return) → 383_0_log_Return
453_1_log_InvokeMethod(715_0_log_Return(x0)) → Cond_453_1_log_InvokeMethod(>(x0, 0), 715_0_log_Return(x0))
Cond_453_1_log_InvokeMethod(TRUE, 715_0_log_Return(x0)) → 715_0_log_Return(+(1, x0))
453_1_log_InvokeMethod(383_0_log_Return) → 715_0_log_Return(2)
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
~ | Bwxor: (Integer, Integer) -> Integer | |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
Integer, Boolean
(0) -> (1), if (x1[0] > 1 && x1[0] <= x0[0] ∧x1[0] →* x1[1]∧x0[0] →* x0[1])
(1) -> (0), if (x1[1] →* x1[0]∧x0[1] / x1[1] →* x0[0])
(1) (&&(>(x1[0], 1), <=(x1[0], x0[0]))=TRUE∧x1[0]=x1[1]∧x0[0]=x0[1] ⇒ 373_0_LOG_LOAD(x1[0], x0[0])≥NonInfC∧373_0_LOG_LOAD(x1[0], x0[0])≥COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])∧(UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥))
(2) (>(x1[0], 1)=TRUE∧<=(x1[0], x0[0])=TRUE ⇒ 373_0_LOG_LOAD(x1[0], x0[0])≥NonInfC∧373_0_LOG_LOAD(x1[0], x0[0])≥COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])∧(UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥))
(3) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]x0[0] + [(-1)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
(4) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]x0[0] + [(-1)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
(5) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]x0[0] + [(-1)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
(6) (x1[0] ≥ 0∧x0[0] + [-2] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥)∧[(-3)bni_21 + (-1)Bound*bni_21] + [bni_21]x0[0] + [(-1)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
(7) (x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]x0[0] ≥ 0∧[(-1)bso_22] ≥ 0)
(8) (&&(>(x1[0], 1), <=(x1[0], x0[0]))=TRUE∧x1[0]=x1[1]∧x0[0]=x0[1]∧x1[1]=x1[0]1∧/(x0[1], x1[1])=x0[0]1 ⇒ COND_373_0_LOG_LOAD(TRUE, x1[1], x0[1])≥NonInfC∧COND_373_0_LOG_LOAD(TRUE, x1[1], x0[1])≥373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))∧(UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥))
(9) (>(x1[0], 1)=TRUE∧<=(x1[0], x0[0])=TRUE ⇒ COND_373_0_LOG_LOAD(TRUE, x1[0], x0[0])≥NonInfC∧COND_373_0_LOG_LOAD(TRUE, x1[0], x0[0])≥373_0_LOG_LOAD(x1[0], /(x0[0], x1[0]))∧(UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥))
(10) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]x0[0] + [(-1)bni_23]x1[0] ≥ 0∧[(-1)bso_27] + x0[0] + [-1]max{x0[0], [-1]x0[0]} + min{max{x1[0], [-1]x1[0]} + [-1], max{x0[0], [-1]x0[0]}} ≥ 0)
(11) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]x0[0] + [(-1)bni_23]x1[0] ≥ 0∧[(-1)bso_27] + x0[0] + [-1]max{x0[0], [-1]x0[0]} + min{max{x1[0], [-1]x1[0]} + [-1], max{x0[0], [-1]x0[0]}} ≥ 0)
(12) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0∧[2]x0[0] ≥ 0∧[2]x1[0] ≥ 0 ⇒ (UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]x0[0] + [(-1)bni_23]x1[0] ≥ 0∧[-1 + (-1)bso_27] + x1[0] ≥ 0)
(13) (x1[0] ≥ 0∧x0[0] + [-2] + [-1]x1[0] ≥ 0∧[2]x0[0] ≥ 0∧[4] + [2]x1[0] ≥ 0 ⇒ (UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥)∧[(-3)bni_23 + (-1)Bound*bni_23] + [bni_23]x0[0] + [(-1)bni_23]x1[0] ≥ 0∧[1 + (-1)bso_27] + x1[0] ≥ 0)
(14) (x1[0] ≥ 0∧x0[0] ≥ 0∧[4] + [2]x1[0] + [2]x0[0] ≥ 0∧[4] + [2]x1[0] ≥ 0 ⇒ (UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]x0[0] ≥ 0∧[1 + (-1)bso_27] + x1[0] ≥ 0)
(15) (x1[0] ≥ 0∧x0[0] ≥ 0∧[2] + x1[0] + x0[0] ≥ 0∧[2] + x1[0] ≥ 0 ⇒ (UIncreasing(373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]x0[0] ≥ 0∧[1 + (-1)bso_27] + x1[0] ≥ 0)
POL(TRUE) = [1]
POL(FALSE) = [2]
POL(453_1_log_InvokeMethod(x1)) = [-1] + [-1]x1
POL(383_0_log_Return) = [-1]
POL(715_0_log_Return(x1)) = [-1] + [-1]x1
POL(Cond_453_1_log_InvokeMethod(x1, x2)) = [-1] + [-1]x2 + [-1]x1
POL(>(x1, x2)) = [-1]
POL(0) = 0
POL(+(x1, x2)) = x1 + x2
POL(1) = [1]
POL(2) = [2]
POL(373_0_LOG_LOAD(x1, x2)) = [-1] + x2 + [-1]x1
POL(COND_373_0_LOG_LOAD(x1, x2, x3)) = x3 + [-1]x2 + [-1]x1
POL(&&(x1, x2)) = [1]
POL(<=(x1, x2)) = [-1]
Polynomial Interpretations with Context Sensitive Arithemetic Replacement
POL(TermCSAR-Mode @ Context)
POL(/(x1, x1[0])1 @ {373_0_LOG_LOAD_2/1}) = max{x1, [-1]x1} + [-1]min{max{x2, [-1]x2} + [-1], max{x1, [-1]x1}}
COND_373_0_LOG_LOAD(TRUE, x1[1], x0[1]) → 373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))
373_0_LOG_LOAD(x1[0], x0[0]) → COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])
COND_373_0_LOG_LOAD(TRUE, x1[1], x0[1]) → 373_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))
373_0_LOG_LOAD(x1[0], x0[0]) → COND_373_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])
TRUE1 → &&(TRUE, TRUE)1
FALSE1 → &&(TRUE, FALSE)1
FALSE1 → &&(FALSE, TRUE)1
FALSE1 → &&(FALSE, FALSE)1
/1 →
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
~ | Bwxor: (Integer, Integer) -> Integer | |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
Integer, Boolean