lemma execute_bind_case
authorhaftmann
Fri, 13 Aug 2010 14:45:07 +0200
changeset 386359ee71ec7db4e
parent 38634 721b4d6095b7
child 38636 8e4058f4848c
child 38668 1e1ef69ec0de
lemma execute_bind_case
src/HOL/Imperative_HOL/Heap_Monad.thy
     1.1 --- a/src/HOL/Imperative_HOL/Heap_Monad.thy	Fri Aug 13 14:43:16 2010 +0200
     1.2 +++ b/src/HOL/Imperative_HOL/Heap_Monad.thy	Fri Aug 13 14:45:07 2010 +0200
     1.3 @@ -274,6 +274,11 @@
     1.4    "execute f h = None \<Longrightarrow> execute (f \<guillemotright>= g) h = None"
     1.5    by (simp_all add: bind_def)
     1.6  
     1.7 +lemma execute_bind_case:
     1.8 +  "execute (f \<guillemotright>= g) h = (case (execute f h) of
     1.9 +    Some (x, h') \<Rightarrow> execute (g x) h' | None \<Rightarrow> None)"
    1.10 +  by (simp add: bind_def)
    1.11 +
    1.12  lemma execute_bind_success:
    1.13    "success f h \<Longrightarrow> execute (f \<guillemotright>= g) h = execute (g (fst (the (execute f h)))) (snd (the (execute f h)))"
    1.14    by (cases f h rule: Heap_cases) (auto elim!: successE simp add: bind_def)