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