Initial Problem
Start: l0
Program_Vars: X₀, X₁
Temp_Vars:
Locations: l0, l1, l2, l3, l4, l5
Transitions:
t₀: l0(X₀, X₁) → l2(X₀, X₁)
t₂: l1(X₀, X₁) → l3(X₀, X₁) :|: X₀ < 0
t₃: l1(X₀, X₁) → l3(X₀, X₁) :|: 0 < X₀
t₄: l1(X₀, X₁) → l4(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀
t₁: l2(X₀, X₁) → l1(X₁, X₁)
t₅: l3(X₀, X₁) → l1(X₀-1, X₁) :|: 0 < X₀
t₆: l3(X₀, X₁) → l1(X₀+1, X₁) :|: X₀ ≤ 0
t₇: l4(X₀, X₁) → l5(X₀, X₁)
Preprocessing
Found invariant X₀ ≤ 0 ∧ 0 ≤ X₀ for location l5
Found invariant X₀ ≤ 0 ∧ 0 ≤ X₀ for location l4
Problem after Preprocessing
Start: l0
Program_Vars: X₀, X₁
Temp_Vars:
Locations: l0, l1, l2, l3, l4, l5
Transitions:
t₀: l0(X₀, X₁) → l2(X₀, X₁)
t₂: l1(X₀, X₁) → l3(X₀, X₁) :|: X₀ < 0
t₃: l1(X₀, X₁) → l3(X₀, X₁) :|: 0 < X₀
t₄: l1(X₀, X₁) → l4(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀
t₁: l2(X₀, X₁) → l1(X₁, X₁)
t₅: l3(X₀, X₁) → l1(X₀-1, X₁) :|: 0 < X₀
t₆: l3(X₀, X₁) → l1(X₀+1, X₁) :|: X₀ ≤ 0
t₇: l4(X₀, X₁) → l5(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀
MPRF for transition t₂: l1(X₀, X₁) → l3(X₀, X₁) :|: X₀ < 0 of depth 1:
new bound:
X₁ {O(n)}
MPRF for transition t₆: l3(X₀, X₁) → l1(X₀+1, X₁) :|: X₀ ≤ 0 of depth 1:
new bound:
X₁+1 {O(n)}
TWN: t₃: l1→l3
cycle: [t₂: l1→l3; t₃: l1→l3; t₅: l3→l1]
loop: (X₀ < 0 ∧ 0 < X₀ ∨ 0 < X₀ ∧ 0 < X₀,(X₀) -> (X₀-1)
order: [X₀]
closed-form:
X₀: X₀ + [[n != 0]] * -1 * n^1
Termination: true
Formula:
1 < 0 ∧ 0 < 1
∨ 1 < 0 ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1 ∧ 0 < 1
∨ 0 < X₀ ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 1 < 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1
Stabilization-Threshold for: 0 < X₀
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
Stabilization-Threshold for: X₀ < 0
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
loop: (X₀ < 0 ∧ 0 < X₀ ∨ 0 < X₀ ∧ 0 < X₀,(X₀) -> (X₀-1)
order: [X₀]
closed-form:
X₀: X₀ + [[n != 0]] * -1 * n^1
Termination: true
Formula:
1 < 0 ∧ 0 < 1
∨ 1 < 0 ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1 ∧ 0 < 1
∨ 0 < X₀ ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 1 < 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1
Stabilization-Threshold for: 0 < X₀
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
Stabilization-Threshold for: X₀ < 0
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
loop: (X₀ < 0 ∧ 0 < X₀ ∨ 0 < X₀ ∧ 0 < X₀,(X₀) -> (X₀-1)
order: [X₀]
closed-form:
X₀: X₀ + [[n != 0]] * -1 * n^1
Termination: true
Formula:
1 < 0 ∧ 0 < 1
∨ 1 < 0 ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1 ∧ 0 < 1
∨ 0 < X₀ ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 1 < 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1
Stabilization-Threshold for: 0 < X₀
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
Stabilization-Threshold for: X₀ < 0
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
loop: (X₀ < 0 ∧ 0 < X₀ ∨ 0 < X₀ ∧ 0 < X₀,(X₀) -> (X₀-1)
order: [X₀]
closed-form:
X₀: X₀ + [[n != 0]] * -1 * n^1
Termination: true
Formula:
1 < 0 ∧ 0 < 1
∨ 1 < 0 ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1 ∧ 0 < 1
∨ 0 < X₀ ∧ X₀ < 0 ∧ 0 ≤ 1 ∧ 1 ≤ 0
∨ 1 < 0
∨ 0 < X₀ ∧ 1 ≤ 0 ∧ 0 ≤ 1
Stabilization-Threshold for: 0 < X₀
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
Stabilization-Threshold for: X₀ < 0
alphas_abs: X₀
M: 0
N: 1
Bound: 2⋅X₀+2 {O(n)}
TWN - Lifting for t₃: l1→l3 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₆:
X₀: X₁+1 {O(n)}
Runtime-bound of t₆: X₁+1 {O(n)}
Results in: 4⋅X₁⋅X₁+14⋅X₁+10 {O(n^2)}
TWN - Lifting for t₃: l1→l3 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₁:
X₀: X₁ {O(n)}
Runtime-bound of t₁: 1 {O(1)}
Results in: 4⋅X₁+6 {O(n)}
TWN - Lifting for t₃: l1→l3 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₆:
X₀: X₁+1 {O(n)}
Runtime-bound of t₆: X₁+1 {O(n)}
Results in: 4⋅X₁⋅X₁+14⋅X₁+10 {O(n^2)}
TWN - Lifting for t₃: l1→l3 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₁:
X₀: X₁ {O(n)}
Runtime-bound of t₁: 1 {O(1)}
Results in: 4⋅X₁+6 {O(n)}
TWN: t₅: l3→l1
TWN - Lifting for t₅: l3→l1 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₆:
X₀: X₁+1 {O(n)}
Runtime-bound of t₆: X₁+1 {O(n)}
Results in: 4⋅X₁⋅X₁+14⋅X₁+10 {O(n^2)}
TWN - Lifting for t₅: l3→l1 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₁:
X₀: X₁ {O(n)}
Runtime-bound of t₁: 1 {O(1)}
Results in: 4⋅X₁+6 {O(n)}
TWN - Lifting for t₅: l3→l1 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₆:
X₀: X₁+1 {O(n)}
Runtime-bound of t₆: X₁+1 {O(n)}
Results in: 4⋅X₁⋅X₁+14⋅X₁+10 {O(n^2)}
TWN - Lifting for t₅: l3→l1 of 4⋅X₀+6 {O(n)}
relevant size-bounds w.r.t. t₁:
X₀: X₁ {O(n)}
Runtime-bound of t₁: 1 {O(1)}
Results in: 4⋅X₁+6 {O(n)}
Chain transitions t₆: l3→l1 and t₄: l1→l4 to t₇₂: l3→l4
Chain transitions t₅: l3→l1 and t₄: l1→l4 to t₇₃: l3→l4
Chain transitions t₅: l3→l1 and t₃: l1→l3 to t₇₄: l3→l3
Chain transitions t₆: l3→l1 and t₃: l1→l3 to t₇₅: l3→l3
Chain transitions t₁: l2→l1 and t₃: l1→l3 to t₇₆: l2→l3
Chain transitions t₁: l2→l1 and t₄: l1→l4 to t₇₇: l2→l4
Chain transitions t₁: l2→l1 and t₂: l1→l3 to t₇₈: l2→l3
Chain transitions t₅: l3→l1 and t₂: l1→l3 to t₇₉: l3→l3
Chain transitions t₆: l3→l1 and t₂: l1→l3 to t₈₀: l3→l3
Analysing control-flow refined program
Cut unsatisfiable transition t₇₅: l3→l3
Cut unsatisfiable transition t₇₉: l3→l3
Found invariant X₀ ≤ 0 ∧ 0 ≤ X₀ for location l5
Found invariant X₀ ≤ 0 ∧ 0 ≤ X₀ for location l4
MPRF for transition t₇₄: l3(X₀, X₁) -{2}> l3(X₀-1, X₁) :|: 0 < X₀ ∧ 1 < X₀ of depth 1:
new bound:
X₁ {O(n)}
MPRF for transition t₈₀: l3(X₀, X₁) -{2}> l3(1+X₀, X₁) :|: X₀ ≤ 0 ∧ 1+X₀ < 0 of depth 1:
new bound:
X₁+1 {O(n)}
CFR did not improve the program. Rolling back
Analysing control-flow refined program
Cut unsatisfiable transition t₁₈₈: n_l1___2→n_l3___4
Cut unsatisfiable transition t₁₈₉: n_l1___5→n_l3___3
Cut unreachable locations [n_l3___3] from the program graph
Found invariant 2+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 3+X₀+X₁ ≤ 0 ∧ 1+X₀ ≤ 0 for location n_l3___4
Found invariant X₁ ≤ X₀ ∧ 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁ ∧ 1 ≤ X₀ for location n_l3___6
Found invariant 1 ≤ X₁ ∧ 1 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 0 ≤ X₀ for location n_l1___2
Found invariant X₀ ≤ 0 ∧ 0 ≤ X₀ for location l5
Found invariant 1+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 1+X₀+X₁ ≤ 0 ∧ X₀ ≤ 0 for location n_l1___5
Found invariant X₁ ≤ X₀ ∧ X₀ ≤ X₁ for location l1
Found invariant X₀ ≤ 0 ∧ 0 ≤ X₀ for location l4
Found invariant 2 ≤ X₁ ∧ 3 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 1 ≤ X₀ for location n_l3___1
Found invariant 1+X₁ ≤ 0 ∧ X₁ ≤ X₀ ∧ 2+X₀+X₁ ≤ 0 ∧ X₀ ≤ X₁ ∧ 1+X₀ ≤ 0 for location n_l3___7
MPRF for transition t₁₈₇: n_l1___2(X₀, X₁) → n_l3___1(X₀, X₁) :|: 0 < X₀ ∧ 1 ≤ X₁ ∧ 1 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 0 ≤ X₀ of depth 1:
new bound:
X₁+1 {O(n)}
MPRF for transition t₁₉₃: n_l3___1(X₀, X₁) → n_l1___2(X₀-1, X₁) :|: 0 < X₀ ∧ 0 < X₀ ∧ 2 ≤ X₁ ∧ 3 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 1 ≤ X₀ of depth 1:
new bound:
X₁ {O(n)}
MPRF for transition t₁₉₀: n_l1___5(X₀, X₁) → n_l3___4(X₀, X₁) :|: X₀ ≤ 1 ∧ X₀ < 0 ∧ 1+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 1+X₀+X₁ ≤ 0 ∧ X₀ ≤ 0 of depth 1:
new bound:
X₁+1 {O(n)}
MPRF for transition t₁₉₅: n_l3___4(X₀, X₁) → n_l1___5(X₀+1, X₁) :|: X₀ < 0 ∧ X₀ ≤ 0 ∧ 2+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 3+X₀+X₁ ≤ 0 ∧ 1+X₀ ≤ 0 of depth 1:
new bound:
X₁+1 {O(n)}
CFR did not improve the program. Rolling back
CFR: Improvement to new bound with the following program:
new bound:
4⋅X₁+3 {O(n)}
cfr-program:
Start: l0
Program_Vars: X₀, X₁
Temp_Vars:
Locations: l0, l1, l2, l4, l5, n_l1___2, n_l1___5, n_l3___1, n_l3___4, n_l3___6, n_l3___7
Transitions:
t₀: l0(X₀, X₁) → l2(X₀, X₁)
t₄: l1(X₀, X₁) → l4(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀ ∧ X₁ ≤ X₀ ∧ X₀ ≤ X₁
t₁₉₁: l1(X₀, X₁) → n_l3___6(X₀, X₁) :|: X₀ ≤ X₁ ∧ X₁ ≤ X₀ ∧ 0 < X₀ ∧ X₁ ≤ X₀ ∧ X₀ ≤ X₁
t₁₉₂: l1(X₀, X₁) → n_l3___7(X₀, X₁) :|: X₀ ≤ X₁ ∧ X₁ ≤ X₀ ∧ X₀ < 0 ∧ X₁ ≤ X₀ ∧ X₀ ≤ X₁
t₁: l2(X₀, X₁) → l1(X₁, X₁)
t₇: l4(X₀, X₁) → l5(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀ ∧ X₀ ≤ 0 ∧ 0 ≤ X₀
t₂₀₈: n_l1___2(X₀, X₁) → l4(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀ ∧ 1 ≤ X₁ ∧ 1 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 0 ≤ X₀
t₁₈₇: n_l1___2(X₀, X₁) → n_l3___1(X₀, X₁) :|: 0 < X₀ ∧ 1 ≤ X₁ ∧ 1 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 0 ≤ X₀
t₂₀₉: n_l1___5(X₀, X₁) → l4(X₀, X₁) :|: X₀ ≤ 0 ∧ 0 ≤ X₀ ∧ 1+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 1+X₀+X₁ ≤ 0 ∧ X₀ ≤ 0
t₁₉₀: n_l1___5(X₀, X₁) → n_l3___4(X₀, X₁) :|: X₀ ≤ 1 ∧ X₀ < 0 ∧ 1+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 1+X₀+X₁ ≤ 0 ∧ X₀ ≤ 0
t₁₉₃: n_l3___1(X₀, X₁) → n_l1___2(X₀-1, X₁) :|: 0 < X₀ ∧ 0 < X₀ ∧ 2 ≤ X₁ ∧ 3 ≤ X₀+X₁ ∧ 1+X₀ ≤ X₁ ∧ 1 ≤ X₀
t₁₉₅: n_l3___4(X₀, X₁) → n_l1___5(X₀+1, X₁) :|: X₀ < 0 ∧ X₀ ≤ 0 ∧ 2+X₁ ≤ 0 ∧ 1+X₁ ≤ X₀ ∧ 3+X₀+X₁ ≤ 0 ∧ 1+X₀ ≤ 0
t₁₉₆: n_l3___6(X₀, X₁) → n_l1___2(X₀-1, X₁) :|: 0 < X₀ ∧ X₀ ≤ X₁ ∧ X₁ ≤ X₀ ∧ 0 < X₀ ∧ X₁ ≤ X₀ ∧ 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁ ∧ 1 ≤ X₀
t₁₉₇: n_l3___7(X₀, X₁) → n_l1___5(X₀+1, X₁) :|: X₀ < 0 ∧ X₀ ≤ X₁ ∧ X₁ ≤ X₀ ∧ X₀ ≤ 0 ∧ 1+X₁ ≤ 0 ∧ X₁ ≤ X₀ ∧ 2+X₀+X₁ ≤ 0 ∧ X₀ ≤ X₁ ∧ 1+X₀ ≤ 0
All Bounds
Timebounds
Overall timebound:4⋅X₁+13 {O(n)}
t₀: 1 {O(1)}
t₁: 1 {O(1)}
t₄: 1 {O(1)}
t₇: 1 {O(1)}
t₁₈₇: X₁+1 {O(n)}
t₁₉₀: X₁+1 {O(n)}
t₁₉₁: 1 {O(1)}
t₁₉₂: 1 {O(1)}
t₁₉₃: X₁ {O(n)}
t₁₉₅: X₁+1 {O(n)}
t₁₉₆: 1 {O(1)}
t₁₉₇: 1 {O(1)}
t₂₀₈: 1 {O(1)}
t₂₀₉: 1 {O(1)}
Costbounds
Overall costbound: 4⋅X₁+13 {O(n)}
t₀: 1 {O(1)}
t₁: 1 {O(1)}
t₄: 1 {O(1)}
t₇: 1 {O(1)}
t₁₈₇: X₁+1 {O(n)}
t₁₉₀: X₁+1 {O(n)}
t₁₉₁: 1 {O(1)}
t₁₉₂: 1 {O(1)}
t₁₉₃: X₁ {O(n)}
t₁₉₅: X₁+1 {O(n)}
t₁₉₆: 1 {O(1)}
t₁₉₇: 1 {O(1)}
t₂₀₈: 1 {O(1)}
t₂₀₉: 1 {O(1)}
Sizebounds
t₀, X₀: X₀ {O(n)}
t₀, X₁: X₁ {O(n)}
t₁, X₀: X₁ {O(n)}
t₁, X₁: X₁ {O(n)}
t₄, X₀: 0 {O(1)}
t₄, X₁: X₁ {O(n)}
t₇, X₀: 0 {O(1)}
t₇, X₁: 5⋅X₁ {O(n)}
t₁₈₇, X₀: X₁ {O(n)}
t₁₈₇, X₁: X₁ {O(n)}
t₁₉₀, X₀: X₁ {O(n)}
t₁₉₀, X₁: X₁ {O(n)}
t₁₉₁, X₀: X₁ {O(n)}
t₁₉₁, X₁: X₁ {O(n)}
t₁₉₂, X₀: X₁ {O(n)}
t₁₉₂, X₁: X₁ {O(n)}
t₁₉₃, X₀: X₁ {O(n)}
t₁₉₃, X₁: X₁ {O(n)}
t₁₉₅, X₀: X₁ {O(n)}
t₁₉₅, X₁: X₁ {O(n)}
t₁₉₆, X₀: X₁ {O(n)}
t₁₉₆, X₁: X₁ {O(n)}
t₁₉₇, X₀: X₁ {O(n)}
t₁₉₇, X₁: X₁ {O(n)}
t₂₀₈, X₀: 0 {O(1)}
t₂₀₈, X₁: 2⋅X₁ {O(n)}
t₂₀₉, X₀: 0 {O(1)}
t₂₀₉, X₁: 2⋅X₁ {O(n)}