Expected Cost | +- [f] | 0 | +- [Program] | 0:While(x ≥ 1 + y) | Tick(1) | x :~ {1 : -1 + x + -y} | z :~ {1 : y} | 1:While(z ≥ 1) | Tick(1) | z :~ {1 : -1 + z} | +- While.step | | | +- [Problem] | | 0:While(x ≥ 1 + y) | | Tick(1) | | x :~ {1 : -1 + x + -y} | | z :~ {1 : y} | | 1:While(z ≥ 1) | | Tick(1) | | z :~ {1 : -1 + z} | | | +- [f] | | 0 | | | +- Expected Cost Body | | | | | +- While.step | | | | | | | +- [Problem] | | | | 1:While(z ≥ 1) | | | | Tick(1) | | | | z :~ {1 : -1 + z} | | | | | | | +- [f] | | | | 0 | | | | | | | +- Expected Cost Body | | | | | | | | | `- [1 | ⊤] | | | | | | | +- linear-template | | | | | | | | | `- 1 + [z | z ≥ 0] | | | | | | | +- [Norms] | | | | [[1 | ⊤],[z | z ≥ 0]] | | | | | | | +- [Invariant] | | | | z ≥ 1 ==> [1 | ⊤] + h([1 | ⊤],[-1 + z | -1 + z ≥ 0]) ≼ h([1 | ⊤],[z | z ≥ 0]) | | | | 1 ≥ 1 + z ==> 0 ≼ h([1 | ⊤],[z | z ≥ 0]) | | | | | | | `- [z | z ≥ 0] | | | | | `- [1 | ⊤] + [y | y ≥ 0] | | | +- shift-avg-template | | | | | `- 1 + [1 + x | 1 + x ≥ 0] + [1 + y | 1 + y ≥ 0] + [y | y ≥ 0] | | | +- [Norms] | | [[1 | ⊤],[1 + x | 1 + x ≥ 0],[1 + y | 1 + y ≥ 0],[y | y ≥ 0]] | | | +- [Invariant] | | x ≥ 1 + y ∧ y ≥ 0 ==> [1 | ⊤] + [y | y ≥ 0] + h([1 | ⊤],[x + -y | x + -y ≥ 0],[1 + y | 1 + y ≥ 0],[y | y ≥ 0]) ≼ h([1 | ⊤],[1 + x | 1 + x ≥ 0],[1 + y | 1 + y ≥ 0],[y | y ≥ 0]) | | 1 + y ≥ 1 + x ∧ y ≥ 0 ==> 0 ≼ h([1 | ⊤],[1 + x | 1 + x ≥ 0],[1 + y | 1 + y ≥ 0],[y | y ≥ 0]) | | | `- [y ≥ 0] · [1 + x | 1 + x ≥ 0] | `- [y ≥ 0] · [1 + x | 1 + x ≥ 0]