0 JBC
↳1 JBCToGraph (⇒, 120 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 120 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 110 ms)
↳8 AND
↳9 IDP
↳10 IDependencyGraphProof (⇔, 0 ms)
↳11 TRUE
↳12 IDP
↳13 IDependencyGraphProof (⇔, 0 ms)
↳14 TRUE
public class LeUserDefRec {
public static void main(String[] args) {
int x = args[0].length();
int y = args[1].length();
le(x, y);
}
public static boolean le(int x, int y) {
if (x > 0 && y > 0) {
return le(x-1, y-1);
} else {
return (x == 0);
}
}
}
Generated 15 rules for P and 21 rules for R.
P rules:
249_0_le_LE(EOS(STATIC_249), i42, i37, i42) → 256_0_le_LE(EOS(STATIC_256), i42, i37, i42)
256_0_le_LE(EOS(STATIC_256), i42, i37, i42) → 262_0_le_Load(EOS(STATIC_262), i42, i37) | >(i42, 0)
262_0_le_Load(EOS(STATIC_262), i42, i37) → 269_0_le_LE(EOS(STATIC_269), i42, i37, i37)
269_0_le_LE(EOS(STATIC_269), i42, i44, i44) → 281_0_le_LE(EOS(STATIC_281), i42, i44, i44)
281_0_le_LE(EOS(STATIC_281), i42, i44, i44) → 291_0_le_Load(EOS(STATIC_291), i42, i44) | >(i44, 0)
291_0_le_Load(EOS(STATIC_291), i42, i44) → 297_0_le_ConstantStackPush(EOS(STATIC_297), i42, i44, i42)
297_0_le_ConstantStackPush(EOS(STATIC_297), i42, i44, i42) → 309_0_le_IntArithmetic(EOS(STATIC_309), i42, i44, i42, 1)
309_0_le_IntArithmetic(EOS(STATIC_309), i42, i44, i42, matching1) → 330_0_le_Load(EOS(STATIC_330), i42, i44, -(i42, 1)) | &&(>(i42, 0), =(matching1, 1))
330_0_le_Load(EOS(STATIC_330), i42, i44, i50) → 340_0_le_ConstantStackPush(EOS(STATIC_340), i42, i50, i44)
340_0_le_ConstantStackPush(EOS(STATIC_340), i42, i50, i44) → 355_0_le_IntArithmetic(EOS(STATIC_355), i42, i50, i44, 1)
355_0_le_IntArithmetic(EOS(STATIC_355), i42, i50, i44, matching1) → 377_0_le_InvokeMethod(EOS(STATIC_377), i42, i50, -(i44, 1)) | &&(>(i44, 0), =(matching1, 1))
377_0_le_InvokeMethod(EOS(STATIC_377), i42, i50, i59) → 385_1_le_InvokeMethod(385_0_le_Load(EOS(STATIC_385), i50, i59), i42, i50, i59)
385_0_le_Load(EOS(STATIC_385), i50, i59) → 389_0_le_Load(EOS(STATIC_389), i50, i59)
389_0_le_Load(EOS(STATIC_389), i50, i59) → 239_0_le_Load(EOS(STATIC_239), i50, i59)
239_0_le_Load(EOS(STATIC_239), i18, i37) → 249_0_le_LE(EOS(STATIC_249), i18, i37, i18)
R rules:
249_0_le_LE(EOS(STATIC_249), matching1, i37, matching2) → 255_0_le_LE(EOS(STATIC_255), 0, i37, 0) | &&(=(matching1, 0), =(matching2, 0))
255_0_le_LE(EOS(STATIC_255), matching1, i37, matching2) → 260_0_le_Load(EOS(STATIC_260), 0) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
260_0_le_Load(EOS(STATIC_260), matching1) → 267_0_le_NE(EOS(STATIC_267), 0) | =(matching1, 0)
267_0_le_NE(EOS(STATIC_267), matching1) → 278_0_le_ConstantStackPush(EOS(STATIC_278)) | =(matching1, 0)
269_0_le_LE(EOS(STATIC_269), i42, matching1, matching2) → 280_0_le_LE(EOS(STATIC_280), i42, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
278_0_le_ConstantStackPush(EOS(STATIC_278)) → 287_0_le_JMP(EOS(STATIC_287), 1)
280_0_le_LE(EOS(STATIC_280), i42, matching1, matching2) → 289_0_le_Load(EOS(STATIC_289), i42) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
287_0_le_JMP(EOS(STATIC_287), matching1) → 295_0_le_Return(EOS(STATIC_295), 1) | =(matching1, 1)
289_0_le_Load(EOS(STATIC_289), i42) → 296_0_le_NE(EOS(STATIC_296), i42)
296_0_le_NE(EOS(STATIC_296), i42) → 307_0_le_ConstantStackPush(EOS(STATIC_307)) | >(i42, 0)
307_0_le_ConstantStackPush(EOS(STATIC_307)) → 327_0_le_Return(EOS(STATIC_327), 0)
385_1_le_InvokeMethod(295_0_le_Return(EOS(STATIC_295), matching1), i42, matching2, i63) → 400_0_le_Return(EOS(STATIC_400), i42, 0, i63, 1) | &&(=(matching1, 1), =(matching2, 0))
385_1_le_InvokeMethod(327_0_le_Return(EOS(STATIC_327), matching1), i42, i65, matching2) → 404_0_le_Return(EOS(STATIC_404), i42, i65, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
385_1_le_InvokeMethod(408_0_le_Return(EOS(STATIC_408), i74, i66), i42, i74, i75) → 419_0_le_Return(EOS(STATIC_419), i42, i74, i75, i74, i66)
385_1_le_InvokeMethod(427_0_le_Return(EOS(STATIC_427), i84, i66), i42, i84, i85) → 447_0_le_Return(EOS(STATIC_447), i42, i84, i85, i84, i66)
400_0_le_Return(EOS(STATIC_400), i42, matching1, i63, matching2) → 405_0_le_Return(EOS(STATIC_405), i42, 0, i63, 1) | &&(=(matching1, 0), =(matching2, 1))
404_0_le_Return(EOS(STATIC_404), i42, i65, matching1, matching2) → 405_0_le_Return(EOS(STATIC_405), i42, i65, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
405_0_le_Return(EOS(STATIC_405), i42, i68, i67, i66) → 408_0_le_Return(EOS(STATIC_408), i42, i66)
408_0_le_Return(EOS(STATIC_408), i42, i66) → 427_0_le_Return(EOS(STATIC_427), i42, i66)
419_0_le_Return(EOS(STATIC_419), i42, i74, i75, i74, i66) → 427_0_le_Return(EOS(STATIC_427), i42, i66)
447_0_le_Return(EOS(STATIC_447), i42, i84, i85, i84, i66) → 419_0_le_Return(EOS(STATIC_419), i42, i84, i85, i84, i66)
Combined rules. Obtained 1 conditional rules for P and 5 conditional rules for R.
P rules:
249_0_le_LE(EOS(STATIC_249), x0, x1, x0) → 385_1_le_InvokeMethod(249_0_le_LE(EOS(STATIC_249), -(x0, 1), -(x1, 1), -(x0, 1)), x0, -(x0, 1), -(x1, 1)) | &&(>(x1, 0), >(x0, 0))
R rules:
249_0_le_LE(EOS(STATIC_249), 0, x1, 0) → 295_0_le_Return(EOS(STATIC_295), 1)
385_1_le_InvokeMethod(408_0_le_Return(EOS(STATIC_408), x0, x1), x2, x0, x3) → 427_0_le_Return(EOS(STATIC_427), x2, x1)
385_1_le_InvokeMethod(427_0_le_Return(EOS(STATIC_427), x0, x1), x2, x0, x3) → 427_0_le_Return(EOS(STATIC_427), x2, x1)
385_1_le_InvokeMethod(295_0_le_Return(EOS(STATIC_295), 1), x1, 0, x3) → 427_0_le_Return(EOS(STATIC_427), x1, 1)
385_1_le_InvokeMethod(327_0_le_Return(EOS(STATIC_327), 0), x1, x2, 0) → 427_0_le_Return(EOS(STATIC_427), x1, 0)
Filtered ground terms:
249_0_le_LE(x1, x2, x3, x4) → 249_0_le_LE(x2, x3, x4)
Cond_249_0_le_LE(x1, x2, x3, x4, x5) → Cond_249_0_le_LE(x1, x3, x4, x5)
427_0_le_Return(x1, x2, x3) → 427_0_le_Return(x2, x3)
327_0_le_Return(x1, x2) → 327_0_le_Return
295_0_le_Return(x1, x2) → 295_0_le_Return
408_0_le_Return(x1, x2, x3) → 408_0_le_Return(x2, x3)
Filtered duplicate args:
249_0_le_LE(x1, x2, x3) → 249_0_le_LE(x2, x3)
Cond_249_0_le_LE(x1, x2, x3, x4) → Cond_249_0_le_LE(x1, x3, x4)
Filtered unneeded arguments:
385_1_le_InvokeMethod(x1, x2, x3, x4) → 385_1_le_InvokeMethod(x1, x3, x4)
Combined rules. Obtained 1 conditional rules for P and 5 conditional rules for R.
P rules:
249_0_le_LE(x1, x0) → 385_1_le_InvokeMethod(249_0_le_LE(-(x1, 1), -(x0, 1)), -(x0, 1), -(x1, 1)) | &&(>(x1, 0), >(x0, 0))
R rules:
249_0_le_LE(x1, 0) → 295_0_le_Return
385_1_le_InvokeMethod(408_0_le_Return(x0, x1), x0, x3) → 427_0_le_Return(x2, x1)
385_1_le_InvokeMethod(427_0_le_Return(x0, x1), x0, x3) → 427_0_le_Return(x2, x1)
385_1_le_InvokeMethod(295_0_le_Return, 0, x3) → 427_0_le_Return(x1, 1)
385_1_le_InvokeMethod(327_0_le_Return, x2, 0) → 427_0_le_Return(x1, 0)
Performed bisimulation on rules. Used the following equivalence classes: {[295_0_le_Return, 327_0_le_Return]=295_0_le_Return}
Finished conversion. Obtained 2 rules for P and 5 rules for R. System has predefined symbols.
P rules:
249_0_LE_LE(x1, x0) → COND_249_0_LE_LE(&&(>(x1, 0), >(x0, 0)), x1, x0)
COND_249_0_LE_LE(TRUE, x1, x0) → 249_0_LE_LE(-(x1, 1), -(x0, 1))
R rules:
249_0_le_LE(x1, 0) → 295_0_le_Return
385_1_le_InvokeMethod(408_0_le_Return(x0, x1), x0, x3) → 427_0_le_Return(x2, x1)
385_1_le_InvokeMethod(427_0_le_Return(x0, x1), x0, x3) → 427_0_le_Return(x2, x1)
385_1_le_InvokeMethod(295_0_le_Return, 0, x3) → 427_0_le_Return(x1, 1)
385_1_le_InvokeMethod(295_0_le_Return, x2, 0) → 427_0_le_Return(x1, 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 |
Boolean, Integer
(0) -> (1), if (x1[0] > 0 && x0[0] > 0 ∧x1[0] →* x1[1]∧x0[0] →* x0[1])
(1) -> (0), if (x1[1] - 1 →* x1[0]∧x0[1] - 1 →* x0[0])
(1) (&&(>(x1[0], 0), >(x0[0], 0))=TRUE∧x1[0]=x1[1]∧x0[0]=x0[1] ⇒ 249_0_LE_LE(x1[0], x0[0])≥NonInfC∧249_0_LE_LE(x1[0], x0[0])≥COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])∧(UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥))
(2) (>(x1[0], 0)=TRUE∧>(x0[0], 0)=TRUE ⇒ 249_0_LE_LE(x1[0], x0[0])≥NonInfC∧249_0_LE_LE(x1[0], x0[0])≥COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])∧(UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥))
(3) (x1[0] + [-1] ≥ 0∧x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥)∧[bni_14 + (-1)Bound*bni_14] + [(2)bni_14]x0[0] + [(2)bni_14]x1[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(4) (x1[0] + [-1] ≥ 0∧x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥)∧[bni_14 + (-1)Bound*bni_14] + [(2)bni_14]x0[0] + [(2)bni_14]x1[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(5) (x1[0] + [-1] ≥ 0∧x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥)∧[bni_14 + (-1)Bound*bni_14] + [(2)bni_14]x0[0] + [(2)bni_14]x1[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(6) (x1[0] ≥ 0∧x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥)∧[(3)bni_14 + (-1)Bound*bni_14] + [(2)bni_14]x0[0] + [(2)bni_14]x1[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(7) (x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥)∧[(5)bni_14 + (-1)Bound*bni_14] + [(2)bni_14]x0[0] + [(2)bni_14]x1[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(8) (COND_249_0_LE_LE(TRUE, x1[1], x0[1])≥NonInfC∧COND_249_0_LE_LE(TRUE, x1[1], x0[1])≥249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))∧(UIncreasing(249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥))
(9) ((UIncreasing(249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧[4 + (-1)bso_17] ≥ 0)
(10) ((UIncreasing(249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧[4 + (-1)bso_17] ≥ 0)
(11) ((UIncreasing(249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧[4 + (-1)bso_17] ≥ 0)
(12) ((UIncreasing(249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧0 = 0∧0 = 0∧[4 + (-1)bso_17] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(249_0_le_LE(x1, x2)) = [-1]
POL(0) = 0
POL(295_0_le_Return) = [-1]
POL(385_1_le_InvokeMethod(x1, x2, x3)) = [-1]
POL(408_0_le_Return(x1, x2)) = [-1]
POL(427_0_le_Return(x1, x2)) = [-1]
POL(1) = [1]
POL(249_0_LE_LE(x1, x2)) = [1] + [2]x2 + [2]x1
POL(COND_249_0_LE_LE(x1, x2, x3)) = [1] + [2]x3 + [2]x2
POL(&&(x1, x2)) = [-1]
POL(>(x1, x2)) = [-1]
POL(-(x1, x2)) = x1 + [-1]x2
COND_249_0_LE_LE(TRUE, x1[1], x0[1]) → 249_0_LE_LE(-(x1[1], 1), -(x0[1], 1))
249_0_LE_LE(x1[0], x0[0]) → COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])
249_0_LE_LE(x1[0], x0[0]) → COND_249_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], 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 |
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