aiming low is harder
play

Aiming Low is Harder Induction for Lower Bounds in Probabilistic - PowerPoint PPT Presentation

Aiming Low is Harder Induction for Lower Bounds in Probabilistic Program Verification Marcel Hark Benjamin Kaminski Jrgen Giesl Joost-Pieter Katoen POPL 2020 Aiming Low is Harder Hark , Kaminski, Giesl, Katoen 1/25/20 1


  1. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  2. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  3. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  4. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  5. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  6. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  7. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  8. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  9. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  10. Motivation Setting the stage � lfp λ E . [ a � = 1 ] · f + [ a = 1 ] · 1 � lfp λ E . [ a � = 1 ] · x + [ a = 1 ] · 1 � � � lfp Φ f � 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } � f � � x � • lfp Φ x = lim n → ω Φ n x ( 0 ) (incomputable). → Initial value of x is unknown. → We need bounds on least fixed points. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 3

  11. Motivation Outline Motivation Upper Bounds [Park] Lower Bounds Conclusion POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 4

  12. Upper Bounds [Park] Outline Motivation Upper Bounds [Park] Lower Bounds Conclusion POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 5

  13. Upper Bounds [Park] Park Induction while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) E ≥ Φ x ( E ) = ⇒ E ≥ lfp Φ x (Superinvariant). := x + [ a = 1 ] (Intuitive guess) E Φ x ( E ) = E → E is an upper bound on lfp Φ x . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 6

  14. Upper Bounds [Park] Park Induction while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) E ≥ Φ x ( E ) = ⇒ E ≥ lfp Φ x (Superinvariant). := x + [ a = 1 ] (Intuitive guess) E Φ x ( E ) = E → E is an upper bound on lfp Φ x . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 6

  15. Upper Bounds [Park] Park Induction while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) E ≥ Φ x ( E ) = ⇒ E ≥ lfp Φ x (Superinvariant). := x + [ a = 1 ] (Intuitive guess) E Φ x ( E ) = E → E is an upper bound on lfp Φ x . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 6

  16. Upper Bounds [Park] Park Induction while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) E ≥ Φ x ( E ) = ⇒ E ≥ lfp Φ x (Superinvariant). := x + [ a = 1 ] (Intuitive guess) E Φ x ( E ) = E → E is an upper bound on lfp Φ x . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 6

  17. Upper Bounds [Park] Park Induction while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) E ≥ Φ x ( E ) = ⇒ E ≥ lfp Φ x (Superinvariant). := x + [ a = 1 ] (Intuitive guess) E Φ x ( E ) = E → E is an upper bound on lfp Φ x . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 6

  18. Upper Bounds [Park] Park Induction while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) E ≥ Φ x ( E ) = ⇒ E ≥ lfp Φ x (Superinvariant). := x + [ a = 1 ] (Intuitive guess) E Φ x ( E ) = E → E is an upper bound on lfp Φ x . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 6

  19. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  20. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  21. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  22. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. E Φ x ( E ) lfp Φ x POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  23. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. E Φ 2 x ( E ) lfp Φ x POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  24. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. E Φ ω x ( E ) lfp Φ x POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  25. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. E Φ ω x ( E ) lfp Φ x POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  26. Upper Bounds [Park] Upper Bounds • Rule for upper bounds Φ f ( E ) ≥ E is simple. (Inductive) • Not a surprise, bound a least fixed point from above. → Enough to bound any fixed point from above. E Φ ω x ( E ) lfp Φ x POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 7

  27. Upper Bounds [Park] Upper Bounds No information on quality of the bound. → We also need lower bounds. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 8

  28. Upper Bounds [Park] Upper Bounds No information on quality of the bound. → We also need lower bounds. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 8

  29. Upper Bounds [Park] Upper Bounds No information on quality of the bound. → We also need lower bounds. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 8

  30. Lower Bounds Outline Motivation Upper Bounds [Park] Lower Bounds Conclusion POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 9

  31. Lower Bounds Subinvariants E ≥ Φ x ( E ) E ≤ Φ x ( E ) = = ⇒ ⇒ E ≥ lfp Φ x (Superinvariant). E ≤ lfp Φ x (Subinvariant) ???. Not absurd: Sound for deterministic programs. [Frohn et al. 16] POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 10

  32. Lower Bounds Subinvariants E ≥ Φ x ( E ) E ≤ Φ x ( E ) = = ⇒ ⇒ E ≥ lfp Φ x (Superinvariant). E ≤ lfp Φ x (Subinvariant) ???. Not absurd: Sound for deterministic programs. [Frohn et al. 16] POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 10

  33. Lower Bounds Subinvariants E ≥ Φ x ( E ) E ≤ Φ x ( E ) = = ⇒ ⇒ E ≥ lfp Φ x (Superinvariant). E ≤ lfp Φ x (Subinvariant) ???. Not absurd: Sound for deterministic programs. [Frohn et al. 16] POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 10

  34. Lower Bounds Subinvariants E ≥ Φ x ( E ) E ≤ Φ x ( E ) = = ⇒ ⇒ E ≥ lfp Φ x (Superinvariant). E ≤ lfp Φ x (Subinvariant) ???. Not absurd: Sound for deterministic programs. [Frohn et al. 16] POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 10

  35. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) . E ′ := x + [ a = 1 ] · ( 1 + 2 x ) → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ??? → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ��� • Already seen upper bound by superinvariant E = x + [ a = 1 ] . E ′ �≤ E . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 11

  36. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) . E ′ := x + [ a = 1 ] · ( 1 + 2 x ) → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ??? → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ��� • Already seen upper bound by superinvariant E = x + [ a = 1 ] . E ′ �≤ E . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 11

  37. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) . E ′ := x + [ a = 1 ] · ( 1 + 2 x ) → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ??? → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ��� • Already seen upper bound by superinvariant E = x + [ a = 1 ] . E ′ �≤ E . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 11

  38. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) . E ′ := x + [ a = 1 ] · ( 1 + 2 x ) → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ??? → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ��� • Already seen upper bound by superinvariant E = x + [ a = 1 ] . E ′ �≤ E . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 11

  39. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) . E ′ := x + [ a = 1 ] · ( 1 + 2 x ) → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ??? → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ��� • Already seen upper bound by superinvariant E = x + [ a = 1 ] . E ′ �≤ E . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 11

  40. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } Φ x ( E ) = [ a � = 1 ] · x + [ a = 1 ] · 1 2 · ( E [ a / 0 ] + E [ x / x + 1 ]) . E ′ := x + [ a = 1 ] · ( 1 + 2 x ) → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ??? → E ′ ≤ Φ x ( E ′ ) , so E ′ is a lower bound ��� • Already seen upper bound by superinvariant E = x + [ a = 1 ] . E ′ �≤ E . POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 11

  41. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants → Subinvariants are i.g. not sound for lower bounds. → Additional requirements to extract lower bound. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 12

  42. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants → Subinvariants are i.g. not sound for lower bounds. → Additional requirements to extract lower bound. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 12

  43. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants → Subinvariants are i.g. not sound for lower bounds. → Additional requirements to extract lower bound. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 12

  44. Lower Bounds E ≤ Φ x ( E ) = ⇒ E ≤ lfp Φ x Subinvariants Φ ω x ( E ) → Subinvariants are i.g. not sound for lower bounds. E → Additional requirements to extract lower bound. lfp Φ x POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 12

  45. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  46. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  47. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  48. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  49. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. E ( s ) • C • • ... � � • E ( τ 1 ) E ( τ 2 ) E ( τ 3 ) Exp POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  50. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. E ( s ) • C • • ... � � • E ( τ 1 ) E ( τ 2 ) E ( τ 3 ) Exp POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  51. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. E ( s ) • C • • ... � � • E ( τ 1 ) E ( τ 2 ) E ( τ 3 ) Exp POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  52. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ additional requirements E ≤ Φ f ( E ) E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ∧ = = = ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . ⇒ E ≤ lfp Φ f . 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for easily checkable K ∈ R ≥ 0 K ∈ R ≥ 0 1. Expected finite number of loop iterations. 2. Expected change is bounded by constant. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 13

  53. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � → Rule is not applicable! λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 1 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 � 1 ≥ [ a = 1 ] · ( 1 + 2 x ) ��� = → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  54. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � → Rule is not applicable! λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 1 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 � 1 ≥ [ a = 1 ] · ( 1 + 2 x ) ��� = → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  55. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  56. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  57. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  58. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  59. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  60. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  61. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  62. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  63. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  64. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  65. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  66. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  67. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  68. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  69. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  70. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  71. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  72. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  73. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  74. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  75. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Our Rule Our Rule 1. Exp ( T ¬ ϕ ) < ∞ 1. Exp ( T ¬ ϕ ) < ∞ E ≤ Φ f ( E ) E ≤ Φ f ( E ) ∧ ∧ ⇒ E ≤ wp � loop � ( f ) . ⇒ E ≤ wp � loop � ( f ) . = = 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for 2. λ s . [ ϕ ] wp � C � ( | E − E ( s ) | ) ≤ K for K ∈ R ≥ 0 K ∈ R ≥ 0 while ( a = 1 ) { � { x := x + 1 } � 1 { a := 0 } 2 } E ′ = x + [ a = 1 ] · ( 1 + 2 x ) = x + [ a = 1 ] → Easily checkable. E � � � { x := x + 1 } � { x := x + 1 } T ( a � = 1 ) � ≤ 2 · [ a = 1 ] < ∞ . � � ( | E ′ − E ′ ( s ) | ) ( s ) → Good, since E ′ is not a lower bound. � 1 � 1 � λ s . [ a = 1 ] · wp λ s . [ a = 1 ] · wp → Rule is not applicable! { a := 0 } { a := 0 } ( | E − E ( s ) | ) ( s ) Expected finite looping time: Exp → E is a lower bound. � � { a := 0 } � { x := x + 1 } � � 2 2 2 · | x + [ 0 = 1 ] − ( x + [ a = 1 ]) | + 1 1 � 1 = ≥ [ a = 1 ] · ( 1 + 2 x ) ��� → E = wp while ( a = 1 ) 2 · | x + 1 + [ a = 1 ] − ( x + [ a = 1 ]) | ( x ) . 2 = 2 · |− [ a = 1 ] | + 1 1 2 · | 1 | ≤ 1 = K (constant) POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 14

  76. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Contribution To best of our knowledge: → First inductive rule for lower bounds. → No reasoning about limits of sequences. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 15

  77. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Contribution To best of our knowledge: → First inductive rule for lower bounds. → No reasoning about limits of sequences. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 15

  78. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Contribution To best of our knowledge: → First inductive rule for lower bounds. → No reasoning about limits of sequences. POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 15

  79. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) N · H N = N · ( 1 + 1 2 + · · · + 1 T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. H N appears in real world algorithm-analysis! POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  80. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) N · H N = N · ( 1 + 1 2 + · · · + 1 T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. H N appears in real world algorithm-analysis! POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  81. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) N · H N = N · ( 1 + 1 2 + · · · + 1 T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. H N appears in real world algorithm-analysis! POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  82. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) N · H N = N · ( 1 + 1 2 + · · · + 1 T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. H N appears in real world algorithm-analysis! POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  83. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) x := N N · H N = N · ( 1 + 1 2 + · · · + 1 while ( 0 < x ) { T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. i := N + 1 while ( x < i ) { H N appears in real world algorithm-analysis! i := Unif [ 1 .. N ] } x := x − 1 } POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  84. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) x := N N · H N = N · ( 1 + 1 2 + · · · + 1 while ( 0 < x ) { T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. i := N + 1 while ( x < i ) { H N appears in real world algorithm-analysis! i := Unif [ 1 .. N ] } x := x − 1 } POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  85. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) x := N N · H N = N · ( 1 + 1 2 + · · · + 1 while ( 0 < x ) { T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. i := N + 1 while ( x < i ) { H N appears in real world algorithm-analysis! i := Unif [ 1 .. N ] } x := x − 1 } POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

  86. Lower Bounds wp � while ( ϕ ) { C } � ( f ) Lower Bounds for Expected Runtimes • Similar rule for expected runtimes (ert [Kaminski et al. 16]). • Only side condition: λ s . [ ϕ ] wp � C � ( | T − T ( s ) | ) ≤ K for K ∈ R ≥ 0 . Coupon Collector : T = [ 0 < x ≤ N ] · N · H x + [ N < x ] · ( N · H N + N − x ) x := N N · H N = N · ( 1 + 1 2 + · · · + 1 while ( 0 < x ) { T [ x / N ] N ) is lower bound. Lower bound is strict but asymptotically optimal. i := N + 1 while ( x < i ) { H N appears in real world algorithm-analysis! i := Unif [ 1 .. N ] } x := x − 1 } POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 16

Recommend


More recommend