0 JBC
↳1 JBC2FIG (⇐)
↳2 FIGraph
↳3 FIGtoITRSProof (⇐)
↳4 ITRS
↳5 ITRStoIDPProof (⇔)
↳6 IDP
↳7 UsableRulesProof (⇔)
↳8 IDP
↳9 IDPNonInfProof (⇐)
↳10 AND
↳11 IDP
↳12 IDependencyGraphProof (⇔)
↳13 TRUE
↳14 IDP
↳15 IDependencyGraphProof (⇔)
↳16 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 PastaB8 {
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
if (x > 0) {
while (x != 0) {
if (x % 2 == 0) {
x = x/2;
} else {
x--;
}
}
}
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
!= | ~ | 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 |
!= | ~ | 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 ((i72[0] > 0 && 0 = i72[0] % 2 →* TRUE)∧(i72[0] →* i72[1]))
(1) -> (0), if ((i72[1] / 2 →* i72[0]))
(1) -> (2), if ((i72[1] / 2 →* i72[2]))
(2) -> (3), if ((i72[2] % 2 > 0 && i72[2] > 0 →* TRUE)∧(i72[2] →* i72[3]))
(3) -> (0), if ((i72[3] + -1 →* i72[0]))
(3) -> (2), if ((i72[3] + -1 →* i72[2]))
!= | ~ | 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 ((i72[0] > 0 && 0 = i72[0] % 2 →* TRUE)∧(i72[0] →* i72[1]))
(1) -> (0), if ((i72[1] / 2 →* i72[0]))
(1) -> (2), if ((i72[1] / 2 →* i72[2]))
(2) -> (3), if ((i72[2] % 2 > 0 && i72[2] > 0 →* TRUE)∧(i72[2] →* i72[3]))
(3) -> (0), if ((i72[3] + -1 →* i72[0]))
(3) -> (2), if ((i72[3] + -1 →* i72[2]))
(1) (&&(>(i72[0], 0), =(0, %(i72[0], 2)))=TRUE∧i72[0]=i72[1] ⇒ LOAD644(i72[0])≥NonInfC∧LOAD644(i72[0])≥COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])∧(UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥))
(2) (>(i72[0], 0)=TRUE∧>=(0, %(i72[0], 2))=TRUE∧<=(0, %(i72[0], 2))=TRUE ⇒ LOAD644(i72[0])≥NonInfC∧LOAD644(i72[0])≥COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])∧(UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥))
(3) (i72[0] + [-1] ≥ 0∧[-1]min{[2], [-2]} ≥ 0∧max{[2], [-2]} ≥ 0 ⇒ (UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥)∧[(-1)bni_14 + (-1)Bound*bni_14] + [bni_14]i72[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(4) (i72[0] + [-1] ≥ 0∧[-1]min{[2], [-2]} ≥ 0∧max{[2], [-2]} ≥ 0 ⇒ (UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥)∧[(-1)bni_14 + (-1)Bound*bni_14] + [bni_14]i72[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(5) (i72[0] + [-1] ≥ 0∧[4] ≥ 0∧[2] ≥ 0∧[2] ≥ 0 ⇒ (UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥)∧[(-1)bni_14 + (-1)Bound*bni_14] + [bni_14]i72[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(6) (i72[0] ≥ 0∧[4] ≥ 0∧[2] ≥ 0∧[2] ≥ 0 ⇒ (UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥)∧[(-1)Bound*bni_14] + [bni_14]i72[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(7) (i72[0] ≥ 0∧[1] ≥ 0∧[1] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])), ≥)∧[(-1)Bound*bni_14] + [bni_14]i72[0] ≥ 0∧[(-1)bso_15] ≥ 0)
(8) (&&(>(i72[0], 0), =(0, %(i72[0], 2)))=TRUE∧i72[0]=i72[1] ⇒ COND_LOAD644(TRUE, i72[1])≥NonInfC∧COND_LOAD644(TRUE, i72[1])≥LOAD644(/(i72[1], 2))∧(UIncreasing(LOAD644(/(i72[1], 2))), ≥))
(9) (>(i72[0], 0)=TRUE∧>=(0, %(i72[0], 2))=TRUE∧<=(0, %(i72[0], 2))=TRUE ⇒ COND_LOAD644(TRUE, i72[0])≥NonInfC∧COND_LOAD644(TRUE, i72[0])≥LOAD644(/(i72[0], 2))∧(UIncreasing(LOAD644(/(i72[1], 2))), ≥))
(10) (i72[0] + [-1] ≥ 0∧[-1]min{[2], [-2]} ≥ 0∧max{[2], [-2]} ≥ 0 ⇒ (UIncreasing(LOAD644(/(i72[1], 2))), ≥)∧[(-1)bni_16 + (-1)Bound*bni_16] + [bni_16]i72[0] ≥ 0∧[1 + (-1)bso_20] + i72[0] + [-1]max{i72[0], [-1]i72[0]} ≥ 0)
(11) (i72[0] + [-1] ≥ 0∧[-1]min{[2], [-2]} ≥ 0∧max{[2], [-2]} ≥ 0 ⇒ (UIncreasing(LOAD644(/(i72[1], 2))), ≥)∧[(-1)bni_16 + (-1)Bound*bni_16] + [bni_16]i72[0] ≥ 0∧[1 + (-1)bso_20] + i72[0] + [-1]max{i72[0], [-1]i72[0]} ≥ 0)
(12) (i72[0] + [-1] ≥ 0∧[4] ≥ 0∧[2] ≥ 0∧[2] ≥ 0∧[2]i72[0] ≥ 0 ⇒ (UIncreasing(LOAD644(/(i72[1], 2))), ≥)∧[(-1)bni_16 + (-1)Bound*bni_16] + [bni_16]i72[0] ≥ 0∧[1 + (-1)bso_20] ≥ 0)
(13) (i72[0] ≥ 0∧[4] ≥ 0∧[2] ≥ 0∧[2] ≥ 0∧[2] + [2]i72[0] ≥ 0 ⇒ (UIncreasing(LOAD644(/(i72[1], 2))), ≥)∧[(-1)Bound*bni_16] + [bni_16]i72[0] ≥ 0∧[1 + (-1)bso_20] ≥ 0)
(14) (i72[0] ≥ 0∧[1] ≥ 0∧[1] ≥ 0∧[1] ≥ 0∧[1] + i72[0] ≥ 0 ⇒ (UIncreasing(LOAD644(/(i72[1], 2))), ≥)∧[(-1)Bound*bni_16] + [bni_16]i72[0] ≥ 0∧[1 + (-1)bso_20] ≥ 0)
(15) (&&(>(%(i72[2], 2), 0), >(i72[2], 0))=TRUE∧i72[2]=i72[3] ⇒ LOAD644(i72[2])≥NonInfC∧LOAD644(i72[2])≥COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])∧(UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥))
(16) (>(%(i72[2], 2), 0)=TRUE∧>(i72[2], 0)=TRUE ⇒ LOAD644(i72[2])≥NonInfC∧LOAD644(i72[2])≥COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])∧(UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥))
(17) (max{[2], [-2]} + [-1] ≥ 0∧i72[2] + [-1] ≥ 0 ⇒ (UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]i72[2] ≥ 0∧[(-1)bso_22] ≥ 0)
(18) (max{[2], [-2]} + [-1] ≥ 0∧i72[2] + [-1] ≥ 0 ⇒ (UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]i72[2] ≥ 0∧[(-1)bso_22] ≥ 0)
(19) (i72[2] + [-1] ≥ 0∧[4] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥)∧[(-1)bni_21 + (-1)Bound*bni_21] + [bni_21]i72[2] ≥ 0∧[(-1)bso_22] ≥ 0)
(20) (i72[2] ≥ 0∧[4] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥)∧[(-1)Bound*bni_21] + [bni_21]i72[2] ≥ 0∧[(-1)bso_22] ≥ 0)
(21) (i72[2] ≥ 0∧[1] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])), ≥)∧[(-1)Bound*bni_21] + [bni_21]i72[2] ≥ 0∧[(-1)bso_22] ≥ 0)
(22) (&&(>(%(i72[2], 2), 0), >(i72[2], 0))=TRUE∧i72[2]=i72[3]∧+(i72[3], -1)=i72[0] ⇒ COND_LOAD6441(TRUE, i72[3])≥NonInfC∧COND_LOAD6441(TRUE, i72[3])≥LOAD644(+(i72[3], -1))∧(UIncreasing(LOAD644(+(i72[3], -1))), ≥))
(23) (>(%(i72[2], 2), 0)=TRUE∧>(i72[2], 0)=TRUE ⇒ COND_LOAD6441(TRUE, i72[2])≥NonInfC∧COND_LOAD6441(TRUE, i72[2])≥LOAD644(+(i72[2], -1))∧(UIncreasing(LOAD644(+(i72[3], -1))), ≥))
(24) (max{[2], [-2]} + [-1] ≥ 0∧i72[2] + [-1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(25) (max{[2], [-2]} + [-1] ≥ 0∧i72[2] + [-1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(26) (i72[2] + [-1] ≥ 0∧[4] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(27) (i72[2] ≥ 0∧[4] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(28) (i72[2] ≥ 0∧[1] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(29) (&&(>(%(i72[2], 2), 0), >(i72[2], 0))=TRUE∧i72[2]=i72[3]∧+(i72[3], -1)=i72[2]1 ⇒ COND_LOAD6441(TRUE, i72[3])≥NonInfC∧COND_LOAD6441(TRUE, i72[3])≥LOAD644(+(i72[3], -1))∧(UIncreasing(LOAD644(+(i72[3], -1))), ≥))
(30) (>(%(i72[2], 2), 0)=TRUE∧>(i72[2], 0)=TRUE ⇒ COND_LOAD6441(TRUE, i72[2])≥NonInfC∧COND_LOAD6441(TRUE, i72[2])≥LOAD644(+(i72[2], -1))∧(UIncreasing(LOAD644(+(i72[3], -1))), ≥))
(31) (max{[2], [-2]} + [-1] ≥ 0∧i72[2] + [-1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(32) (max{[2], [-2]} + [-1] ≥ 0∧i72[2] + [-1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(33) (i72[2] + [-1] ≥ 0∧[4] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)bni_23 + (-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(34) (i72[2] ≥ 0∧[4] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
(35) (i72[2] ≥ 0∧[1] ≥ 0∧[1] ≥ 0 ⇒ (UIncreasing(LOAD644(+(i72[3], -1))), ≥)∧[(-1)Bound*bni_23] + [bni_23]i72[2] ≥ 0∧[1 + (-1)bso_24] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = [3]
POL(LOAD644(x1)) = [-1] + x1
POL(COND_LOAD644(x1, x2)) = [-1] + x2
POL(&&(x1, x2)) = [-1]
POL(>(x1, x2)) = [-1]
POL(0) = 0
POL(=(x1, x2)) = [-1]
POL(2) = [2]
POL(COND_LOAD6441(x1, x2)) = [-1] + x2
POL(+(x1, x2)) = x1 + x2
POL(-1) = [-1]
Polynomial Interpretations with Context Sensitive Arithemetic Replacement
POL(TermCSAR-Mode @ Context)
POL(%(x1, 2)-1 @ {}) = min{x2, [-1]x2}
POL(%(x1, 2)1 @ {}) = max{x2, [-1]x2}
POL(/(x1, 2)1 @ {LOAD644_1/0}) = max{x1, [-1]x1} + [-1]
COND_LOAD644(TRUE, i72[1]) → LOAD644(/(i72[1], 2))
COND_LOAD6441(TRUE, i72[3]) → LOAD644(+(i72[3], -1))
LOAD644(i72[0]) → COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])
COND_LOAD644(TRUE, i72[1]) → LOAD644(/(i72[1], 2))
LOAD644(i72[2]) → COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])
COND_LOAD6441(TRUE, i72[3]) → LOAD644(+(i72[3], -1))
LOAD644(i72[0]) → COND_LOAD644(&&(>(i72[0], 0), =(0, %(i72[0], 2))), i72[0])
LOAD644(i72[2]) → COND_LOAD6441(&&(>(%(i72[2], 2), 0), >(i72[2], 0)), i72[2])
FALSE1 → &&(FALSE, FALSE)1
/1 →
!= | ~ | 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 |