0 JBC
↳1 JBCToGraph (⇒, 60 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 70 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:
127_0_nest_NE(EOS(STATIC_127), i22, i22) → 135_0_nest_NE(EOS(STATIC_135), i22, i22)
135_0_nest_NE(EOS(STATIC_135), i22, i22) → 139_0_nest_Load(EOS(STATIC_139), i22) | >(i22, 0)
139_0_nest_Load(EOS(STATIC_139), i22) → 146_0_nest_ConstantStackPush(EOS(STATIC_146), i22)
146_0_nest_ConstantStackPush(EOS(STATIC_146), i22) → 152_0_nest_IntArithmetic(EOS(STATIC_152), i22, 1)
152_0_nest_IntArithmetic(EOS(STATIC_152), i22, matching1) → 161_0_nest_InvokeMethod(EOS(STATIC_161), -(i22, 1)) | &&(>(i22, 0), =(matching1, 1))
161_0_nest_InvokeMethod(EOS(STATIC_161), i24) → 178_1_nest_InvokeMethod(178_0_nest_Load(EOS(STATIC_178), i24), i24)
178_0_nest_Load(EOS(STATIC_178), i24) → 187_0_nest_Load(EOS(STATIC_187), i24)
178_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), matching1, matching2), matching3) → 214_0_nest_Return(EOS(STATIC_214), 0, 0, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
178_1_nest_InvokeMethod(278_0_nest_Return(EOS(STATIC_278), matching1), i41) → 295_0_nest_Return(EOS(STATIC_295), i41, 0) | =(matching1, 0)
187_0_nest_Load(EOS(STATIC_187), i24) → 122_0_nest_Load(EOS(STATIC_122), i24)
122_0_nest_Load(EOS(STATIC_122), i13) → 127_0_nest_NE(EOS(STATIC_127), i13, i13)
214_0_nest_Return(EOS(STATIC_214), matching1, matching2, matching3) → 220_0_nest_InvokeMethod(EOS(STATIC_220), 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
220_0_nest_InvokeMethod(EOS(STATIC_220), matching1) → 261_0_nest_InvokeMethod(EOS(STATIC_261), 0) | =(matching1, 0)
261_0_nest_InvokeMethod(EOS(STATIC_261), matching1) → 265_1_nest_InvokeMethod(265_0_nest_Load(EOS(STATIC_265), 0), 0) | =(matching1, 0)
265_0_nest_Load(EOS(STATIC_265), matching1) → 269_0_nest_Load(EOS(STATIC_269), 0) | =(matching1, 0)
269_0_nest_Load(EOS(STATIC_269), matching1) → 122_0_nest_Load(EOS(STATIC_122), 0) | =(matching1, 0)
295_0_nest_Return(EOS(STATIC_295), i41, matching1) → 252_0_nest_Return(EOS(STATIC_252), i41, 0) | =(matching1, 0)
252_0_nest_Return(EOS(STATIC_252), i34, matching1) → 261_0_nest_InvokeMethod(EOS(STATIC_261), 0) | =(matching1, 0)
R rules:
127_0_nest_NE(EOS(STATIC_127), matching1, matching2) → 136_0_nest_NE(EOS(STATIC_136), 0, 0) | &&(=(matching1, 0), =(matching2, 0))
136_0_nest_NE(EOS(STATIC_136), matching1, matching2) → 140_0_nest_ConstantStackPush(EOS(STATIC_140), 0) | &&(=(matching1, 0), =(matching2, 0))
140_0_nest_ConstantStackPush(EOS(STATIC_140), matching1) → 147_0_nest_Return(EOS(STATIC_147), 0, 0) | =(matching1, 0)
265_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), matching1, matching2), matching3) → 276_0_nest_Return(EOS(STATIC_276), 0, 0, 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
276_0_nest_Return(EOS(STATIC_276), matching1, matching2, matching3) → 278_0_nest_Return(EOS(STATIC_278), 0) | &&(&&(=(matching1, 0), =(matching2, 0)), =(matching3, 0))
Combined rules. Obtained 3 conditional rules for P and 2 conditional rules for R.
P rules:
127_0_nest_NE(EOS(STATIC_127), x0, x0) → 178_1_nest_InvokeMethod(127_0_nest_NE(EOS(STATIC_127), -(x0, 1), -(x0, 1)), -(x0, 1)) | >(x0, 0)
178_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), 0, 0), 0) → 265_1_nest_InvokeMethod(127_0_nest_NE(EOS(STATIC_127), 0, 0), 0)
178_1_nest_InvokeMethod(278_0_nest_Return(EOS(STATIC_278), 0), x1) → 265_1_nest_InvokeMethod(127_0_nest_NE(EOS(STATIC_127), 0, 0), 0)
R rules:
127_0_nest_NE(EOS(STATIC_127), 0, 0) → 147_0_nest_Return(EOS(STATIC_147), 0, 0)
265_1_nest_InvokeMethod(147_0_nest_Return(EOS(STATIC_147), 0, 0), 0) → 278_0_nest_Return(EOS(STATIC_278), 0)
Filtered ground terms:
265_1_nest_InvokeMethod(x1, x2) → 265_1_nest_InvokeMethod(x1)
127_0_nest_NE(x1, x2, x3) → 127_0_nest_NE(x2, x3)
278_0_nest_Return(x1, x2) → 278_0_nest_Return
147_0_nest_Return(x1, x2, x3) → 147_0_nest_Return
Cond_127_0_nest_NE(x1, x2, x3, x4) → Cond_127_0_nest_NE(x1, x3, x4)
Filtered duplicate args:
127_0_nest_NE(x1, x2) → 127_0_nest_NE(x2)
Cond_127_0_nest_NE(x1, x2, x3) → Cond_127_0_nest_NE(x1, x3)
Combined rules. Obtained 3 conditional rules for P and 2 conditional rules for R.
P rules:
127_0_nest_NE(x0) → 178_1_nest_InvokeMethod(127_0_nest_NE(-(x0, 1)), -(x0, 1)) | >(x0, 0)
178_1_nest_InvokeMethod(147_0_nest_Return, 0) → 265_1_nest_InvokeMethod(127_0_nest_NE(0))
178_1_nest_InvokeMethod(278_0_nest_Return, x1) → 265_1_nest_InvokeMethod(127_0_nest_NE(0))
R rules:
127_0_nest_NE(0) → 147_0_nest_Return
265_1_nest_InvokeMethod(147_0_nest_Return) → 278_0_nest_Return
Performed bisimulation on rules. Used the following equivalence classes: {[147_0_nest_Return, 278_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:
127_0_NEST_NE(x0) → COND_127_0_NEST_NE(>(x0, 0), x0)
COND_127_0_NEST_NE(TRUE, x0) → 178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0, 1)), -(x0, 1))
COND_127_0_NEST_NE(TRUE, x0) → 127_0_NEST_NE(-(x0, 1))
178_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0) → 127_0_NEST_NE(0)
178_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1) → 127_0_NEST_NE(0)
R rules:
127_0_nest_NE(0) → 147_0_nest_Return
265_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 (127_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* 0)
(1) -> (4), if (127_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] ⇒ 127_0_NEST_NE(x0[0])≥NonInfC∧127_0_NEST_NE(x0[0])≥COND_127_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_127_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(2) (>(x0[0], 0)=TRUE ⇒ 127_0_NEST_NE(x0[0])≥NonInfC∧127_0_NEST_NE(x0[0])≥COND_127_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_127_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(3) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_127_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_127_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_127_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_127_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] ⇒ 127_0_NEST_NE(x0[0])≥NonInfC∧127_0_NEST_NE(x0[0])≥COND_127_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_127_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(8) (>(x0[0], 0)=TRUE ⇒ 127_0_NEST_NE(x0[0])≥NonInfC∧127_0_NEST_NE(x0[0])≥COND_127_0_NEST_NE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_127_0_NEST_NE(>(x0[0], 0), x0[0])), ≥))
(9) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_127_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_127_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_127_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_127_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_127_0_NEST_NE(TRUE, x0[1])≥NonInfC∧COND_127_0_NEST_NE(TRUE, x0[1])≥178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))∧(UIncreasing(178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥))
(14) ((UIncreasing(178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧[(-1)bso_18] ≥ 0)
(15) ((UIncreasing(178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧[(-1)bso_18] ≥ 0)
(16) ((UIncreasing(178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧[(-1)bso_18] ≥ 0)
(17) ((UIncreasing(178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))), ≥)∧[bni_17] = 0∧0 = 0∧[(-1)bso_18] ≥ 0)
(18) (COND_127_0_NEST_NE(TRUE, x0[2])≥NonInfC∧COND_127_0_NEST_NE(TRUE, x0[2])≥127_0_NEST_NE(-(x0[2], 1))∧(UIncreasing(127_0_NEST_NE(-(x0[2], 1))), ≥))
(19) ((UIncreasing(127_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧[1 + (-1)bso_20] ≥ 0)
(20) ((UIncreasing(127_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧[1 + (-1)bso_20] ≥ 0)
(21) ((UIncreasing(127_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧[1 + (-1)bso_20] ≥ 0)
(22) ((UIncreasing(127_0_NEST_NE(-(x0[2], 1))), ≥)∧[bni_19] = 0∧0 = 0∧[1 + (-1)bso_20] ≥ 0)
(23) (0=x0[0] ⇒ 178_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥NonInfC∧178_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥127_0_NEST_NE(0)∧(UIncreasing(127_0_NEST_NE(0)), ≥))
(24) (178_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥NonInfC∧178_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0)≥127_0_NEST_NE(0)∧(UIncreasing(127_0_NEST_NE(0)), ≥))
(25) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_21] = 0∧[1 + (-1)bso_22] ≥ 0)
(26) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_21] = 0∧[1 + (-1)bso_22] ≥ 0)
(27) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_21] = 0∧[1 + (-1)bso_22] ≥ 0)
(28) (178_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1[4])≥NonInfC∧178_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1[4])≥127_0_NEST_NE(0)∧(UIncreasing(127_0_NEST_NE(0)), ≥))
(29) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧[1 + (-1)bso_24] ≥ 0)
(30) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧[1 + (-1)bso_24] ≥ 0)
(31) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧[1 + (-1)bso_24] ≥ 0)
(32) ((UIncreasing(127_0_NEST_NE(0)), ≥)∧[bni_23] = 0∧0 = 0∧[1 + (-1)bso_24] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(127_0_nest_NE(x1)) = [1] + x1
POL(0) = 0
POL(147_0_nest_Return) = [1]
POL(265_1_nest_InvokeMethod(x1)) = [-1]
POL(127_0_NEST_NE(x1)) = [2] + x1
POL(COND_127_0_NEST_NE(x1, x2)) = [2] + x2
POL(>(x1, x2)) = [-1]
POL(178_1_NEST_INVOKEMETHOD(x1, x2)) = [2] + x1
POL(-(x1, x2)) = x1 + [-1]x2
POL(1) = [1]
COND_127_0_NEST_NE(TRUE, x0[2]) → 127_0_NEST_NE(-(x0[2], 1))
178_1_NEST_INVOKEMETHOD(147_0_nest_Return, 0) → 127_0_NEST_NE(0)
178_1_NEST_INVOKEMETHOD(147_0_nest_Return, x1[4]) → 127_0_NEST_NE(0)
127_0_NEST_NE(x0[0]) → COND_127_0_NEST_NE(>(x0[0], 0), x0[0])
127_0_NEST_NE(x0[0]) → COND_127_0_NEST_NE(>(x0[0], 0), x0[0])
COND_127_0_NEST_NE(TRUE, x0[1]) → 178_1_NEST_INVOKEMETHOD(127_0_nest_NE(-(x0[1], 1)), -(x0[1], 1))
127_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 (127_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* 0)
(1) -> (4), if (127_0_nest_NE(x0[1] - 1) →* 147_0_nest_Return∧x0[1] - 1 →* x1[4])