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
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
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
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
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
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
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
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
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
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
Motivation Outline Motivation Upper Bounds [Park] Lower Bounds Conclusion POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 4
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Lower Bounds Outline Motivation Upper Bounds [Park] Lower Bounds Conclusion POPL 2020– Aiming Low is Harder – Hark , Kaminski, Giesl, Katoen – 1/25/20 – 9
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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