Preprocessing

Probabilistic Analysis

Probabilistic Program after Preprocessing

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

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}

Costbounds

Overall costbound: 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]

Classical Approximation after Lifting Classical Results

All Bounds
Timebounds

Overall timebound:inf {Infinity}
g₂: 1 {O(1)}
g₄: inf {Infinity}

Costbounds

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

Sizebounds

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

Run probabilistic analysis on SCC: [g]

Plrf for transition g₄:g(X₀,X₁) -{2}> [1/2]:t₅:g(X₀+UNIFORM(0, 2),X₁) :+: [1/2]:t₆:g(X₀+UNIFORM(0, 5),X₁) :|: 1+X₀ ≤ X₁ ∧ 0 ≤ 1 ∧ 0 ≤ 1:

new bound:

4/7⋅X₀+4/7⋅X₁+16/7 {O(n)}

PLRF:

• g: 16/7+4/7⋅X₁-4/7⋅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/7⋅X₀+4/7⋅X₁+23/7 {O(n)}
g₂: 1 {O(1)}
g₄: 4/7⋅X₀+4/7⋅X₁+16/7 {O(n)}

Costbounds

Overall costbound: 16/7⋅X₀+16/7⋅X₁+64/7 {O(n)}
g₂: 0 {O(1)}
g₄: 16/7⋅X₀+16/7⋅X₁+64/7 {O(n)}

Sizebounds

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