Preprocessing

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

Found invariant 0 ≤ 1+X₁ ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ X₀ for location h

Probabilistic Analysis

Probabilistic Program after Preprocessing

Start: f
Program_Vars: X₀, X₁, X₂
Temp_Vars:
Locations: f, g, h
Transitions:
g₀:f(X₀,X₁,X₂) -{0}> t₁:g(X₀,X₁,X₂) :|:
g₂:g(X₀,X₁,X₂) -{0}> [1/3]:t₃:h(1+X₀,X₀,X₂) :+: [2/3]:t₄:h(X₀-1,X₀-2,X₂) :|: 1 ≤ X₀
g₅:h(X₀,X₁,X₂) → [1/3]:t₆:h(X₀,1+X₁,X₂) :+: [2/3]:t₇:h(X₀,X₁-1,X₂) :|: 1 ≤ X₁ ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ 1+X₁ ∧ 0 ≤ X₀
g₈:h(X₀,X₁,X₂) -{0}> t₉:g(X₀,X₁,X₂) :|: X₁ ≤ 0 ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ 1+X₁ ∧ 0 ≤ X₀

Run classical analysis on SCC: [f]

Classical Approximation after Lifting Classical Results

All Bounds
Timebounds

Overall timebound:inf {Infinity}
g₀: 1 {O(1)}
g₂: inf {Infinity}
g₅: inf {Infinity}
g₈: inf {Infinity}

Costbounds

Overall costbound: inf {Infinity}
g₀: inf {Infinity}
g₂: inf {Infinity}
g₅: inf {Infinity}
g₈: inf {Infinity}

Sizebounds

(g₀,g), X₀: X₀ {O(n)}
(g₀,g), X₁: X₁ {O(n)}
(g₀,g), X₂: X₂ {O(n)}

Run probabilistic analysis on SCC: [f]

Run classical analysis on SCC: [g; h]

Classical Approximation after Lifting Classical Results

All Bounds
Timebounds

Overall timebound:inf {Infinity}
g₀: 1 {O(1)}
g₂: inf {Infinity}
g₅: inf {Infinity}
g₈: inf {Infinity}

Costbounds

Overall costbound: inf {Infinity}
g₀: inf {Infinity}
g₂: inf {Infinity}
g₅: inf {Infinity}
g₈: inf {Infinity}

Sizebounds

(g₀,g), X₀: X₀ {O(n)}
(g₀,g), X₁: X₁ {O(n)}
(g₀,g), X₂: X₂ {O(n)}
(g₂,h), X₂: 2⋅X₂ {O(n)}
(g₅,h), X₂: 2⋅X₂ {O(n)}
(g₈,g), X₁: 1 {O(1)}
(g₈,g), X₂: X₂ {O(n)}

Run probabilistic analysis on SCC: [g; h]

Plrf for transition g₂:g(X₀,X₁,X₂) -{0}> [1/3]:t₃:h(1+X₀,X₀,X₂) :+: [2/3]:t₄:h(X₀-1,X₀-2,X₂) :|: 1 ≤ X₀:

new bound:

3⋅X₀ {O(n)}

PLRF:

• g: 3⋅X₀
• h: 3⋅X₀

Use expected size bounds for entry point (g₀:f→[t₁:1:g],g)
Use classical time bound for entry point (g₀:f→[t₁:1:g],g)

Plrf for transition g₈:h(X₀,X₁,X₂) -{0}> t₉:g(X₀,X₁,X₂) :|: X₁ ≤ 0 ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ 1+X₁ ∧ 0 ≤ X₀:

new bound:

3⋅X₀ {O(n)}

PLRF:

• g: 3⋅X₀
• h: 1+3⋅X₀

Use expected size bounds for entry point (g₀:f→[t₁:1:g],g)
Use classical time bound for entry point (g₀:f→[t₁:1:g],g)

Results of Probabilistic Analysis

All Bounds

Timebounds

Overall timebound:inf {Infinity}
g₀: 1 {O(1)}
g₂: 3⋅X₀ {O(n)}
g₅: inf {Infinity}
g₈: 3⋅X₀ {O(n)}

Costbounds

Overall costbound: inf {Infinity}
g₀: 0 {O(1)}
g₂: 0 {O(1)}
g₅: inf {Infinity}
g₈: 0 {O(1)}

Sizebounds

(g₀,g), X₀: X₀ {O(n)}
(g₀,g), X₁: X₁ {O(n)}
(g₀,g), X₂: X₂ {O(n)}
(g₂,h), X₀: 2⋅X₀ {O(n)}
(g₂,h), X₁: 6⋅X₀+2 {O(n)}
(g₂,h), X₂: X₂ {O(n)}
(g₅,h), X₀: 2⋅X₀ {O(n)}
(g₅,h), X₂: X₂ {O(n)}
(g₈,g), X₀: 2⋅X₀ {O(n)}
(g₈,g), X₁: 1 {O(1)}
(g₈,g), X₂: X₂ {O(n)}