0 JBC
↳1 JBCToGraph (⇒, 120 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 120 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 120 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:
262_0_le_LE(EOS(STATIC_262), i42, i37, i42) → 271_0_le_LE(EOS(STATIC_271), i42, i37, i42)
271_0_le_LE(EOS(STATIC_271), i42, i37, i42) → 278_0_le_Load(EOS(STATIC_278), i42, i37) | >(i42, 0)
278_0_le_Load(EOS(STATIC_278), i42, i37) → 290_0_le_LE(EOS(STATIC_290), i42, i37, i37)
290_0_le_LE(EOS(STATIC_290), i42, i46, i46) → 306_0_le_LE(EOS(STATIC_306), i42, i46, i46)
306_0_le_LE(EOS(STATIC_306), i42, i46, i46) → 319_0_le_Load(EOS(STATIC_319), i42, i46) | >(i46, 0)
319_0_le_Load(EOS(STATIC_319), i42, i46) → 332_0_le_ConstantStackPush(EOS(STATIC_332), i42, i46, i42)
332_0_le_ConstantStackPush(EOS(STATIC_332), i42, i46, i42) → 346_0_le_IntArithmetic(EOS(STATIC_346), i42, i46, i42, 1)
346_0_le_IntArithmetic(EOS(STATIC_346), i42, i46, i42, matching1) → 365_0_le_Load(EOS(STATIC_365), i42, i46, -(i42, 1)) | &&(>(i42, 0), =(matching1, 1))
365_0_le_Load(EOS(STATIC_365), i42, i46, i54) → 375_0_le_ConstantStackPush(EOS(STATIC_375), i42, i54, i46)
375_0_le_ConstantStackPush(EOS(STATIC_375), i42, i54, i46) → 385_0_le_IntArithmetic(EOS(STATIC_385), i42, i54, i46, 1)
385_0_le_IntArithmetic(EOS(STATIC_385), i42, i54, i46, matching1) → 403_0_le_InvokeMethod(EOS(STATIC_403), i42, i54, -(i46, 1)) | &&(>(i46, 0), =(matching1, 1))
403_0_le_InvokeMethod(EOS(STATIC_403), i42, i54, i61) → 409_1_le_InvokeMethod(409_0_le_Load(EOS(STATIC_409), i54, i61), i42, i54, i61)
409_0_le_Load(EOS(STATIC_409), i54, i61) → 413_0_le_Load(EOS(STATIC_413), i54, i61)
413_0_le_Load(EOS(STATIC_413), i54, i61) → 251_0_le_Load(EOS(STATIC_251), i54, i61)
251_0_le_Load(EOS(STATIC_251), i18, i37) → 262_0_le_LE(EOS(STATIC_262), i18, i37, i18)
R rules:
262_0_le_LE(EOS(STATIC_262), matching1, i37, matching2) → 270_0_le_LE(EOS(STATIC_270), 0, i37, 0) | &&(=(matching1, 0), =(matching2, 0))
270_0_le_LE(EOS(STATIC_270), matching1, i37, matching2) → 277_0_le_Load(EOS(STATIC_277), 0) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
277_0_le_Load(EOS(STATIC_277), matching1) → 287_0_le_NE(EOS(STATIC_287), 0) | =(matching1, 0)
287_0_le_NE(EOS(STATIC_287), matching1) → 302_0_le_ConstantStackPush(EOS(STATIC_302)) | =(matching1, 0)
290_0_le_LE(EOS(STATIC_290), i42, matching1, matching2) → 305_0_le_LE(EOS(STATIC_305), i42, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
302_0_le_ConstantStackPush(EOS(STATIC_302)) → 315_0_le_JMP(EOS(STATIC_315), 1)
305_0_le_LE(EOS(STATIC_305), i42, matching1, matching2) → 317_0_le_Load(EOS(STATIC_317), i42) | &&(&&(<=(0, 0), =(matching1, 0)), =(matching2, 0))
315_0_le_JMP(EOS(STATIC_315), matching1) → 327_0_le_Return(EOS(STATIC_327), 1) | =(matching1, 1)
317_0_le_Load(EOS(STATIC_317), i42) → 330_0_le_NE(EOS(STATIC_330), i42)
330_0_le_NE(EOS(STATIC_330), i42) → 344_0_le_ConstantStackPush(EOS(STATIC_344)) | >(i42, 0)
344_0_le_ConstantStackPush(EOS(STATIC_344)) → 364_0_le_Return(EOS(STATIC_364), 0)
409_1_le_InvokeMethod(327_0_le_Return(EOS(STATIC_327), matching1), i42, matching2, i65) → 420_0_le_Return(EOS(STATIC_420), i42, 0, i65, 1) | &&(=(matching1, 1), =(matching2, 0))
409_1_le_InvokeMethod(364_0_le_Return(EOS(STATIC_364), matching1), i42, i68, matching2) → 424_0_le_Return(EOS(STATIC_424), i42, i68, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
409_1_le_InvokeMethod(427_0_le_Return(EOS(STATIC_427), i77, i69), i42, i77, i78) → 438_0_le_Return(EOS(STATIC_438), i42, i77, i78, i77, i69)
409_1_le_InvokeMethod(444_0_le_Return(EOS(STATIC_444), i85, i69), i42, i85, i86) → 461_0_le_Return(EOS(STATIC_461), i42, i85, i86, i85, i69)
420_0_le_Return(EOS(STATIC_420), i42, matching1, i65, matching2) → 425_0_le_Return(EOS(STATIC_425), i42, 0, i65, 1) | &&(=(matching1, 0), =(matching2, 1))
424_0_le_Return(EOS(STATIC_424), i42, i68, matching1, matching2) → 425_0_le_Return(EOS(STATIC_425), i42, i68, 0, 0) | &&(=(matching1, 0), =(matching2, 0))
425_0_le_Return(EOS(STATIC_425), i42, i71, i70, i69) → 427_0_le_Return(EOS(STATIC_427), i42, i69)
427_0_le_Return(EOS(STATIC_427), i42, i69) → 444_0_le_Return(EOS(STATIC_444), i42, i69)
438_0_le_Return(EOS(STATIC_438), i42, i77, i78, i77, i69) → 444_0_le_Return(EOS(STATIC_444), i42, i69)
461_0_le_Return(EOS(STATIC_461), i42, i85, i86, i85, i69) → 438_0_le_Return(EOS(STATIC_438), i42, i85, i86, i85, i69)
Combined rules. Obtained 1 conditional rules for P and 5 conditional rules for R.
P rules:
262_0_le_LE(EOS(STATIC_262), x0, x1, x0) → 409_1_le_InvokeMethod(262_0_le_LE(EOS(STATIC_262), -(x0, 1), -(x1, 1), -(x0, 1)), x0, -(x0, 1), -(x1, 1)) | &&(>(x1, 0), >(x0, 0))
R rules:
262_0_le_LE(EOS(STATIC_262), 0, x1, 0) → 327_0_le_Return(EOS(STATIC_327), 1)
409_1_le_InvokeMethod(427_0_le_Return(EOS(STATIC_427), x0, x1), x2, x0, x3) → 444_0_le_Return(EOS(STATIC_444), x2, x1)
409_1_le_InvokeMethod(444_0_le_Return(EOS(STATIC_444), x0, x1), x2, x0, x3) → 444_0_le_Return(EOS(STATIC_444), x2, x1)
409_1_le_InvokeMethod(327_0_le_Return(EOS(STATIC_327), 1), x1, 0, x3) → 444_0_le_Return(EOS(STATIC_444), x1, 1)
409_1_le_InvokeMethod(364_0_le_Return(EOS(STATIC_364), 0), x1, x2, 0) → 444_0_le_Return(EOS(STATIC_444), x1, 0)
Filtered ground terms:
262_0_le_LE(x1, x2, x3, x4) → 262_0_le_LE(x2, x3, x4)
Cond_262_0_le_LE(x1, x2, x3, x4, x5) → Cond_262_0_le_LE(x1, x3, x4, x5)
444_0_le_Return(x1, x2, x3) → 444_0_le_Return(x2, x3)
364_0_le_Return(x1, x2) → 364_0_le_Return
327_0_le_Return(x1, x2) → 327_0_le_Return
427_0_le_Return(x1, x2, x3) → 427_0_le_Return(x2, x3)
Filtered duplicate args:
262_0_le_LE(x1, x2, x3) → 262_0_le_LE(x2, x3)
Cond_262_0_le_LE(x1, x2, x3, x4) → Cond_262_0_le_LE(x1, x3, x4)
Filtered unneeded arguments:
409_1_le_InvokeMethod(x1, x2, x3, x4) → 409_1_le_InvokeMethod(x1, x3, x4)
Combined rules. Obtained 1 conditional rules for P and 5 conditional rules for R.
P rules:
262_0_le_LE(x1, x0) → 409_1_le_InvokeMethod(262_0_le_LE(-(x1, 1), -(x0, 1)), -(x0, 1), -(x1, 1)) | &&(>(x1, 0), >(x0, 0))
R rules:
262_0_le_LE(x1, 0) → 327_0_le_Return
409_1_le_InvokeMethod(427_0_le_Return(x0, x1), x0, x3) → 444_0_le_Return(x2, x1)
409_1_le_InvokeMethod(444_0_le_Return(x0, x1), x0, x3) → 444_0_le_Return(x2, x1)
409_1_le_InvokeMethod(327_0_le_Return, 0, x3) → 444_0_le_Return(x1, 1)
409_1_le_InvokeMethod(364_0_le_Return, x2, 0) → 444_0_le_Return(x1, 0)
Performed bisimulation on rules. Used the following equivalence classes: {[327_0_le_Return, 364_0_le_Return]=327_0_le_Return}
Finished conversion. Obtained 2 rules for P and 5 rules for R. System has predefined symbols.
P rules:
262_0_LE_LE(x1, x0) → COND_262_0_LE_LE(&&(>(x1, 0), >(x0, 0)), x1, x0)
COND_262_0_LE_LE(TRUE, x1, x0) → 262_0_LE_LE(-(x1, 1), -(x0, 1))
R rules:
262_0_le_LE(x1, 0) → 327_0_le_Return
409_1_le_InvokeMethod(427_0_le_Return(x0, x1), x0, x3) → 444_0_le_Return(x2, x1)
409_1_le_InvokeMethod(444_0_le_Return(x0, x1), x0, x3) → 444_0_le_Return(x2, x1)
409_1_le_InvokeMethod(327_0_le_Return, 0, x3) → 444_0_le_Return(x1, 1)
409_1_le_InvokeMethod(327_0_le_Return, x2, 0) → 444_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] ⇒ 262_0_LE_LE(x1[0], x0[0])≥NonInfC∧262_0_LE_LE(x1[0], x0[0])≥COND_262_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])∧(UIncreasing(COND_262_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥))
(2) (>(x1[0], 0)=TRUE∧>(x0[0], 0)=TRUE ⇒ 262_0_LE_LE(x1[0], x0[0])≥NonInfC∧262_0_LE_LE(x1[0], x0[0])≥COND_262_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])∧(UIncreasing(COND_262_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])), ≥))
(3) (x1[0] + [-1] ≥ 0∧x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_262_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_262_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_262_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_262_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_262_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_262_0_LE_LE(TRUE, x1[1], x0[1])≥NonInfC∧COND_262_0_LE_LE(TRUE, x1[1], x0[1])≥262_0_LE_LE(-(x1[1], 1), -(x0[1], 1))∧(UIncreasing(262_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥))
(9) ((UIncreasing(262_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧[4 + (-1)bso_17] ≥ 0)
(10) ((UIncreasing(262_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧[4 + (-1)bso_17] ≥ 0)
(11) ((UIncreasing(262_0_LE_LE(-(x1[1], 1), -(x0[1], 1))), ≥)∧[bni_16] = 0∧[4 + (-1)bso_17] ≥ 0)
(12) ((UIncreasing(262_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(262_0_le_LE(x1, x2)) = [-1]
POL(0) = 0
POL(327_0_le_Return) = [-1]
POL(409_1_le_InvokeMethod(x1, x2, x3)) = [-1]
POL(427_0_le_Return(x1, x2)) = [-1]
POL(444_0_le_Return(x1, x2)) = [-1]
POL(1) = [1]
POL(262_0_LE_LE(x1, x2)) = [1] + [2]x2 + [2]x1
POL(COND_262_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_262_0_LE_LE(TRUE, x1[1], x0[1]) → 262_0_LE_LE(-(x1[1], 1), -(x0[1], 1))
262_0_LE_LE(x1[0], x0[0]) → COND_262_0_LE_LE(&&(>(x1[0], 0), >(x0[0], 0)), x1[0], x0[0])
262_0_LE_LE(x1[0], x0[0]) → COND_262_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