0 JBC
↳1 JBCToGraph (⇒, 100 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 60 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 210 ms)
↳8 AND
↳9 IDP
↳10 IDependencyGraphProof (⇔, 0 ms)
↳11 TRUE
↳12 IDP
↳13 IDependencyGraphProof (⇔, 0 ms)
↳14 TRUE
package Nest;
public class Nest{
public static int nest(int x){
if (x == 0) return 0;
else return nest(nest(x-1));
}
public static void main(final String[] args) {
final int x = args[0].length();
final int y = nest(x);
}
}
Generated 18 rules for P and 5 rules for R.
P rules:
130_0_nest_NE(EOS(STATIC_130), i23, i23) → 135_0_nest_NE(EOS(STATIC_135), i23, i23)
135_0_nest_NE(EOS(STATIC_135), i23, i23) → 140_0_nest_Load(EOS(STATIC_140), i23) | >(i23, 0)
140_0_nest_Load(EOS(STATIC_140), i23) → 146_0_nest_ConstantStackPush(EOS(STATIC_146), i23)
146_0_nest_ConstantStackPush(EOS(STATIC_146), i23) → 152_0_nest_IntArithmetic(EOS(STATIC_152), i23, 1)
152_0_nest_IntArithmetic(EOS(STATIC_152), i23, matching1) → 162_0_nest_InvokeMethod(EOS(STATIC_162), -(i23, 1)) | &&(>(i23, 0), =(matching1, 1))
162_0_nest_InvokeMethod(EOS(STATIC_162), i24) → 179_1_nest_InvokeMethod(179_0_nest_Load(EOS(STATIC_179), i24), i24)
179_0_nest_Load(EOS(STATIC_179), i24) → 188_0_nest_Load(EOS(STATIC_188), i24)
179_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), matching1, matching2), matching3) → 219_0_nest_Return(EOS(STATIC_219), 0, 0, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
179_1_nest_InvokeMethod(291_0_nest_Return(EOS(STATIC_291), matching1), i43) → 309_0_nest_Return(EOS(STATIC_309), i43, 0) | =(matching1, 0)
188_0_nest_Load(EOS(STATIC_188), i24) → 124_0_nest_Load(EOS(STATIC_124), i24)
124_0_nest_Load(EOS(STATIC_124), i18) → 130_0_nest_NE(EOS(STATIC_130), i18, i18)
219_0_nest_Return(EOS(STATIC_219), matching1, matching2, matching3) → 226_0_nest_InvokeMethod(EOS(STATIC_226), 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
226_0_nest_InvokeMethod(EOS(STATIC_226), matching1) → 274_0_nest_InvokeMethod(EOS(STATIC_274), 0) | =(matching1, 0)
274_0_nest_InvokeMethod(EOS(STATIC_274), matching1) → 279_1_nest_InvokeMethod(279_0_nest_Load(EOS(STATIC_279), 0), 0) | =(matching1, 0)
279_0_nest_Load(EOS(STATIC_279), matching1) → 283_0_nest_Load(EOS(STATIC_283), 0) | =(matching1, 0)
283_0_nest_Load(EOS(STATIC_283), matching1) → 124_0_nest_Load(EOS(STATIC_124), 0) | =(matching1, 0)
309_0_nest_Return(EOS(STATIC_309), i43, matching1) → 264_0_nest_Return(EOS(STATIC_264), i43, 0) | =(matching1, 0)
264_0_nest_Return(EOS(STATIC_264), i35, matching1) → 274_0_nest_InvokeMethod(EOS(STATIC_274), 0) | =(matching1, 0)
R rules:
130_0_nest_NE(EOS(STATIC_130), matching1, matching2) → 136_0_nest_NE(EOS(STATIC_136), 0, 0) | &&(=(matching1, 0), =(matching2, 0))
136_0_nest_NE(EOS(STATIC_136), matching1, matching2) → 142_0_nest_ConstantStackPush(EOS(STATIC_142), 0) | &&(=(matching1, 0), =(matching2, 0))
142_0_nest_ConstantStackPush(EOS(STATIC_142), matching1) → 147_0_nest_Return(EOS(STATIC_147), 0, 0) | =(matching1, 0)
279_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), matching1, matching2), matching3) → 289_0_nest_Return(EOS(STATIC_289), 0, 0, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
289_0_nest_Return(EOS(STATIC_289), matching1, matching2, matching3) → 291_0_nest_Return(EOS(STATIC_291), 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
Combined rules. Obtained 3 conditional rules for P and 2 conditional rules for R.
P rules:
130_0_nest_NE(EOS(STATIC_130), x0, x0) → 179_1_nest_InvokeMethod(130_0_nest_NE(EOS(STATIC_130), -(x0, 1), -(x0, 1)), -(x0, 1)) | >(x0, 0)
179_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), 0, 0), 0) → 279_1_nest_InvokeMethod(130_0_nest_NE(EOS(STATIC_130), 0, 0), 0)
179_1_nest_InvokeMethod(291_0_nest_Return(EOS(STATIC_291), 0), x1) → 279_1_nest_InvokeMethod(130_0_nest_NE(EOS(STATIC_130), 0, 0), 0)
R rules:
130_0_nest_NE(EOS(STATIC_130), 0, 0) → 147_0_nest_Return(EOS(STATIC_147), 0, 0)
279_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), 0, 0), 0) → 291_0_nest_Return(EOS(STATIC_291), 0)
Filtered ground terms:
279_1_nest_InvokeMethod(x1, x2) → 279_1_nest_InvokeMethod(x1)
130_0_nest_NE(x1, x2, x3) → 130_0_nest_NE(x2, x3)
291_0_nest_Return(x1, x2) → 291_0_nest_Return
147_0_nest_Return(x1, x2, x3) → 147_0_nest_Return
Cond_130_0_nest_NE(x1, x2, x3, x4) → Cond_130_0_nest_NE(x1, x3, x4)
Filtered duplicate args:
130_0_nest_NE(x1, x2) → 130_0_nest_NE(x2)
Cond_130_0_nest_NE(x1, x2, x3) → Cond_130_0_nest_NE(x1, x3)
Combined rules. Obtained 3 conditional rules for P and 2 conditional rules for R.
P rules:
130_0_nest_NE(x0) → 179_1_nest_InvokeMethod(130_0_nest_NE(-(x0, 1)), -(x0, 1)) | >(x0, 0)
179_1_nest_InvokeMethod(147_0_nest_Return, 0) → 279_1_nest_InvokeMethod(130_0_nest_NE(0))
179_1_nest_InvokeMethod(291_0_nest_Return, x1) → 279_1_nest_InvokeMethod(130_0_nest_NE(0))
R rules:
130_0_nest_NE(0) → 147_0_nest_Return
279_1_nest_InvokeMethod(147_0_nest_Return) → 291_0_nest_Return
Performed bisimulation on rules. Used the following equivalence classes: {[147_0_nest_Return, 291_0_nest_Return]=147_0_nest_Return}
Finished conversion. Obtained 5 rules for P and 2 rules for R. System has predefined symbols.
P rules:
130_0_NEST_NE(x0) → COND_130_0_NEST_NE(>(x0, 0), x0)
COND_130_0_NEST_NE(TRUE, x0) → 179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0, 1)), -(x0, 1))
COND_130_0_NEST_NE(TRUE, x0) → 130_0_NEST_NE(-(x0, 1))
179_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0) → 130_0_NEST_NE(0)
179_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1) → 130_0_NEST_NE(0)
R rules:
130_0_nest_NE(0) → 147_0_nest_Return
279_1_nest_InvokeMethod(147_0_nest_Return) → 147_0_nest_Return
!= | ~ | 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
(0) -> (1), if (x0[0] > 0 ∧x0[0] →* x0[1])
(0) -> (2), if (x0[0] > 0 ∧x0[0] →* x0[2])
(1) -> (3), if (130_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* 0)
(1) -> (4), if (130_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* x1[4])
(2) -> (0), if (x0[2] - 1 →* x0[0])
(3) -> (0), if (0 →* x0[0])
(4) -> (0), if (0 →* x0[0])
(1) (>(x0[0], 0)=TRUE∧x0[0]=x0[1] ⇒ 130_0_NEST_NE(x0[0])≥NonInfC∧130_0_NEST_NE(x0[0])≥COND_130_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(2) (>(x0[0], 0)=TRUE ⇒ 130_0_NEST_NE(x0[0])≥NonInfC∧130_0_NEST_NE(x0[0])≥COND_130_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(3) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(2)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(4) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(2)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(5) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(2)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(6) (x0[0] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(3)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(7) (>(x0[0], 0)=TRUE∧x0[0]=x0[2] ⇒ 130_0_NEST_NE(x0[0])≥NonInfC∧130_0_NEST_NE(x0[0])≥COND_130_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(8) (>(x0[0], 0)=TRUE ⇒ 130_0_NEST_NE(x0[0])≥NonInfC∧130_0_NEST_NE(x0[0])≥COND_130_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(9) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(2)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(10) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(2)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(11) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(2)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(12) (x0[0] ≥ 0 ⇒ (UIncreasing(COND_130_0_NEST_NE(>(x0[0], 0), x0[0])), ≥)∧[(3)bni_15 + (-1)Bound*bni_15] + [bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(13) (COND_130_0_NEST_NE(TRUE, x0[1])≥NonInfC∧COND_130_0_NEST_NE(TRUE, x0[1])≥179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))∧(UIncreasing(179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥))
(14) ((UIncreasing(179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧[(-1)bso_18] ≥ 0)
(15) ((UIncreasing(179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧[(-1)bso_18] ≥ 0)
(16) ((UIncreasing(179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧[(-1)bso_18] ≥ 0)
(17) ((UIncreasing(179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧0 = 0∧[(-1)bso_18] ≥ 0)
(18) (COND_130_0_NEST_NE(TRUE, x0[2])≥NonInfC∧COND_130_0_NEST_NE(TRUE, x0[2])≥130_0_NEST_NE(-(x0[2], 1))∧(UIncreasing(130_0_NEST_NE(-(x0[2], 1))), ≥))
(19) ((UIncreasing(130_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧[1 + (-1)bso_20] ≥ 0)
(20) ((UIncreasing(130_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧[1 + (-1)bso_20] ≥ 0)
(21) ((UIncreasing(130_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧[1 + (-1)bso_20] ≥ 0)
(22) ((UIncreasing(130_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧0 = 0∧[1 + (-1)bso_20] ≥ 0)
(23) (0=x0[0] ⇒ 179_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥NonInfC∧179_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥130_0_NEST_NE(0)∧(UIncreasing(130_0_NEST_NE(0)), ≥))
(24) (179_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥NonInfC∧179_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥130_0_NEST_NE(0)∧(UIncreasing(130_0_NEST_NE(0)), ≥))
(25) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_21] = 0∧[1 + (-1)bso_22] ≥ 0)
(26) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_21] = 0∧[1 + (-1)bso_22] ≥ 0)
(27) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_21] = 0∧[1 + (-1)bso_22] ≥ 0)
(28) (179_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1[4])≥NonInfC∧179_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1[4])≥130_0_NEST_NE(0)∧(UIncreasing(130_0_NEST_NE(0)), ≥))
(29) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧[1 + (-1)bso_24] ≥ 0)
(30) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧[1 + (-1)bso_24] ≥ 0)
(31) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧[1 + (-1)bso_24] ≥ 0)
(32) ((UIncreasing(130_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧0 = 0∧[1 + (-1)bso_24] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(130_0_nest_NE(x1)) = [1] + x1
POL(0) = 0
POL(147_0_nest_Return) = [1]
POL(279_1_nest_InvokeMethod(x1)) = [-1]
POL(130_0_NEST_NE(x1)) = [2] + x1
POL(COND_130_0_NEST_NE(x1, x2)) = [2] + x2
POL(>(x1, x2)) = [-1]
POL(179_1_NEST_INVOKEMETHOD(x1, x2)) = [2] + x1
POL(-(x1, x2)) = x1 + [-1]x2
POL(1) = [1]
COND_130_0_NEST_NE(TRUE, x0[2]) → 130_0_NEST_NE(-(x0[2], 1))
179_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0) → 130_0_NEST_NE(0)
179_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1[4]) → 130_0_NEST_NE(0)
130_0_NEST_NE(x0[0]) → COND_130_0_NEST_NE(>(x0[0], 0), x0[0])
130_0_NEST_NE(x0[0]) → COND_130_0_NEST_NE(>(x0[0], 0), x0[0])
COND_130_0_NEST_NE(TRUE, x0[1]) → 179_1_NEST_INVOKEMETHOD(130_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))
130_0_nest_NE(0)1 ↔ 147_0_nest_Return1
!= | ~ | 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
(0) -> (1), if (x0[0] > 0 ∧x0[0] →* x0[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
(1) -> (3), if (130_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* 0)
(1) -> (4), if (130_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* x1[4])