Preprocessing
Found invariant 1 ≤ X₀ for location h
Found invariant 1 ≤ X₀ for location i
Probabilistic Analysis
Probabilistic Program after Preprocessing
Start: f
Program_Vars: X₀
Temp_Vars:
Locations: f, g, h, i
Transitions:
g₀:f(X₀) -{0}> t₁:g(X₀) :|:
g₂:g(X₀) -{0}> t₃:h(X₀) :|: 1 ≤ X₀
g₄:h(X₀) -{0}> t₅:i(X₀) :|: 1 ≤ X₀
g₆:h(X₀) → [2/3]:t₇:g(X₀-1) :+: [1/3]:t₈:g(X₀) :|: 1 ≤ 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₄: 1 {O(1)}
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)}
Run probabilistic analysis on SCC: [f]
Run classical analysis on SCC: [g; h]
MPRF for transition t₇: h(X₀) → g(X₀-1) :|: 1 ≤ X₀ of depth 1:
new bound:
X₀ {O(n)}
MPRF:
• g: [X₀]
• h: [X₀]
Classical Approximation after Lifting Classical Results
All Bounds
Timebounds
Overall timebound:inf {Infinity}
g₀: 1 {O(1)}
g₂: inf {Infinity}
g₄: 1 {O(1)}
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₂,h), X₀: X₀ {O(n)}
(g₄,i), X₀: X₀ {O(n)}
(g₆,g), X₀: 2⋅X₀ {O(n)}
Run probabilistic analysis on SCC: [g; h]
Plrf for transition g₂:g(X₀) -{0}> t₃:h(X₀) :|: 1 ≤ X₀:
new bound:
3/2⋅X₀+1 {O(n)}
PLRF:
• g: 1+3/2⋅X₀
• h: 3/2⋅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₀) → [2/3]:t₇:g(X₀-1) :+: [1/3]:t₈:g(X₀) :|: 1 ≤ X₀:
new bound:
3/2⋅X₀ {O(n)}
PLRF:
• g: 3/2⋅X₀
• h: 3/2⋅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)
Run classical analysis on SCC: [i]
Classical Approximation after Lifting Classical Results
All Bounds
Timebounds
Overall timebound:3⋅X₀+3 {O(n)}
g₀: 1 {O(1)}
g₂: 3/2⋅X₀+1 {O(n)}
g₄: 1 {O(1)}
g₆: 3/2⋅X₀ {O(n)}
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₂,h), X₀: X₀ {O(n)}
(g₄,i), X₀: X₀ {O(n)}
(g₆,g), X₀: X₀ {O(n)}
Run probabilistic analysis on SCC: [i]
Results of Probabilistic Analysis
All Bounds
Timebounds
Overall timebound:3⋅X₀+3 {O(n)}
g₀: 1 {O(1)}
g₂: 3/2⋅X₀+1 {O(n)}
g₄: 1 {O(1)}
g₆: 3/2⋅X₀ {O(n)}
Costbounds
Overall costbound: 3⋅X₀ {O(n)}
g₀: 0 {O(1)}
g₂: 0 {O(1)}
g₄: 0 {O(1)}
g₆: 3⋅X₀ {O(n)}
Sizebounds
(g₀,g), X₀: X₀ {O(n)}
(g₂,h), X₀: X₀ {O(n)}
(g₄,i), X₀: X₀ {O(n)}
(g₆,g), X₀: X₀ {O(n)}