Preprocessing

Found invariant 0 ≤ X₁ ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ 1+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₁) → t₂:g(X₀,X₁) :|:
g₃:g(X₀,X₁) → t₄:h(X₀+UNIFORM(-1, 0),X₀) :|: 1 ≤ X₀ ∧ 0 ≤ 1
g₅:h(X₀,X₁) → [1/4]:t₆:h(X₀,X₁) :+: [3/4]:t₇:h(X₀,X₁-1) :|: 1 ≤ X₁ ∧ 0 ≤ 1+X₀ ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ X₁
g₈:h(X₀,X₁) → t₉:g(X₀,X₁) :|: X₁ ≤ 0 ∧ 0 ≤ 1+X₀ ∧ 0 ≤ 1+X₀+X₁ ∧ 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)}
(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}
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₃,h), X₀: X₀ {O(n)}
(g₃,h), X₁: 2⋅X₀ {O(n)}
(g₅,h), X₀: 2⋅X₀ {O(n)}
(g₅,h), X₁: 4⋅X₀ {O(n)}
(g₈,g), X₀: X₀ {O(n)}
(g₈,g), X₁: 0 {O(1)}

Run probabilistic analysis on SCC: [g; h]

Plrf for transition g₃:g(X₀,X₁) → t₄:h(X₀+UNIFORM(-1, 0),X₀) :|: 1 ≤ X₀ ∧ 0 ≤ 1:

new bound:

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

PLRF:

• g: 2+2⋅X₀
• h: 2+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₀,X₁) → t₉:g(X₀,X₁) :|: X₁ ≤ 0 ∧ 0 ≤ 1+X₀ ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ X₁:

new bound:

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

PLRF:

• g: 2+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₀,X₁) → [1/4]:t₆:h(X₀,X₁) :+: [3/4]:t₇:h(X₀,X₁-1) :|: 1 ≤ X₁ ∧ 0 ≤ 1+X₀ ∧ 0 ≤ 1+X₀+X₁ ∧ 0 ≤ X₁:

new bound:

8/3⋅X₀⋅X₀+4⋅X₀ {O(n^2)}

PLRF:

• g: 4/3⋅X₀
• h: 4/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)
Use classical size bounds for entry point (g₈:h→[t₉:1:g],g)
Use expected time bound for entry point (g₈:h→[t₉:1:g],g)

Results of Probabilistic Analysis

All Bounds

Timebounds

Overall timebound:8/3⋅X₀⋅X₀+8⋅X₀+5 {O(n^2)}
g₁: 1 {O(1)}
g₃: 2⋅X₀+2 {O(n)}
g₅: 8/3⋅X₀⋅X₀+4⋅X₀ {O(n^2)}
g₈: 2⋅X₀+2 {O(n)}

Costbounds

Overall costbound: 16/3⋅X₀⋅X₀+12⋅X₀+5 {O(n^2)}
g₁: 1 {O(1)}
g₃: 2⋅X₀+2 {O(n)}
g₅: 16/3⋅X₀⋅X₀+8⋅X₀ {O(n^2)}
g₈: 2⋅X₀+2 {O(n)}

Sizebounds

(g₁,g), X₀: X₀ {O(n)}
(g₁,g), X₁: X₁ {O(n)}
(g₃,h), X₀: X₀ {O(n)}
(g₃,h), X₁: 2⋅X₀ {O(n)}
(g₅,h), X₀: X₀ {O(n)}
(g₅,h), X₁: 4⋅X₀ {O(n)}
(g₈,g), X₀: X₀ {O(n)}
(g₈,g), X₁: 0 {O(1)}