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