Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Loom/WP/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ theorem tryCatch_OptionT_wp [Monad m] [Assertion Pred] [Assertion EPred] [WP m P
(h : PUnit → OptionT m α) :
wp x post ⟨wp (h ⟨⟩) post epost, epost.tail⟩ ⊑
wp (MonadExceptOf.tryCatch x h : OptionT m α) post epost := by
simp only [wp, MonadExceptOf.tryCatch, OptionT.tryCatch, OptionT.mk, OptionT.run]
simp only [wp, MonadExceptOf.tryCatch, OptionT.tryCatch, OptionT.mk]
apply PartialOrder.rel_trans; rotate_left; apply WP.wp_bind
apply WP.wp_consequence (m := m); intro o; cases o with
| some a =>
Expand Down Expand Up @@ -316,7 +316,7 @@ theorem lift_ExceptT_wp [Monad m] [Assertion Pred] [Assertion EPred] [WP m Pred
theorem monadLift_OptionT_wp [Monad m] [Assertion Pred] [Assertion EPred] [WP m Pred EPred] (x : m α) :
wp x post epost.tail ⊑
wp (MonadLift.monadLift x : OptionT m α) post epost := by
simp only [wp, MonadLift.monadLift, OptionT.mk, OptionT.lift, OptionT.run]
simp only [wp, MonadLift.monadLift, OptionT.mk, OptionT.lift]
apply PartialOrder.rel_trans; rotate_left; apply WP.wp_bind
apply WP.wp_consequence (m := m); intro a
apply PartialOrder.rel_trans; rotate_left; apply WP.wp_pure
Expand Down Expand Up @@ -676,7 +676,7 @@ theorem orElse_OptionT_wp [Monad m] [Assertion Pred] [Assertion EPred] [WP m Pre
(h : Unit → OptionT m α) :
wp x post ⟨wp (h ()) post epost, epost.tail⟩ ⊑
wp (OrElse.orElse x h : OptionT m α) post epost := by
simp only [wp, OrElse.orElse, OptionT.run]
simp only [wp, OrElse.orElse]
apply PartialOrder.rel_trans; rotate_left; apply WP.wp_bind
apply WP.wp_consequence (m := m); intro o; cases o with
| some a =>
Expand Down