0 JBC
↳1 JBCToGraph (⇒, 60 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 100 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 140 ms)
↳8 AND
↳9 IDP
↳10 IDependencyGraphProof (⇔, 0 ms)
↳11 TRUE
↳12 IDP
↳13 IDependencyGraphProof (⇔, 0 ms)
↳14 TRUE
public class TerminatorRec02 {
public static void main(String[] args) {
fact(args.length);
}
public static int fact(int x) {
if (x > 1) {
int y = fact(x - 1);
return y * x;
}
return 1;
}
}
Generated 10 rules for P and 17 rules for R.
P rules:
68_0_fact_ConstantStackPush(EOS(STATIC_68), i1, i1) → 69_0_fact_LE(EOS(STATIC_69), i1, i1, 1)
69_0_fact_LE(EOS(STATIC_69), i8, i8, matching1) → 71_0_fact_LE(EOS(STATIC_71), i8, i8, 1) | =(matching1, 1)
71_0_fact_LE(EOS(STATIC_71), i8, i8, matching1) → 75_0_fact_Load(EOS(STATIC_75), i8) | &&(>(i8, 1), =(matching1, 1))
75_0_fact_Load(EOS(STATIC_75), i8) → 79_0_fact_ConstantStackPush(EOS(STATIC_79), i8, i8)
79_0_fact_ConstantStackPush(EOS(STATIC_79), i8, i8) → 84_0_fact_IntArithmetic(EOS(STATIC_84), i8, i8, 1)
84_0_fact_IntArithmetic(EOS(STATIC_84), i8, i8, matching1) → 95_0_fact_InvokeMethod(EOS(STATIC_95), i8, -(i8, 1)) | &&(>(i8, 0), =(matching1, 1))
95_0_fact_InvokeMethod(EOS(STATIC_95), i8, i12) → 98_1_fact_InvokeMethod(98_0_fact_Load(EOS(STATIC_98), i12), i8, i12)
98_0_fact_Load(EOS(STATIC_98), i12) → 103_0_fact_Load(EOS(STATIC_103), i12)
103_0_fact_Load(EOS(STATIC_103), i12) → 67_0_fact_Load(EOS(STATIC_67), i12)
67_0_fact_Load(EOS(STATIC_67), i1) → 68_0_fact_ConstantStackPush(EOS(STATIC_68), i1, i1)
R rules:
69_0_fact_LE(EOS(STATIC_69), i7, i7, matching1) → 70_0_fact_LE(EOS(STATIC_70), i7, i7, 1) | =(matching1, 1)
70_0_fact_LE(EOS(STATIC_70), i7, i7, matching1) → 73_0_fact_ConstantStackPush(EOS(STATIC_73)) | &&(<=(i7, 1), =(matching1, 1))
73_0_fact_ConstantStackPush(EOS(STATIC_73)) → 77_0_fact_Return(EOS(STATIC_77), 1)
98_1_fact_InvokeMethod(77_0_fact_Return(EOS(STATIC_77), matching1), i8, matching2) → 118_0_fact_Return(EOS(STATIC_118), i8, 1, 1) | &&(=(matching1, 1), =(matching2, 1))
98_1_fact_InvokeMethod(128_0_fact_Return(EOS(STATIC_128)), i8, i22) → 142_0_fact_Return(EOS(STATIC_142), i8, i22)
98_1_fact_InvokeMethod(162_0_fact_Return(EOS(STATIC_162)), i8, i30) → 181_0_fact_Return(EOS(STATIC_181), i8, i30)
118_0_fact_Return(EOS(STATIC_118), i8, matching1, matching2) → 120_0_fact_Store(EOS(STATIC_120), i8, 1) | &&(=(matching1, 1), =(matching2, 1))
120_0_fact_Store(EOS(STATIC_120), i8, matching1) → 122_0_fact_Load(EOS(STATIC_122), i8, 1) | =(matching1, 1)
122_0_fact_Load(EOS(STATIC_122), i8, matching1) → 124_0_fact_Load(EOS(STATIC_124), i8, 1) | =(matching1, 1)
124_0_fact_Load(EOS(STATIC_124), i8, matching1) → 126_0_fact_IntArithmetic(EOS(STATIC_126), 1, i8) | =(matching1, 1)
126_0_fact_IntArithmetic(EOS(STATIC_126), matching1, i8) → 128_0_fact_Return(EOS(STATIC_128)) | &&(>(i8, 1), =(matching1, 1))
142_0_fact_Return(EOS(STATIC_142), i8, i22) → 147_0_fact_Store(EOS(STATIC_147), i8)
147_0_fact_Store(EOS(STATIC_147), i8) → 152_0_fact_Load(EOS(STATIC_152), i8)
152_0_fact_Load(EOS(STATIC_152), i8) → 157_0_fact_Load(EOS(STATIC_157), i8)
157_0_fact_Load(EOS(STATIC_157), i8) → 160_0_fact_IntArithmetic(EOS(STATIC_160), i8)
160_0_fact_IntArithmetic(EOS(STATIC_160), i8) → 162_0_fact_Return(EOS(STATIC_162)) | >(i8, 1)
181_0_fact_Return(EOS(STATIC_181), i8, i30) → 142_0_fact_Return(EOS(STATIC_142), i8, i30)
Combined rules. Obtained 1 conditional rules for P and 3 conditional rules for R.
P rules:
68_0_fact_ConstantStackPush(EOS(STATIC_68), x0, x0) → 98_1_fact_InvokeMethod(68_0_fact_ConstantStackPush(EOS(STATIC_68), -(x0, 1), -(x0, 1)), x0, -(x0, 1)) | >(x0, 1)
R rules:
98_1_fact_InvokeMethod(77_0_fact_Return(EOS(STATIC_77), 1), x1, 1) → 128_0_fact_Return(EOS(STATIC_128)) | >(x1, 1)
98_1_fact_InvokeMethod(128_0_fact_Return(EOS(STATIC_128)), x0, x1) → 162_0_fact_Return(EOS(STATIC_162)) | >(x0, 1)
98_1_fact_InvokeMethod(162_0_fact_Return(EOS(STATIC_162)), x0, x1) → 162_0_fact_Return(EOS(STATIC_162)) | >(x0, 1)
Filtered ground terms:
68_0_fact_ConstantStackPush(x1, x2, x3) → 68_0_fact_ConstantStackPush(x2, x3)
Cond_68_0_fact_ConstantStackPush(x1, x2, x3, x4) → Cond_68_0_fact_ConstantStackPush(x1, x3, x4)
162_0_fact_Return(x1) → 162_0_fact_Return
Cond_98_1_fact_InvokeMethod2(x1, x2, x3, x4) → Cond_98_1_fact_InvokeMethod2(x1, x3, x4)
Cond_98_1_fact_InvokeMethod1(x1, x2, x3, x4) → Cond_98_1_fact_InvokeMethod1(x1, x3, x4)
128_0_fact_Return(x1) → 128_0_fact_Return
Cond_98_1_fact_InvokeMethod(x1, x2, x3, x4) → Cond_98_1_fact_InvokeMethod(x1, x3)
77_0_fact_Return(x1, x2) → 77_0_fact_Return
Filtered duplicate args:
68_0_fact_ConstantStackPush(x1, x2) → 68_0_fact_ConstantStackPush(x2)
Cond_68_0_fact_ConstantStackPush(x1, x2, x3) → Cond_68_0_fact_ConstantStackPush(x1, x3)
Filtered unneeded arguments:
Cond_98_1_fact_InvokeMethod(x1, x2) → Cond_98_1_fact_InvokeMethod(x1)
Cond_98_1_fact_InvokeMethod1(x1, x2, x3) → Cond_98_1_fact_InvokeMethod1(x1)
Cond_98_1_fact_InvokeMethod2(x1, x2, x3) → Cond_98_1_fact_InvokeMethod2(x1)
Combined rules. Obtained 1 conditional rules for P and 3 conditional rules for R.
P rules:
68_0_fact_ConstantStackPush(x0) → 98_1_fact_InvokeMethod(68_0_fact_ConstantStackPush(-(x0, 1)), x0, -(x0, 1)) | >(x0, 1)
R rules:
98_1_fact_InvokeMethod(77_0_fact_Return, x1, 1) → 128_0_fact_Return | >(x1, 1)
98_1_fact_InvokeMethod(128_0_fact_Return, x0, x1) → 162_0_fact_Return | >(x0, 1)
98_1_fact_InvokeMethod(162_0_fact_Return, x0, x1) → 162_0_fact_Return | >(x0, 1)
Performed bisimulation on rules. Used the following equivalence classes: {[77_0_fact_Return, 128_0_fact_Return, 162_0_fact_Return]=77_0_fact_Return, [Cond_98_1_fact_InvokeMethod1_4, Cond_98_1_fact_InvokeMethod2_4]=Cond_98_1_fact_InvokeMethod1_4}
Finished conversion. Obtained 2 rules for P and 4 rules for R. System has predefined symbols.
P rules:
68_0_FACT_CONSTANTSTACKPUSH(x0) → COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0, 1), x0)
COND_68_0_FACT_CONSTANTSTACKPUSH(TRUE, x0) → 68_0_FACT_CONSTANTSTACKPUSH(-(x0, 1))
R rules:
98_1_fact_InvokeMethod(77_0_fact_Return, x1, 1) → Cond_98_1_fact_InvokeMethod(>(x1, 1), 77_0_fact_Return, x1, 1)
Cond_98_1_fact_InvokeMethod(TRUE, 77_0_fact_Return, x1, 1) → 77_0_fact_Return
98_1_fact_InvokeMethod(77_0_fact_Return, x0, x1) → Cond_98_1_fact_InvokeMethod1(>(x0, 1), 77_0_fact_Return, x0, x1)
Cond_98_1_fact_InvokeMethod1(TRUE, 77_0_fact_Return, x0, x1) → 77_0_fact_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] > 1 ∧x0[0] →* x0[1])
(1) -> (0), if (x0[1] - 1 →* x0[0])
(1) (>(x0[0], 1)=TRUE∧x0[0]=x0[1] ⇒ 68_0_FACT_CONSTANTSTACKPUSH(x0[0])≥NonInfC∧68_0_FACT_CONSTANTSTACKPUSH(x0[0])≥COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])∧(UIncreasing(COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])), ≥))
(2) (>(x0[0], 1)=TRUE ⇒ 68_0_FACT_CONSTANTSTACKPUSH(x0[0])≥NonInfC∧68_0_FACT_CONSTANTSTACKPUSH(x0[0])≥COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])∧(UIncreasing(COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])), ≥))
(3) (x0[0] + [-2] ≥ 0 ⇒ (UIncreasing(COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])), ≥)∧[(-1)Bound*bni_15] + [(2)bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(4) (x0[0] + [-2] ≥ 0 ⇒ (UIncreasing(COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])), ≥)∧[(-1)Bound*bni_15] + [(2)bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(5) (x0[0] + [-2] ≥ 0 ⇒ (UIncreasing(COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])), ≥)∧[(-1)Bound*bni_15] + [(2)bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(6) (x0[0] ≥ 0 ⇒ (UIncreasing(COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])), ≥)∧[(-1)Bound*bni_15 + (4)bni_15] + [(2)bni_15]x0[0] ≥ 0∧[(-1)bso_16] ≥ 0)
(7) (COND_68_0_FACT_CONSTANTSTACKPUSH(TRUE, x0[1])≥NonInfC∧COND_68_0_FACT_CONSTANTSTACKPUSH(TRUE, x0[1])≥68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))∧(UIncreasing(68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))), ≥))
(8) ((UIncreasing(68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))), ≥)∧[bni_17] = 0∧[2 + (-1)bso_18] ≥ 0)
(9) ((UIncreasing(68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))), ≥)∧[bni_17] = 0∧[2 + (-1)bso_18] ≥ 0)
(10) ((UIncreasing(68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))), ≥)∧[bni_17] = 0∧[2 + (-1)bso_18] ≥ 0)
(11) ((UIncreasing(68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))), ≥)∧[bni_17] = 0∧0 = 0∧[2 + (-1)bso_18] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(98_1_fact_InvokeMethod(x1, x2, x3)) = [-1] + [-1]x2
POL(77_0_fact_Return) = [-1]
POL(1) = [1]
POL(Cond_98_1_fact_InvokeMethod(x1, x2, x3, x4)) = [-1] + [-1]x3
POL(>(x1, x2)) = [-1]
POL(Cond_98_1_fact_InvokeMethod1(x1, x2, x3, x4)) = [-1] + [-1]x3
POL(68_0_FACT_CONSTANTSTACKPUSH(x1)) = [2]x1
POL(COND_68_0_FACT_CONSTANTSTACKPUSH(x1, x2)) = [2]x2
POL(-(x1, x2)) = x1 + [-1]x2
COND_68_0_FACT_CONSTANTSTACKPUSH(TRUE, x0[1]) → 68_0_FACT_CONSTANTSTACKPUSH(-(x0[1], 1))
68_0_FACT_CONSTANTSTACKPUSH(x0[0]) → COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])
68_0_FACT_CONSTANTSTACKPUSH(x0[0]) → COND_68_0_FACT_CONSTANTSTACKPUSH(>(x0[0], 1), x0[0])
!= | ~ | 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
!= | ~ | 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