0 JBC
↳1 JBCToGraph (⇒, 230 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 100 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 230 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:
409_0_log_Load(EOS(STATIC_409), i68, i69, i68) → 412_0_log_LT(EOS(STATIC_412), i68, i69, i68, i69)
412_0_log_LT(EOS(STATIC_412), i68, i69, i68, i69) → 415_0_log_LT(EOS(STATIC_415), i68, i69, i68, i69)
415_0_log_LT(EOS(STATIC_415), i68, i69, i68, i69) → 419_0_log_Load(EOS(STATIC_419), i68, i69) | >=(i68, i69)
419_0_log_Load(EOS(STATIC_419), i68, i69) → 422_0_log_ConstantStackPush(EOS(STATIC_422), i68, i69, i69)
422_0_log_ConstantStackPush(EOS(STATIC_422), i68, i69, i69) → 427_0_log_LE(EOS(STATIC_427), i68, i69, i69, 1)
427_0_log_LE(EOS(STATIC_427), i68, i80, i80, matching1) → 447_0_log_LE(EOS(STATIC_447), i68, i80, i80, 1) | =(matching1, 1)
447_0_log_LE(EOS(STATIC_447), i68, i80, i80, matching1) → 460_0_log_ConstantStackPush(EOS(STATIC_460), i68, i80) | &&(>(i80, 1), =(matching1, 1))
460_0_log_ConstantStackPush(EOS(STATIC_460), i68, i80) → 467_0_log_Load(EOS(STATIC_467), i68, i80, 1)
467_0_log_Load(EOS(STATIC_467), i68, i80, matching1) → 474_0_log_Load(EOS(STATIC_474), i80, 1, i68) | =(matching1, 1)
474_0_log_Load(EOS(STATIC_474), i80, matching1, i68) → 493_0_log_IntArithmetic(EOS(STATIC_493), i80, 1, i68, i80) | =(matching1, 1)
493_0_log_IntArithmetic(EOS(STATIC_493), i80, matching1, i68, i80) → 505_0_log_Load(EOS(STATIC_505), i80, 1, /(i68, i80)) | &&(>(i80, 1), =(matching1, 1))
505_0_log_Load(EOS(STATIC_505), i80, matching1, i92) → 507_0_log_InvokeMethod(EOS(STATIC_507), 1, i92, i80) | =(matching1, 1)
507_0_log_InvokeMethod(EOS(STATIC_507), matching1, i92, i80) → 509_1_log_InvokeMethod(509_0_log_Load(EOS(STATIC_509), i92, i80), 1, i92, i80) | =(matching1, 1)
509_0_log_Load(EOS(STATIC_509), i92, i80) → 511_0_log_Load(EOS(STATIC_511), i92, i80)
511_0_log_Load(EOS(STATIC_511), i92, i80) → 407_0_log_Load(EOS(STATIC_407), i92, i80)
407_0_log_Load(EOS(STATIC_407), i68, i69) → 409_0_log_Load(EOS(STATIC_409), i68, i69, i68)
R rules:
412_0_log_LT(EOS(STATIC_412), i68, i69, i68, i69) → 414_0_log_LT(EOS(STATIC_414), i68, i69, i68, i69)
414_0_log_LT(EOS(STATIC_414), i68, i69, i68, i69) → 417_0_log_ConstantStackPush(EOS(STATIC_417)) | <(i68, i69)
417_0_log_ConstantStackPush(EOS(STATIC_417)) → 421_0_log_Return(EOS(STATIC_421))
427_0_log_LE(EOS(STATIC_427), i68, i79, i79, matching1) → 446_0_log_LE(EOS(STATIC_446), i68, i79, i79, 1) | =(matching1, 1)
446_0_log_LE(EOS(STATIC_446), i68, i79, i79, matching1) → 458_0_log_ConstantStackPush(EOS(STATIC_458)) | &&(<=(i79, 1), =(matching1, 1))
458_0_log_ConstantStackPush(EOS(STATIC_458)) → 465_0_log_Return(EOS(STATIC_465))
509_1_log_InvokeMethod(421_0_log_Return(EOS(STATIC_421)), matching1, i98, i99) → 523_0_log_Return(EOS(STATIC_523), 1, i98, i99) | =(matching1, 1)
509_1_log_InvokeMethod(528_0_log_Return(EOS(STATIC_528), matching1), matching2, i112, i113) → 549_0_log_Return(EOS(STATIC_549), 1, i112, i113, 1) | &&(=(matching1, 1), =(matching2, 1))
509_1_log_InvokeMethod(742_0_log_Return(EOS(STATIC_742), i299), matching1, i308, i309) → 760_0_log_Return(EOS(STATIC_760), 1, i308, i309, i299) | =(matching1, 1)
523_0_log_Return(EOS(STATIC_523), matching1, i98, i99) → 526_0_log_IntArithmetic(EOS(STATIC_526), 1) | =(matching1, 1)
526_0_log_IntArithmetic(EOS(STATIC_526), matching1) → 528_0_log_Return(EOS(STATIC_528), 1) | =(matching1, 1)
549_0_log_Return(EOS(STATIC_549), matching1, i112, i113, matching2) → 594_0_log_Return(EOS(STATIC_594), 1, i112, i113, 1) | &&(=(matching1, 1), =(matching2, 1))
594_0_log_Return(EOS(STATIC_594), matching1, i143, i139, i142) → 645_0_log_Return(EOS(STATIC_645), 1, i143, i139, i142) | =(matching1, 1)
645_0_log_Return(EOS(STATIC_645), matching1, i185, i181, i184) → 692_0_log_Return(EOS(STATIC_692), 1, i185, i181, i184) | =(matching1, 1)
692_0_log_Return(EOS(STATIC_692), matching1, i232, i228, i231) → 731_0_log_Return(EOS(STATIC_731), 1, i232, i228, i231) | =(matching1, 1)
731_0_log_Return(EOS(STATIC_731), matching1, i279, i275, i278) → 736_0_log_IntArithmetic(EOS(STATIC_736), 1, i278) | =(matching1, 1)
736_0_log_IntArithmetic(EOS(STATIC_736), matching1, i278) → 742_0_log_Return(EOS(STATIC_742), +(1, i278)) | &&(>(i278, 0), =(matching1, 1))
760_0_log_Return(EOS(STATIC_760), matching1, i308, i309, i299) → 731_0_log_Return(EOS(STATIC_731), 1, i308, i309, i299) | =(matching1, 1)
Combined rules. Obtained 1 conditional rules for P and 3 conditional rules for R.
P rules:
409_0_log_Load(EOS(STATIC_409), x0, x1, x0) → 509_1_log_InvokeMethod(409_0_log_Load(EOS(STATIC_409), /(x0, x1), x1, /(x0, x1)), 1, /(x0, x1), x1) | &&(>(x1, 1), <=(x1, x0))
R rules:
509_1_log_InvokeMethod(421_0_log_Return(EOS(STATIC_421)), 1, x1, x2) → 528_0_log_Return(EOS(STATIC_528), 1)
509_1_log_InvokeMethod(742_0_log_Return(EOS(STATIC_742), x0), 1, x2, x3) → 742_0_log_Return(EOS(STATIC_742), +(1, x0)) | >(x0, 0)
509_1_log_InvokeMethod(528_0_log_Return(EOS(STATIC_528), 1), 1, x2, x3) → 742_0_log_Return(EOS(STATIC_742), 2)
Filtered ground terms:
509_1_log_InvokeMethod(x1, x2, x3, x4) → 509_1_log_InvokeMethod(x1, x3, x4)
409_0_log_Load(x1, x2, x3, x4) → 409_0_log_Load(x2, x3, x4)
Cond_409_0_log_Load(x1, x2, x3, x4, x5) → Cond_409_0_log_Load(x1, x3, x4, x5)
742_0_log_Return(x1, x2) → 742_0_log_Return(x2)
528_0_log_Return(x1, x2) → 528_0_log_Return
Cond_509_1_log_InvokeMethod(x1, x2, x3, x4, x5) → Cond_509_1_log_InvokeMethod(x1, x2, x4, x5)
421_0_log_Return(x1) → 421_0_log_Return
Filtered duplicate args:
409_0_log_Load(x1, x2, x3) → 409_0_log_Load(x2, x3)
Cond_409_0_log_Load(x1, x2, x3, x4) → Cond_409_0_log_Load(x1, x3, x4)
Filtered unneeded arguments:
509_1_log_InvokeMethod(x1, x2, x3) → 509_1_log_InvokeMethod(x1)
Cond_509_1_log_InvokeMethod(x1, x2, x3, x4) → Cond_509_1_log_InvokeMethod(x1, x2)
Combined rules. Obtained 1 conditional rules for P and 3 conditional rules for R.
P rules:
409_0_log_Load(x1, x0) → 509_1_log_InvokeMethod(409_0_log_Load(x1, /(x0, x1))) | &&(>(x1, 1), <=(x1, x0))
R rules:
509_1_log_InvokeMethod(421_0_log_Return) → 528_0_log_Return
509_1_log_InvokeMethod(742_0_log_Return(x0)) → 742_0_log_Return(+(1, x0)) | >(x0, 0)
509_1_log_InvokeMethod(528_0_log_Return) → 742_0_log_Return(2)
Performed bisimulation on rules. Used the following equivalence classes: {[421_0_log_Return, 528_0_log_Return]=421_0_log_Return}
Finished conversion. Obtained 2 rules for P and 4 rules for R. System has predefined symbols.
P rules:
409_0_LOG_LOAD(x1, x0) → COND_409_0_LOG_LOAD(&&(>(x1, 1), <=(x1, x0)), x1, x0)
COND_409_0_LOG_LOAD(TRUE, x1, x0) → 409_0_LOG_LOAD(x1, /(x0, x1))
R rules:
509_1_log_InvokeMethod(421_0_log_Return) → 421_0_log_Return
509_1_log_InvokeMethod(742_0_log_Return(x0)) → Cond_509_1_log_InvokeMethod(>(x0, 0), 742_0_log_Return(x0))
Cond_509_1_log_InvokeMethod(TRUE, 742_0_log_Return(x0)) → 742_0_log_Return(+(1, x0))
509_1_log_InvokeMethod(421_0_log_Return) → 742_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] ⇒ 409_0_LOG_LOAD(x1[0], x0[0])≥NonInfC∧409_0_LOG_LOAD(x1[0], x0[0])≥COND_409_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])∧(UIncreasing(COND_409_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])), ≥))
(2) (>(x1[0], 1)=TRUE∧<=(x1[0], x0[0])=TRUE ⇒ 409_0_LOG_LOAD(x1[0], x0[0])≥NonInfC∧409_0_LOG_LOAD(x1[0], x0[0])≥COND_409_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])∧(UIncreasing(COND_409_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_409_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_409_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_409_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_409_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_409_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_409_0_LOG_LOAD(TRUE, x1[1], x0[1])≥NonInfC∧COND_409_0_LOG_LOAD(TRUE, x1[1], x0[1])≥409_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))∧(UIncreasing(409_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥))
(9) (>(x1[0], 1)=TRUE∧<=(x1[0], x0[0])=TRUE ⇒ COND_409_0_LOG_LOAD(TRUE, x1[0], x0[0])≥NonInfC∧COND_409_0_LOG_LOAD(TRUE, x1[0], x0[0])≥409_0_LOG_LOAD(x1[0], /(x0[0], x1[0]))∧(UIncreasing(409_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))), ≥))
(10) (x1[0] + [-2] ≥ 0∧x0[0] + [-1]x1[0] ≥ 0 ⇒ (UIncreasing(409_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(409_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(409_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(409_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(409_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(409_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) = 0
POL(FALSE) = 0
POL(509_1_log_InvokeMethod(x1)) = [-1] + [-1]x1
POL(421_0_log_Return) = [-1]
POL(742_0_log_Return(x1)) = [-1] + [-1]x1
POL(Cond_509_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(409_0_LOG_LOAD(x1, x2)) = [-1] + x2 + [-1]x1
POL(COND_409_0_LOG_LOAD(x1, x2, x3)) = [-1] + x3 + [-1]x2 + [-1]x1
POL(&&(x1, x2)) = 0
POL(<=(x1, x2)) = [-1]
Polynomial Interpretations with Context Sensitive Arithemetic Replacement
POL(TermCSAR-Mode @ Context)
POL(/(x1, x1[0])1 @ {409_0_LOG_LOAD_2/1}) = max{x1, [-1]x1} + [-1]min{max{x2, [-1]x2} + [-1], max{x1, [-1]x1}}
COND_409_0_LOG_LOAD(TRUE, x1[1], x0[1]) → 409_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))
409_0_LOG_LOAD(x1[0], x0[0]) → COND_409_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])
COND_409_0_LOG_LOAD(TRUE, x1[1], x0[1]) → 409_0_LOG_LOAD(x1[1], /(x0[1], x1[1]))
409_0_LOG_LOAD(x1[0], x0[0]) → COND_409_0_LOG_LOAD(&&(>(x1[0], 1), <=(x1[0], x0[0])), x1[0], x0[0])
&&(TRUE, TRUE)1 ↔ TRUE1
FALSE1 → &&(TRUE, FALSE)1
&&(FALSE, TRUE)1 ↔ FALSE1
&&(FALSE, FALSE)1 ↔ FALSE1
/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