ExecutionLog | `- Expected Cost | +- [f] | 0 | +- [Program] | 0:While(n 1) | j :~ {1 : n} | 1:While(j 1) | Choice | 1/3: j :~ {1 : -1 + j} | Tick(1) | 2/3: Skip | sample :~ {1/2 : 0;1/2 : 1} | n :~ {1 : n + -sample} | +- While.step | | | +- [Problem] | | 0:While(n 1) | | j :~ {1 : n} | | 1:While(j 1) | | Choice | | 1/3: j :~ {1 : -1 + j} | | Tick(1) | | 2/3: Skip | | sample :~ {1/2 : 0;1/2 : 1} | | n :~ {1 : n + -sample} | | | +- [f] | | 0 | | | +- Expected Cost Body | | | | | +- Expected Cost | | | | | | | +- [f] | | | | 0 | | | | | | | +- [Program] | | | | 1:While(j 1) | | | | Choice | | | | 1/3: j :~ {1 : -1 + j} | | | | Tick(1) | | | | 2/3: Skip | | | | | | | +- While.step | | | | | | | | | +- [Problem] | | | | | 1:While(j 1) | | | | | Choice | | | | | 1/3: j :~ {1 : -1 + j} | | | | | Tick(1) | | | | | 2/3: Skip | | | | | | | | | +- [f] | | | | | 0 | | | | | | | | | +- Expected Cost Body | | | | | | | | | | | `- 1/3 | | | | | | | | | +- linear-template | | | | | | | | | | | `- 1 + [j | j 0] | | | | | | | | | +- [Norms] | | | | | [[1 | ],[j | j 0]] | | | | | | | | | +- [Invariant] | | | | | j 1 ==> 1/3 + h([1 | ],1/3[-1 + j | -1 + j 0] + 2/3[j | j 0]) h([1 | ],[j | j 0]) | | | | | 1 1 + j ==> 0 h([1 | ],[j | j 0]) | | | | | | | | | `- [j | j 0] | | | | | | | `- [j | j 0] | | | | | +- Expected Cost | | | | | | | +- [f] | | | | 0 | | | | | | | +- [Program] | | | | sample :~ {1/2 : 0;1/2 : 1} | | | | n :~ {1 : n + -sample} | | | | | | | `- 0 | | | | | +- Expected Cost | | | | | | | +- [f] | | | | 0 | | | | | | | +- [Program] | | | | 1:While(j 1) | | | | Choice | | | | 1/3: j :~ {1 : -1 + j} | | | | Tick(1) | | | | 2/3: Skip | | | | | | | `- 0 | | | | | `- [n | n 0] | | | +- mixed-iteration-template | | | | | `- [n | n 0] + [n | n 0]^2 | | | +- [Norms] | | [[n | n 0],[n^2 | n 0]] | | | +- [Invariant] | | n 1 ==> [n | n 0] + h(1/2[n | n 0] + 1/2[-1 + n | -1 + n 0],1/2[n^2 | n 0] + 1/2[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]) | | | `- [n | n 0] + [n^2 | n 0] | `- [n | n 0] + [n^2 | n 0] [Success] [n | n 0] + [n^2 | n 0] Degree: 2