diff --git a/lib/Monad_WP/OptionMonad.thy b/lib/Monad_WP/OptionMonad.thy index bee69c828..1d1eee899 100644 --- a/lib/Monad_WP/OptionMonad.thy +++ b/lib/Monad_WP/OptionMonad.thy @@ -223,6 +223,14 @@ lemma obind_eqI: "\ f s = f s' ; \x. f s = Some x \ g x s = g' x s' \ \ obind f g s = obind f g' s'" by (simp add: obind_def split: option.splits) +(* full form of obind_eqI; the second equality makes more sense flipped here, as we end up + with "f s = Some x ; f s' = f s" preventing "Some x = ..." *) +lemma obind_eqI_full: + "\ f s = f s' ; \x. \ f s = Some x; f s' = f s \ \ g x s = g' x s' \ + \ obind f g s = obind f g' s'" + by (drule sym[where s="f s"]) (* prevent looping *) + (clarsimp simp: obind_def split: option.splits) + lemma obindE: "\ (f |>> g) s = Some v; \v'. \f s = Some v'; g v' s = Some v\ \ P\ \ P"