Expected Cost | +- [f] | 0 | +- [Program] | 0:While(n ≥ 1 + x) | r :~ {1/2 : 1;1/2 : 0} | x :~ {1 : r + x} | Tick(1) | +- While.step | | | +- [Problem] | | 0:While(n ≥ 1 + x) | | r :~ {1/2 : 1;1/2 : 0} | | x :~ {1 : r + x} | | Tick(1) | | | +- [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/2·[-1 + n + -x | -1 + n + -x ≥ 0] + 1/2·[n + -x | n + -x ≥ 0]) ≼ h([1 | ⊤],[n + -x | n + -x ≥ 0]) | | 1 + x ≥ 1 + n ==> 0 ≼ h([1 | ⊤],[n + -x | n + -x ≥ 0]) | | | `- 2·[n + -x | n + -x ≥ 0] | `- 2·[n + -x | n + -x ≥ 0]