Preprocessing
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₁) → [1/2]:t₃:g(X₀-1,X₀+X₁) :+: [1/2]:t₄:g(X₀,X₀+X₁) :|: 1 ≤ X₀
g₅:g(X₀,X₁) -{0}> t₆:h(X₀,X₁) :|:
g₇:h(X₀,X₁) → t₈:h(X₀,X₁-1) :|: 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)}
(g₀,g), X₁: X₁ {O(n)}
Run probabilistic analysis on SCC: [f]
Run classical analysis on SCC: [g]
MPRF for transition t₃: g(X₀,X₁) → g(X₀-1,X₀+X₁) :|: 1 ≤ X₀ of depth 1:
new bound:
X₀ {O(n)}
MPRF:
• g: [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₀,g), X₁: X₁ {O(n)}
(g₂,g), X₀: 2⋅X₀ {O(n)}
(g₅,h), X₀: 3⋅X₀ {O(n)}
Run probabilistic analysis on SCC: [g]
Plrf for transition g₂:g(X₀,X₁) → [1/2]:t₃:g(X₀-1,X₀+X₁) :+: [1/2]:t₄:g(X₀,X₀+X₁) :|: 1 ≤ X₀:
new bound:
2⋅X₀ {O(n)}
PLRF:
• g: 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: [h]
Classical Approximation after Lifting Classical Results
All Bounds
Timebounds
Overall timebound:inf {Infinity}
g₀: 1 {O(1)}
g₂: 2⋅X₀ {O(n)}
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₀,g), X₁: X₁ {O(n)}
(g₂,g), X₀: X₀ {O(n)}
(g₂,g), X₁: 6⋅X₀⋅X₀+X₁ {O(n^2)}
(g₅,h), X₀: 3⋅X₀ {O(n)}
(g₅,h), X₁: 6⋅X₀⋅X₀+2⋅X₁ {O(n^2)}
(g₇,h), X₀: 3⋅X₀ {O(n)}
Run probabilistic analysis on SCC: [h]
Plrf for transition g₇:h(X₀,X₁) → t₈:h(X₀,X₁-1) :|: 1 ≤ X₁:
new bound:
6⋅X₀⋅X₀+2⋅X₁ {O(n^2)}
PLRF:
• h: X₁
Use expected size bounds for entry point (g₅:g→[t₆:1:h],h)
Use classical time bound for entry point (g₅:g→[t₆:1:h],h)
Results of Probabilistic Analysis
All Bounds
Timebounds
Overall timebound:6⋅X₀⋅X₀+2⋅X₀+2⋅X₁+2 {O(n^2)}
g₀: 1 {O(1)}
g₂: 2⋅X₀ {O(n)}
g₅: 1 {O(1)}
g₇: 6⋅X₀⋅X₀+2⋅X₁ {O(n^2)}
Costbounds
Overall costbound: 6⋅X₀⋅X₀+2⋅X₁+4⋅X₀ {O(n^2)}
g₀: 0 {O(1)}
g₂: 4⋅X₀ {O(n)}
g₅: 0 {O(1)}
g₇: 6⋅X₀⋅X₀+2⋅X₁ {O(n^2)}
Sizebounds
(g₀,g), X₀: X₀ {O(n)}
(g₀,g), X₁: X₁ {O(n)}
(g₂,g), X₀: X₀ {O(n)}
(g₂,g), X₁: 6⋅X₀⋅X₀+X₁ {O(n^2)}
(g₅,h), X₀: 3⋅X₀ {O(n)}
(g₅,h), X₁: 6⋅X₀⋅X₀+2⋅X₁ {O(n^2)}
(g₇,h), X₀: 3⋅X₀ {O(n)}
(g₇,h), X₁: 6⋅X₀⋅X₀+2⋅X₁ {O(n^2)}