Preprocessing

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

Probabilistic Analysis

Probabilistic Program after Preprocessing

Start: f
Program_Vars: X₀, X₁
Temp_Vars:
Locations: f, g, h
Transitions:
g₀:f(X₀,X₁) -{0}> t₁:g(X₀,X₁) :|:
g₂:g(X₀,X₁) -{0}> t₃:h(X₀,X₁) :|: 1+X₀ ≤ X₁
g₄:h(X₀,X₁) → [1/2]:t₅:g(2+X₀,X₁) :+: [1/2]:t₆:g(X₀-1,X₁) :|: 1+X₀ ≤ 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}

Costbounds

Overall costbound: inf {Infinity}
g₀: inf {Infinity}
g₂: inf {Infinity}
g₄: inf {Infinity}

Sizebounds

(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}

Costbounds

Overall costbound: 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₂,h), X₁: X₁ {O(n)}
(g₄,g), X₁: 2⋅X₁ {O(n)}

Run probabilistic analysis on SCC: [g; h]

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

new bound:

2⋅X₀+2⋅X₁+2 {O(n)}

PLRF:

• g: 2+2⋅X₁-2⋅X₀
• h: 1+2⋅X₁-2⋅X₀

Use expected size bounds for entry point (g₀:f→[t₁:1:g],g)
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₁) → [1/2]:t₅:g(2+X₀,X₁) :+: [1/2]:t₆:g(X₀-1,X₁) :|: 1+X₀ ≤ X₁:

new bound:

2⋅X₀+2⋅X₁+2 {O(n)}

PLRF:

• g: 2+2⋅X₁-2⋅X₀
• h: 2+2⋅X₁-2⋅X₀

Use expected size bounds for entry point (g₀:f→[t₁:1:g],g)
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:4⋅X₀+4⋅X₁+5 {O(n)}
g₀: 1 {O(1)}
g₂: 2⋅X₀+2⋅X₁+2 {O(n)}
g₄: 2⋅X₀+2⋅X₁+2 {O(n)}

Costbounds

Overall costbound: 4⋅X₀+4⋅X₁+4 {O(n)}
g₀: 0 {O(1)}
g₂: 0 {O(1)}
g₄: 4⋅X₀+4⋅X₁+4 {O(n)}

Sizebounds

(g₀,g), X₀: X₀ {O(n)}
(g₀,g), X₁: X₁ {O(n)}
(g₂,h), X₀: 3⋅X₁+4⋅X₀+3 {O(n)}
(g₂,h), X₁: X₁ {O(n)}
(g₄,g), X₀: 3⋅X₁+4⋅X₀+3 {O(n)}
(g₄,g), X₁: X₁ {O(n)}