Initial Problem
Start: l0
Program_Vars: X₀, X₁, X₂, X₃
Temp_Vars:
Locations: l0, l1, l2
Transitions:
t₀: l0(X₀, X₁, X₂, X₃) → l1(0, X₁, X₂, X₃)
t₁: l1(X₀, X₁, X₂, X₃) → l2(X₀, X₁, 0, 0) :|: 1 ≤ X₁
t₃: l2(X₀, X₁, X₂, X₃) → l1(X₀+X₃, X₁-1, X₂, X₃) :|: X₁ ≤ X₂
t₂: l2(X₀, X₁, X₂, X₃) → l2(X₀, X₁, X₂+1, X₃+X₂) :|: X₂+1 ≤ X₁
Preprocessing
Eliminate variables {X₀,X₃} that do not contribute to the problem
Found invariant X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁ for location l2
Problem after Preprocessing
Start: l0
Program_Vars: X₁, X₂
Temp_Vars:
Locations: l0, l1, l2
Transitions:
t₉: l0(X₁, X₂) → l1(X₁, X₂)
t₁₀: l1(X₁, X₂) → l2(X₁, 0) :|: 1 ≤ X₁
t₁₂: l2(X₁, X₂) → l1(X₁-1, X₂) :|: X₁ ≤ X₂ ∧ X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁
t₁₁: l2(X₁, X₂) → l2(X₁, X₂+1) :|: X₂+1 ≤ X₁ ∧ X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁
MPRF for transition t₁₀: l1(X₁, X₂) → l2(X₁, 0) :|: 1 ≤ X₁ of depth 1:
new bound:
X₁ {O(n)}
MPRF:
l2 [X₁-1 ]
l1 [X₁ ]
MPRF for transition t₁₂: l2(X₁, X₂) → l1(X₁-1, X₂) :|: X₁ ≤ X₂ ∧ X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁ of depth 1:
new bound:
X₁ {O(n)}
MPRF:
l2 [X₁ ]
l1 [X₁ ]
Found invariant X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁ for location l2
Time-Bound by TWN-Loops:
TWN-Loops: t₁₁ 2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}
TWN-Loops:
entry: t₁₀: l1(X₁, X₂) → l2(X₁, 0) :|: 1 ≤ X₁
results in twn-loop: twn:Inv: [X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁] , (X₁,X₂) -> (X₁,X₂+1) :|: X₂+1 ≤ X₁
order: [X₁; X₂]
closed-form:
X₁: X₁
X₂: X₂ + [[n != 0]] * n^1
Termination: true
Formula:
1 < 0
∨ X₂+1 < X₁ ∧ 1 ≤ 0 ∧ 0 ≤ 1
∨ 1 ≤ 0 ∧ 0 ≤ 1 ∧ X₂+1 ≤ X₁ ∧ X₁ ≤ X₂+1
Stabilization-Threshold for: X₂+1 ≤ X₁
alphas_abs: X₁
M: 0
N: 1
Bound: 2⋅X₁+2 {O(n)}
relevant size-bounds w.r.t. t₁₀:
X₁: X₁ {O(n)}
Runtime-bound of t₁₀: X₁ {O(n)}
Results in: 2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}
2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}
Analysing control-flow refined program
Cut unsatisfiable transition t₁₂: l2→l1
Found invariant X₂ ≤ 0 ∧ 1+X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁ for location l2
Found invariant X₂ ≤ X₁ ∧ 1 ≤ X₂ ∧ 2 ≤ X₁+X₂ ∧ 1 ≤ X₁ for location n_l2___1
knowledge_propagation leads to new time bound X₁ {O(n)} for transition t₃₉: l2(X₁, X₂) → n_l2___1(X₁, X₂+1) :|: 1+X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ X₂ ≤ 0 ∧ 0 ≤ X₂ ∧ 1 ≤ X₁ ∧ 0 ≤ X₂ ∧ 1+X₂ ≤ X₁ ∧ 1+X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ X₂ ≤ 0 ∧ 1+X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁
MPRF for transition t₃₈: n_l2___1(X₁, X₂) → n_l2___1(X₁, X₂+1) :|: 0 ≤ X₂ ∧ 1 ≤ X₂ ∧ X₂ ≤ X₁ ∧ 1+X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ X₂ ≤ X₁ ∧ 1 ≤ X₂ ∧ 2 ≤ X₁+X₂ ∧ 1 ≤ X₁ of depth 1:
new bound:
X₁⋅X₁+2⋅X₁ {O(n^2)}
MPRF:
l2 [0 ]
n_l2___1 [X₁+1-X₂ ]
l1 [0 ]
MPRF for transition t₄₂: n_l2___1(X₁, X₂) → l1(X₁-1, X₂) :|: X₁ ≤ X₂ ∧ X₂ ≤ X₁ ∧ 0 ≤ X₂ ∧ 1 ≤ X₁+X₂ ∧ 1 ≤ X₁ ∧ X₂ ≤ X₁ ∧ 1 ≤ X₂ ∧ 2 ≤ X₁+X₂ ∧ 1 ≤ X₁ of depth 1:
new bound:
X₁ {O(n)}
MPRF:
l2 [X₁ ]
n_l2___1 [X₁ ]
l1 [X₁ ]
CFR did not improve the program. Rolling back
All Bounds
Timebounds
Overall timebound:2⋅X₁⋅X₁+6⋅X₁+1 {O(n^2)}
t₉: 1 {O(1)}
t₁₀: X₁ {O(n)}
t₁₁: 2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}
t₁₂: X₁ {O(n)}
Costbounds
Overall costbound: 2⋅X₁⋅X₁+6⋅X₁+1 {O(n^2)}
t₉: 1 {O(1)}
t₁₀: X₁ {O(n)}
t₁₁: 2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}
t₁₂: X₁ {O(n)}
Sizebounds
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₂: 2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}
t₁₂, X₁: X₁ {O(n)}
t₁₂, X₂: 2⋅X₁⋅X₁+4⋅X₁ {O(n^2)}