0 JBC
↳1 JBCToGraph (⇒, 320 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 30 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 180 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:
622_0_main_LE(EOS(STATIC_622), i118, i129, i129) → 625_0_main_LE(EOS(STATIC_625), i118, i129, i129)
625_0_main_LE(EOS(STATIC_625), i118, i129, i129) → 629_0_main_Load(EOS(STATIC_629), i118, i129) | >(i129, 0)
629_0_main_Load(EOS(STATIC_629), i118, i129) → 633_0_main_Store(EOS(STATIC_633), i129, i118)
633_0_main_Store(EOS(STATIC_633), i129, i118) → 637_0_main_Load(EOS(STATIC_637), i129, i118)
637_0_main_Load(EOS(STATIC_637), i129, i118) → 642_0_main_ConstantStackPush(EOS(STATIC_642), i118, i129)
642_0_main_ConstantStackPush(EOS(STATIC_642), i118, i129) → 646_0_main_IntArithmetic(EOS(STATIC_646), i118, i129, 1)
646_0_main_IntArithmetic(EOS(STATIC_646), i118, i129, matching1) → 650_0_main_Store(EOS(STATIC_650), i118, -(i129, 1)) | &&(>(i129, 0), =(matching1, 1))
650_0_main_Store(EOS(STATIC_650), i118, i133) → 652_0_main_Load(EOS(STATIC_652), i133, i118)
652_0_main_Load(EOS(STATIC_652), i133, i118) → 654_0_main_Store(EOS(STATIC_654), i133, i118)
654_0_main_Store(EOS(STATIC_654), i133, i118) → 656_0_main_Inc(EOS(STATIC_656), i133, i118)
656_0_main_Inc(EOS(STATIC_656), i133, i118) → 658_0_main_JMP(EOS(STATIC_658), i133, i118)
658_0_main_JMP(EOS(STATIC_658), i133, i118) → 675_0_main_Load(EOS(STATIC_675), i133, i118)
675_0_main_Load(EOS(STATIC_675), i133, i118) → 618_0_main_Load(EOS(STATIC_618), i133, i118)
618_0_main_Load(EOS(STATIC_618), i118, i119) → 622_0_main_LE(EOS(STATIC_622), i118, i119, i119)
R rules:
Combined rules. Obtained 1 conditional rules for P and 0 conditional rules for R.
P rules:
622_0_main_LE(EOS(STATIC_622), x0, x1, x1) → 622_0_main_LE(EOS(STATIC_622), -(x1, 1), x0, x0) | >(x1, 0)
R rules:
Filtered ground terms:
622_0_main_LE(x1, x2, x3, x4) → 622_0_main_LE(x2, x3, x4)
EOS(x1) → EOS
Cond_622_0_main_LE(x1, x2, x3, x4, x5) → Cond_622_0_main_LE(x1, x3, x4, x5)
Filtered duplicate args:
622_0_main_LE(x1, x2, x3) → 622_0_main_LE(x1, x3)
Cond_622_0_main_LE(x1, x2, x3, x4) → Cond_622_0_main_LE(x1, x2, x4)
Combined rules. Obtained 1 conditional rules for P and 0 conditional rules for R.
P rules:
622_0_main_LE(x0, x1) → 622_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:
622_0_MAIN_LE(x0, x1) → COND_622_0_MAIN_LE(>(x1, 0), x0, x1)
COND_622_0_MAIN_LE(TRUE, x0, x1) → 622_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] ⇒ 622_0_MAIN_LE(x0[0], x1[0])≥NonInfC∧622_0_MAIN_LE(x0[0], x1[0])≥COND_622_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])∧(UIncreasing(COND_622_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥))
(2) (>(x1[0], 0)=TRUE ⇒ 622_0_MAIN_LE(x0[0], x1[0])≥NonInfC∧622_0_MAIN_LE(x0[0], x1[0])≥COND_622_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])∧(UIncreasing(COND_622_0_MAIN_LE(>(x1[0], 0), x0[0], x1[0])), ≥))
(3) (x1[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_622_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_622_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_622_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_622_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_622_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_622_0_MAIN_LE(TRUE, x0[1]1, x1[1]1)≥NonInfC∧COND_622_0_MAIN_LE(TRUE, x0[1]1, x1[1]1)≥622_0_MAIN_LE(-(x1[1]1, 1), x0[1]1)∧(UIncreasing(622_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_622_0_MAIN_LE(TRUE, -(x1[0], 1), x1[0]1)≥NonInfC∧COND_622_0_MAIN_LE(TRUE, -(x1[0], 1), x1[0]1)≥622_0_MAIN_LE(-(x1[0]1, 1), -(x1[0], 1))∧(UIncreasing(622_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(622_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(622_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(622_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(622_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(622_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(622_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(622_0_MAIN_LE(x1, x2)) = [-1] + x2 + x1
POL(COND_622_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_622_0_MAIN_LE(TRUE, x0[1], x1[1]) → 622_0_MAIN_LE(-(x1[1], 1), x0[1])
COND_622_0_MAIN_LE(TRUE, x0[1], x1[1]) → 622_0_MAIN_LE(-(x1[1], 1), x0[1])
622_0_MAIN_LE(x0[0], x1[0]) → COND_622_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