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