0 JBC
↳1 JBCToGraph (⇒, 450 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIDPv1Proof (⇒, 20 ms)
↳6 IDP
↳7 IDPNonInfProof (⇒, 500 ms)
↳8 IDP
↳9 IDependencyGraphProof (⇔, 0 ms)
↳10 TRUE
/**
* Example taken from "A Term Rewriting Approach to the Automated Termination
* Analysis of Imperative Programs" (http://www.cs.unm.edu/~spf/papers/2009-02.pdf)
* and converted to Java.
*/
public class PastaC7 {
public static void main(String[] args) {
Random.args = args;
int i = Random.random();
int j = Random.random();
int k = Random.random();
while (i <= 100 && j <= k) {
int t = i;
i = j;
j = i + 1;
k--;
}
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
Generated 19 rules for P and 0 rules for R.
P rules:
899_0_main_ConstantStackPush(EOS(STATIC_899), i198, i199, i200, i198) → 901_0_main_GT(EOS(STATIC_901), i198, i199, i200, i198, 100)
901_0_main_GT(EOS(STATIC_901), i208, i199, i200, i208, matching1) → 904_0_main_GT(EOS(STATIC_904), i208, i199, i200, i208, 100) | =(matching1, 100)
904_0_main_GT(EOS(STATIC_904), i208, i199, i200, i208, matching1) → 907_0_main_Load(EOS(STATIC_907), i208, i199, i200) | &&(<=(i208, 100), =(matching1, 100))
907_0_main_Load(EOS(STATIC_907), i208, i199, i200) → 910_0_main_Load(EOS(STATIC_910), i208, i199, i200, i199)
910_0_main_Load(EOS(STATIC_910), i208, i199, i200, i199) → 915_0_main_GT(EOS(STATIC_915), i208, i199, i200, i199, i200)
915_0_main_GT(EOS(STATIC_915), i208, i199, i200, i199, i200) → 918_0_main_GT(EOS(STATIC_918), i208, i199, i200, i199, i200)
918_0_main_GT(EOS(STATIC_918), i208, i199, i200, i199, i200) → 925_0_main_Load(EOS(STATIC_925), i208, i199, i200) | <=(i199, i200)
925_0_main_Load(EOS(STATIC_925), i208, i199, i200) → 928_0_main_Store(EOS(STATIC_928), i199, i200, i208)
928_0_main_Store(EOS(STATIC_928), i199, i200, i208) → 931_0_main_Load(EOS(STATIC_931), i199, i200)
931_0_main_Load(EOS(STATIC_931), i199, i200) → 932_0_main_Store(EOS(STATIC_932), i200, i199)
932_0_main_Store(EOS(STATIC_932), i200, i199) → 934_0_main_Load(EOS(STATIC_934), i199, i200)
934_0_main_Load(EOS(STATIC_934), i199, i200) → 936_0_main_ConstantStackPush(EOS(STATIC_936), i199, i200, i199)
936_0_main_ConstantStackPush(EOS(STATIC_936), i199, i200, i199) → 938_0_main_IntArithmetic(EOS(STATIC_938), i199, i200, i199, 1)
938_0_main_IntArithmetic(EOS(STATIC_938), i199, i200, i199, matching1) → 940_0_main_Store(EOS(STATIC_940), i199, i200, +(i199, 1)) | =(matching1, 1)
940_0_main_Store(EOS(STATIC_940), i199, i200, i212) → 942_0_main_Inc(EOS(STATIC_942), i199, i212, i200)
942_0_main_Inc(EOS(STATIC_942), i199, i212, i200) → 944_0_main_JMP(EOS(STATIC_944), i199, i212, +(i200, -1))
944_0_main_JMP(EOS(STATIC_944), i199, i212, i213) → 961_0_main_Load(EOS(STATIC_961), i199, i212, i213)
961_0_main_Load(EOS(STATIC_961), i199, i212, i213) → 896_0_main_Load(EOS(STATIC_896), i199, i212, i213)
896_0_main_Load(EOS(STATIC_896), i198, i199, i200) → 899_0_main_ConstantStackPush(EOS(STATIC_899), i198, i199, i200, i198)
R rules:
Combined rules. Obtained 1 conditional rules for P and 0 conditional rules for R.
P rules:
899_0_main_ConstantStackPush(EOS(STATIC_899), x0, x1, x2, x0) → 899_0_main_ConstantStackPush(EOS(STATIC_899), x1, +(x1, 1), +(x2, -1), x1) | &&(>=(x2, x1), <=(x0, 100))
R rules:
Filtered ground terms:
899_0_main_ConstantStackPush(x1, x2, x3, x4, x5) → 899_0_main_ConstantStackPush(x2, x3, x4, x5)
EOS(x1) → EOS
Cond_899_0_main_ConstantStackPush(x1, x2, x3, x4, x5, x6) → Cond_899_0_main_ConstantStackPush(x1, x3, x4, x5, x6)
Filtered duplicate args:
899_0_main_ConstantStackPush(x1, x2, x3, x4) → 899_0_main_ConstantStackPush(x2, x3, x4)
Cond_899_0_main_ConstantStackPush(x1, x2, x3, x4, x5) → Cond_899_0_main_ConstantStackPush(x1, x3, x4, x5)
Filtered unneeded arguments:
Cond_899_0_main_ConstantStackPush(x1, x2, x3, x4) → Cond_899_0_main_ConstantStackPush(x1, x2, x3)
Combined rules. Obtained 1 conditional rules for P and 0 conditional rules for R.
P rules:
899_0_main_ConstantStackPush(x1, x2, x0) → 899_0_main_ConstantStackPush(+(x1, 1), +(x2, -1), x1) | &&(>=(x2, x1), <=(x0, 100))
R rules:
Finished conversion. Obtained 2 rules for P and 0 rules for R. System has predefined symbols.
P rules:
899_0_MAIN_CONSTANTSTACKPUSH(x1, x2, x0) → COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2, x1), <=(x0, 100)), x1, x2, x0)
COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1, x2, x0) → 899_0_MAIN_CONSTANTSTACKPUSH(+(x1, 1), +(x2, -1), x1)
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 |
Boolean, Integer
(0) -> (1), if (x2[0] >= x1[0] && x0[0] <= 100 ∧x1[0] →* x1[1]∧x2[0] →* x2[1]∧x0[0] →* x0[1])
(1) -> (0), if (x1[1] + 1 →* x1[0]∧x2[1] + -1 →* x2[0]∧x1[1] →* x0[0])
(1) (&&(>=(x2[0], x1[0]), <=(x0[0], 100))=TRUE∧x1[0]=x1[1]∧x2[0]=x2[1]∧x0[0]=x0[1] ⇒ 899_0_MAIN_CONSTANTSTACKPUSH(x1[0], x2[0], x0[0])≥NonInfC∧899_0_MAIN_CONSTANTSTACKPUSH(x1[0], x2[0], x0[0])≥COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])∧(UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥))
(2) (>=(x2[0], x1[0])=TRUE∧<=(x0[0], 100)=TRUE ⇒ 899_0_MAIN_CONSTANTSTACKPUSH(x1[0], x2[0], x0[0])≥NonInfC∧899_0_MAIN_CONSTANTSTACKPUSH(x1[0], x2[0], x0[0])≥COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])∧(UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥))
(3) (x2[0] + [-1]x1[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] + [(-1)bni_15]x1[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(4) (x2[0] + [-1]x1[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] + [(-1)bni_15]x1[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(5) (x2[0] + [-1]x1[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] + [(-1)bni_15]x1[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(6) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(7) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(8) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(9) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(10) (x2[0] ≥ 0∧[100] + x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(11) (x2[0] ≥ 0∧[100] + x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(12) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])), ≥)∧[(-1)Bound*bni_15] + [bni_15]x2[0] ≥ 0∧[1 + (-1)bso_16] ≥ 0)
(13) (&&(>=(x2[0], x1[0]), <=(x0[0], 100))=TRUE∧x1[0]=x1[1]∧x2[0]=x2[1]∧x0[0]=x0[1]∧+(x1[1], 1)=x1[0]1∧+(x2[1], -1)=x2[0]1∧x1[1]=x0[0]1 ⇒ COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1[1], x2[1], x0[1])≥NonInfC∧COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1[1], x2[1], x0[1])≥899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])∧(UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥))
(14) (>=(x2[0], x1[0])=TRUE∧<=(x0[0], 100)=TRUE ⇒ COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1[0], x2[0], x0[0])≥NonInfC∧COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1[0], x2[0], x0[0])≥899_0_MAIN_CONSTANTSTACKPUSH(+(x1[0], 1), +(x2[0], -1), x1[0])∧(UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥))
(15) (x2[0] + [-1]x1[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] + [(-1)bni_17]x1[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(16) (x2[0] + [-1]x1[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] + [(-1)bni_17]x1[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(17) (x2[0] + [-1]x1[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] + [(-1)bni_17]x1[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(18) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(19) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(20) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(21) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(22) (x2[0] ≥ 0∧[100] + x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(23) (x2[0] ≥ 0∧[100] + x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
(24) (x2[0] ≥ 0∧[100] + [-1]x0[0] ≥ 0∧x1[0] ≥ 0∧x0[0] ≥ 0 ⇒ (UIncreasing(899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])), ≥)∧[(-1)bni_17 + (-1)Bound*bni_17] + [bni_17]x2[0] ≥ 0∧[1 + (-1)bso_18] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(899_0_MAIN_CONSTANTSTACKPUSH(x1, x2, x3)) = x2 + [-1]x1
POL(COND_899_0_MAIN_CONSTANTSTACKPUSH(x1, x2, x3, x4)) = [-1] + x3 + [-1]x2 + [-1]x1
POL(&&(x1, x2)) = 0
POL(>=(x1, x2)) = [-1]
POL(<=(x1, x2)) = [-1]
POL(100) = [100]
POL(+(x1, x2)) = x1 + x2
POL(1) = [1]
POL(-1) = [-1]
899_0_MAIN_CONSTANTSTACKPUSH(x1[0], x2[0], x0[0]) → COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])
COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1[1], x2[1], x0[1]) → 899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])
899_0_MAIN_CONSTANTSTACKPUSH(x1[0], x2[0], x0[0]) → COND_899_0_MAIN_CONSTANTSTACKPUSH(&&(>=(x2[0], x1[0]), <=(x0[0], 100)), x1[0], x2[0], x0[0])
COND_899_0_MAIN_CONSTANTSTACKPUSH(TRUE, x1[1], x2[1], x0[1]) → 899_0_MAIN_CONSTANTSTACKPUSH(+(x1[1], 1), +(x2[1], -1), x1[1])
&&(TRUE, TRUE)1 ↔ TRUE1
&&(TRUE, FALSE)1 ↔ FALSE1
&&(FALSE, TRUE)1 ↔ FALSE1
&&(FALSE, FALSE)1 ↔ FALSE1
!= | ~ | 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 |