src/HOL/Imperative_HOL/Heap_Monad.thy
changeset 37816 e550439d4422
parent 37792 ba0bc31b90d7
child 37828 9e1758c7ff06
equal deleted inserted replaced
37815:053d23f08946 37816:e550439d4422
   264                   Some (x, h') \<Rightarrow> execute (g x) h'
   264                   Some (x, h') \<Rightarrow> execute (g x) h'
   265                 | None \<Rightarrow> None)"
   265                 | None \<Rightarrow> None)"
   266 
   266 
   267 setup {*
   267 setup {*
   268   Adhoc_Overloading.add_variant 
   268   Adhoc_Overloading.add_variant 
   269     @{const_name Monad_Syntax.bindM} @{const_name Heap_Monad.bind}
   269     @{const_name Monad_Syntax.bind} @{const_name Heap_Monad.bind}
   270 *}
   270 *}
   271 
       
   272 
   271 
   273 lemma execute_bind [execute_simps]:
   272 lemma execute_bind [execute_simps]:
   274   "execute f h = Some (x, h') \<Longrightarrow> execute (f \<guillemotright>= g) h = execute (g x) h'"
   273   "execute f h = Some (x, h') \<Longrightarrow> execute (f \<guillemotright>= g) h = execute (g x) h'"
   275   "execute f h = None \<Longrightarrow> execute (f \<guillemotright>= g) h = None"
   274   "execute f h = None \<Longrightarrow> execute (f \<guillemotright>= g) h = None"
   276   by (simp_all add: bind_def)
   275   by (simp_all add: bind_def)