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