Initial Problem

Start: sqrt
Program_Vars: X₀, X₁, X₂, X₃
Temp_Vars:
Locations: end, f, sqrt
Transitions:
t₂: f(X₀, X₁, X₂, X₃) → end(X₀, X₁, X₂, X₃) :|: 1+X₃ ≤ X₂
t₁: f(X₀, X₁, X₂, X₃) → f(1+X₀, 2+X₁, 2+X₁+X₂, X₃) :|: 0 ≤ X₁ ∧ X₂ ≤ X₃
t₀: sqrt(X₀, X₁, X₂, X₃) → f(0, 1, 1, X₃)

Preprocessing

Eliminate variables [X₀] that do not contribute to the problem

Found invariant 1+X₂ ≤ X₁ ∧ 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁ ∧ 1 ≤ X₀ for location end

Found invariant 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁ ∧ 1 ≤ X₀ for location f

Problem after Preprocessing

Start: sqrt
Program_Vars: X₀, X₁, X₂
Temp_Vars:
Locations: end, f, sqrt
Transitions:
t₅: f(X₀, X₁, X₂) → end(X₀, X₁, X₂) :|: 1+X₂ ≤ X₁ ∧ 1 ≤ X₀ ∧ 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁
t₆: f(X₀, X₁, X₂) → f(2+X₀, 2+X₀+X₁, X₂) :|: 0 ≤ X₀ ∧ X₁ ≤ X₂ ∧ 1 ≤ X₀ ∧ 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁
t₇: sqrt(X₀, X₁, X₂) → f(1, 1, X₂)

MPRF for transition t₆: f(X₀, X₁, X₂) → f(2+X₀, 2+X₀+X₁, X₂) :|: 0 ≤ X₀ ∧ X₁ ≤ X₂ ∧ 1 ≤ X₀ ∧ 1 ≤ X₁ ∧ 2 ≤ X₀+X₁ ∧ X₀ ≤ X₁ of depth 1:

new bound:

X₂+3 {O(n)}

MPRF:

• f: [1+X₀+X₂-X₁]

All Bounds

Timebounds

Overall timebound:X₂+5 {O(n)}
t₅: 1 {O(1)}
t₆: X₂+3 {O(n)}
t₇: 1 {O(1)}

Costbounds

Overall costbound: X₂+5 {O(n)}
t₅: 1 {O(1)}
t₆: X₂+3 {O(n)}
t₇: 1 {O(1)}

Sizebounds

t₅, X₀: 2⋅X₂+8 {O(n)}
t₅, X₁: 2^(X₂)⋅32+2^(X₂)⋅8⋅X₂+1 {O(EXP)}
t₅, X₂: 2⋅X₂ {O(n)}
t₆, X₀: 2⋅X₂+7 {O(n)}
t₆, X₁: 2^(X₂)⋅32+2^(X₂)⋅8⋅X₂ {O(EXP)}
t₆, X₂: X₂ {O(n)}
t₇, X₀: 1 {O(1)}
t₇, X₁: 1 {O(1)}
t₇, X₂: X₂ {O(n)}