0 JBC
↳1 JBCToGraph (⇒, 160 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 90 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 130 ms)
↳8 IDP
↳9 IDependencyGraphProof (⇔, 0 ms)
↳10 TRUE
public class PlusSwap{
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z;
int res = 0;
while (y > 0) {
z = x;
x = y-1;
y = z;
res++;
}
res = res + x;
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
Generated 14 rules for P and 0 rules for R.
P rules:
586_0_main_LE(EOS(STATIC_586), i113, i123, i123) → 590_0_main_LE(EOS(STATIC_590), i113, i123, i123)
590_0_main_LE(EOS(STATIC_590), i113, i123, i123) → 594_0_main_Load(EOS(STATIC_594), i113, i123) | >(i123, 0)
594_0_main_Load(EOS(STATIC_594), i113, i123) → 599_0_main_Store(EOS(STATIC_599), i123, i113)
599_0_main_Store(EOS(STATIC_599), i123, i113) → 603_0_main_Load(EOS(STATIC_603), i123, i113)
603_0_main_Load(EOS(STATIC_603), i123, i113) → 607_0_main_ConstantStackPush(EOS(STATIC_607), i113, i123)
607_0_main_ConstantStackPush(EOS(STATIC_607), i113, i123) → 611_0_main_IntArithmetic(EOS(STATIC_611), i113, i123, 1)
611_0_main_IntArithmetic(EOS(STATIC_611), i113, i123, matching1) → 614_0_main_Store(EOS(STATIC_614), i113, -(i123, 1)) | &&(>(i123, 0), =(matching1, 1))
614_0_main_Store(EOS(STATIC_614), i113, i127) → 617_0_main_Load(EOS(STATIC_617), i127, i113)
617_0_main_Load(EOS(STATIC_617), i127, i113) → 619_0_main_Store(EOS(STATIC_619), i127, i113)
619_0_main_Store(EOS(STATIC_619), i127, i113) → 621_0_main_Inc(EOS(STATIC_621), i127, i113)
621_0_main_Inc(EOS(STATIC_621), i127, i113) → 624_0_main_JMP(EOS(STATIC_624), i127, i113)
624_0_main_JMP(EOS(STATIC_624), i127, i113) → 628_0_main_Load(EOS(STATIC_628), i127, i113)
628_0_main_Load(EOS(STATIC_628), i127, i113) → 582_0_main_Load(EOS(STATIC_582), i127, i113)
582_0_main_Load(EOS(STATIC_582), i113, i114) → 586_0_main_LE(EOS(STATIC_586), i113, i114, i114)
R rules:
Combined rules. Obtained 1 conditional rules for P and 0 conditional rules for R.
P rules:
586_0_main_LE(EOS(STATIC_586), x0, x1, x1) → 586_0_main_LE(EOS(STATIC_586), -(x1, 1), x0, x0) | >(x1, 0)
R rules:
Filtered ground terms:
586_0_main_LE(x1, x2, x3, x4) → 586_0_main_LE(x2, x3, x4)
EOS(x1) → EOS
Cond_586_0_main_LE(x1, x2, x3, x4, x5) → Cond_586_0_main_LE(x1, x3, x4, x5)
Filtered duplicate args:
586_0_main_LE(x1, x2, x3) → 586_0_main_LE(x1, x3)
Cond_586_0_main_LE(x1, x2, x3, x4) → Cond_586_0_main_LE(x1, x2, x4)
Combined rules. Obtained 1 conditional rules for P and 0 conditional rules for R.
P rules:
586_0_main_LE(x0, x1) → 586_0_main_LE(-(x1, 1), x0) | >(x1, 0)
R rules:
Finished conversion. Obtained 2 rules for P and 0 rules for R. System has predefined symbols.
P rules:
586_0_MAIN_LE(x0, x1) → COND_586_0_MAIN_LE(>(x1, 0), x0, x1)
COND_586_0_MAIN_LE(TRUE, x0, x1) → 586_0_MAIN_LE(-(x1, 1), x0)
R rules:
!= | ~ | 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 (x1[0] > 0 ∧x0[0] →* x0[1]∧x1[0] →* x1[1])
(1) -> (0), if (x1[1] - 1 →* x0[0]∧x0[1] →* x1[0])
(1) (>(x1[0], 0)=TRUE∧x0[0]=x0[1]∧x1[0]=x1[1] ⇒ 586_0_MAIN_LE(x0[0], x1[0])≥NonInfC∧586_0_MAIN_LE(x0[0], x1[0])≥COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])∧(UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥))
(2) (>(x1[0], 0)=TRUE ⇒ 586_0_MAIN_LE(x0[0], x1[0])≥NonInfC∧586_0_MAIN_LE(x0[0], x1[0])≥COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])∧(UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥))
(3) (x1[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥)∧[(-1)bni_11 + (-1)Bound*bni_11] + [bni_11]x1[0] + [bni_11]x0[0] ≥ 0∧[(-1)bso_12] ≥ 0)
(4) (x1[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥)∧[(-1)bni_11 + (-1)Bound*bni_11] + [bni_11]x1[0] + [bni_11]x0[0] ≥ 0∧[(-1)bso_12] ≥ 0)
(5) (x1[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥)∧[(-1)bni_11 + (-1)Bound*bni_11] + [bni_11]x1[0] + [bni_11]x0[0] ≥ 0∧[(-1)bso_12] ≥ 0)
(6) (x1[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥)∧[bni_11] = 0∧[(-1)bni_11 + (-1)Bound*bni_11] + [bni_11]x1[0] ≥ 0∧0 = 0∧[(-1)bso_12] ≥ 0)
(7) (x1[0] ≥ 0 ⇒ (UIncreasing(COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥)∧[bni_11] = 0∧[(-1)Bound*bni_11] + [bni_11]x1[0] ≥ 0∧0 = 0∧[(-1)bso_12] ≥ 0)
(8) (>(x1[0], 0)=TRUE∧x0[0]=x0[1]∧x1[0]=x1[1]∧-(x1[1], 1)=x0[0]1∧x0[1]=x1[0]1∧>(x1[0]1, 0)=TRUE∧x0[0]1=x0[1]1∧x1[0]1=x1[1]1∧-(x1[1]1, 1)=x0[0]2∧x0[1]1=x1[0]2∧>(x1[0]2, 0)=TRUE∧x0[0]2=x0[1]2∧x1[0]2=x1[1]2 ⇒ COND_586_0_MAIN_LE(TRUE, x0[1]1, x1[1]1)≥NonInfC∧COND_586_0_MAIN_LE(TRUE, x0[1]1, x1[1]1)≥586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)∧(UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥))
(9) (>(x1[0], 0)=TRUE∧>(x1[0]1, 0)=TRUE∧>(-(x1[0], 1), 0)=TRUE ⇒ COND_586_0_MAIN_LE(TRUE, -(x1[0], 1), x1[0]1)≥NonInfC∧COND_586_0_MAIN_LE(TRUE, -(x1[0], 1), x1[0]1)≥586_0_MAIN_LE(-(x1[0]1, 1), -(x1[0], 1))∧(UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥))
(10) (x1[0] + [-1] ≥ 0∧x1[0]1 + [-1] ≥ 0∧x1[0] + [-2] ≥ 0 ⇒ (UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥)∧[(-2)bni_13 + (-1)Bound*bni_13] + [bni_13]x1[0]1 + [bni_13]x1[0] ≥ 0∧[1 + (-1)bso_14] ≥ 0)
(11) (x1[0] + [-1] ≥ 0∧x1[0]1 + [-1] ≥ 0∧x1[0] + [-2] ≥ 0 ⇒ (UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥)∧[(-2)bni_13 + (-1)Bound*bni_13] + [bni_13]x1[0]1 + [bni_13]x1[0] ≥ 0∧[1 + (-1)bso_14] ≥ 0)
(12) (x1[0] + [-1] ≥ 0∧x1[0]1 + [-1] ≥ 0∧x1[0] + [-2] ≥ 0 ⇒ (UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥)∧[(-2)bni_13 + (-1)Bound*bni_13] + [bni_13]x1[0]1 + [bni_13]x1[0] ≥ 0∧[1 + (-1)bso_14] ≥ 0)
(13) (x1[0] ≥ 0∧x1[0]1 + [-1] ≥ 0∧[-1] + x1[0] ≥ 0 ⇒ (UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥)∧[(-1)bni_13 + (-1)Bound*bni_13] + [bni_13]x1[0]1 + [bni_13]x1[0] ≥ 0∧[1 + (-1)bso_14] ≥ 0)
(14) ([1] + x1[0] ≥ 0∧x1[0]1 + [-1] ≥ 0∧x1[0] ≥ 0 ⇒ (UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥)∧[(-1)Bound*bni_13] + [bni_13]x1[0]1 + [bni_13]x1[0] ≥ 0∧[1 + (-1)bso_14] ≥ 0)
(15) ([1] + x1[0] ≥ 0∧x1[0]1 ≥ 0∧x1[0] ≥ 0 ⇒ (UIncreasing(586_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)), ≥)∧[bni_13 + (-1)Bound*bni_13] + [bni_13]x1[0]1 + [bni_13]x1[0] ≥ 0∧[1 + (-1)bso_14] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(586_0_MAIN_LE(x1, x2)) = [-1] + x2 + x1
POL(COND_586_0_MAIN_LE(x1, x2, x3)) = [-1] + x3 + x2
POL(>(x1, x2)) = [-1]
POL(0) = 0
POL(-(x1, x2)) = x1 + [-1]x2
POL(1) = [1]
COND_586_0_MAIN_LE(TRUE, x0[1], x1[1]) → 586_0_MAIN_LE(-(x1[1], 1), x0[1])
COND_586_0_MAIN_LE(TRUE, x0[1], x1[1]) → 586_0_MAIN_LE(-(x1[1], 1), x0[1])
586_0_MAIN_LE(x0[0], x1[0]) → COND_586_0_MAIN_LE(>(x1[0], 0), x0[0], 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 |
Integer