Expected Cost | +- [f] | 0 | +- [Program] | x :~ {1 : 0} | break :~ {1 : 0} | 0:While(0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x) | NonDet | {break :~ {1 : 1}} | {x :~ {1 : 1 + x} | Tick(1)} | 1:While(n ≥ 1 + x) | Tick(1) | x :~ {1 : 1 + x} | +- Expected Cost | | | +- [f] | | 0 | | | +- [Program] | | 0:While(0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x) | | NonDet | | {break :~ {1 : 1}} | | {x :~ {1 : 1 + x} | | Tick(1)} | | | +- While.step | | | | | +- [Problem] | | | 0:While(0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x) | | | NonDet | | | {break :~ {1 : 1}} | | | {x :~ {1 : 1 + x} | | | Tick(1)} | | | | | +- [f] | | | 0 | | | | | +- Expected Cost Body | | | | | | | `- [1 | ⊤] | | | | | +- mixed-iteration-template | | | | | | | `- [1 + -break | 1 + -break ≥ 0] + 2·([1 + -break | 1 + -break ≥ 0]·[1 + break | 1 + break ≥ 0]) + 2·([1 + -break | 1 + -break ≥ 0]·[n + -x | n + -x ≥ 0]) + [1 + -break | 1 + -break ≥ 0]^2 + [1 + break | 1 + break ≥ 0] + 2·([1 + break | 1 + break ≥ 0]·[n + -x | n + -x ≥ 0]) + [1 + break | 1 + break ≥ 0]^2 + [n + -x | n + -x ≥ 0] + [n + -x | n + -x ≥ 0]^2 | | | | | +- [Norms] | | | [[1 + -break | 1 + -break ≥ 0],[1 + -break^2 | 1 + -break ≥ 0 ∧ 1 + break ≥ 0],[-break·n + break·x + n + -x | 1 + -break ≥ 0 ∧ n + -x ≥ 0],[1 + -2·(break) + break^2 | 1 + -break ≥ 0],[1 + break | 1 + break ≥ 0],[break·n + -break·x + n + -x | 1 + break ≥ 0 ∧ n + -x ≥ 0],[1 + 2·(break) + break^2 | 1 + break ≥ 0],[n + -x | n + -x ≥ 0],[-2·(n·x) + n^2 + x^2 | n + -x ≥ 0]] | | | | | +- [Invariant] | | | 0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x ==> [1 | ⊤] + h([1 + -break | 1 + -break ≥ 0],[1 + -break^2 | 1 + -break ≥ 0 ∧ 1 + break ≥ 0],[-1 + break + -break·n + break·x + n + -x | -1 + n + -x ≥ 0 ∧ 1 + -break ≥ 0],[1 + -2·(break) + break^2 | 1 + -break ≥ 0],sup(2,[1 + break | 1 + break ≥ 0]),sup(2·[n + -x | n + -x ≥ 0],[-1 + -break + break·n + -break·x + n + -x | -1 + n + -x ≥ 0 ∧ 1 + break ≥ 0]),sup(4,[1 + 2·(break) + break^2 | 1 + break ≥ 0]),sup([n + -x | n + -x ≥ 0],[-1 + n + -x | -1 + n + -x ≥ 0]),sup([-2·(n·x) + n^2 + x^2 | n + -x ≥ 0],[1 + -2·(n) + -2·(n·x) + n^2 + 2·(x) + x^2 | -1 + n + -x ≥ 0])) ≼ h([1 + -break | 1 + -break ≥ 0],[1 + -break^2 | 1 + -break ≥ 0 ∧ 1 + break ≥ 0],[-break·n + break·x + n + -x | 1 + -break ≥ 0 ∧ n + -x ≥ 0],[1 + -2·(break) + break^2 | 1 + -break ≥ 0],[1 + break | 1 + break ≥ 0],[break·n + -break·x + n + -x | 1 + break ≥ 0 ∧ n + -x ≥ 0],[1 + 2·(break) + break^2 | 1 + break ≥ 0],[n + -x | n + -x ≥ 0],[-2·(n·x) + n^2 + x^2 | n + -x ≥ 0]) | | | 0 ≥ 1 + break ∨ 1 + x ≥ 1 + n ∨ break ≥ 1 ==> 0 ≼ h([1 + -break | 1 + -break ≥ 0],[1 + -break^2 | 1 + -break ≥ 0 ∧ 1 + break ≥ 0],[-break·n + break·x + n + -x | 1 + -break ≥ 0 ∧ n + -x ≥ 0],[1 + -2·(break) + break^2 | 1 + -break ≥ 0],[1 + break | 1 + break ≥ 0],[break·n + -break·x + n + -x | 1 + break ≥ 0 ∧ n + -x ≥ 0],[1 + 2·(break) + break^2 | 1 + break ≥ 0],[n + -x | n + -x ≥ 0],[-2·(n·x) + n^2 + x^2 | n + -x ≥ 0]) | | | | | `- [-break·n + break·x + n + -x | 1 + -break ≥ 0 ∧ n + -x ≥ 0] | | | `- [-break·n + break·x + n + -x | 1 + -break ≥ 0 ∧ n + -x ≥ 0] | +- Expected Cost | | | +- [f] | | 0 | | | +- [Program] | | 1:While(n ≥ 1 + x) | | Tick(1) | | x :~ {1 : 1 + x} | | | +- While.step | | | | | +- [Problem] | | | 1:While(n ≥ 1 + x) | | | Tick(1) | | | x :~ {1 : 1 + x} | | | | | +- [f] | | | 0 | | | | | +- Expected Cost Body | | | | | | | `- [1 | ⊤] | | | | | +- linear-template | | | | | | | `- 1 + [n + -x | n + -x ≥ 0] | | | | | +- [Norms] | | | [[1 | ⊤],[n + -x | n + -x ≥ 0]] | | | | | +- [Invariant] | | | n ≥ 1 + x ==> [1 | ⊤] + h([1 | ⊤],[-1 + n + -x | -1 + n + -x ≥ 0]) ≼ h([1 | ⊤],[n + -x | n + -x ≥ 0]) | | | 1 + x ≥ 1 + n ==> 0 ≼ h([1 | ⊤],[n + -x | n + -x ≥ 0]) | | | | | `- [n + -x | n + -x ≥ 0] | | | `- [n + -x | n + -x ≥ 0] | +- Expected Cost | | | +- [f] | | [n + -x | n + -x ≥ 0] | | | +- [Program] | | 0:While(0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x) | | NonDet | | {break :~ {1 : 1}} | | {x :~ {1 : 1 + x} | | Tick(1)} | | | +- While.step | | | | | +- [Problem] | | | 0:While(0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x) | | | NonDet | | | {break :~ {1 : 1}} | | | {x :~ {1 : 1 + x} | | | Tick(1)} | | | | | +- [f] | | | [n + -x | n + -x ≥ 0] | | | | | +- linear-template | | | | | | | `- 1 + 2·([1 + -break | 1 + -break ≥ 0]) + 2·([1 + break | 1 + break ≥ 0]) + 3·([n + -x | n + -x ≥ 0]) | | | | | +- [Norms] | | | [[1 | ⊤],[1 + -break | 1 + -break ≥ 0],[1 + break | 1 + break ≥ 0],[n + -x | n + -x ≥ 0]] | | | | | +- [Invariant] | | | 0 ≥ break ∧ break ≥ 0 ∧ n ≥ 1 + x ==> 0 + h([1 | ⊤],[1 + -break | 1 + -break ≥ 0],sup(2,[1 + break | 1 + break ≥ 0]),sup([n + -x | n + -x ≥ 0],[-1 + n + -x | -1 + n + -x ≥ 0])) ≼ h([1 | ⊤],[1 + -break | 1 + -break ≥ 0],[1 + break | 1 + break ≥ 0],[n + -x | n + -x ≥ 0]) | | | 0 ≥ 1 + break ∨ 1 + x ≥ 1 + n ∨ break ≥ 1 ==> [n + -x | n + -x ≥ 0] ≼ h([1 | ⊤],[1 + -break | 1 + -break ≥ 0],[1 + break | 1 + break ≥ 0],[n + -x | n + -x ≥ 0]) | | | | | `- [n + -x | n + -x ≥ 0] | | | `- [n + -x | n + -x ≥ 0] | `- 2·[n | n ≥ 0]