src/HOL/Imperative_HOL/Mrec.thy
changeset 39754 150f831ce4a3
parent 37792 ba0bc31b90d7
child 40671 5e46057ba8e0
equal deleted inserted replaced
39753:ec6dfd9ce573 39754:150f831ce4a3
    52           (case mrec s h' of
    52           (case mrec s h' of
    53              Some (z, h'') \<Rightarrow> execute (g x s z) h''
    53              Some (z, h'') \<Rightarrow> execute (g x s z) h''
    54            | None \<Rightarrow> None)
    54            | None \<Rightarrow> None)
    55    | None \<Rightarrow> None
    55    | None \<Rightarrow> None
    56    )"
    56    )"
    57 apply (cases "mrec_dom (x,h)", simp)
    57 apply (cases "mrec_dom (x,h)", simp add: mrec.psimps)
    58 apply (frule mrec_default)
    58 apply (frule mrec_default)
    59 apply (frule mrec_di_reverse, simp)
    59 apply (frule mrec_di_reverse, simp)
    60 by (auto split: sum.split option.split simp: mrec_default)
    60 by (auto split: sum.split option.split simp: mrec_default)
    61 
    61 
    62 definition
    62 definition
   103       note Inl' = this
   103       note Inl' = this
   104       show ?thesis
   104       show ?thesis
   105       proof (cases a)
   105       proof (cases a)
   106         case (Inl aa)
   106         case (Inl aa)
   107         from this Inl' 1(1) exec_f mrec non_rec_case show ?thesis
   107         from this Inl' 1(1) exec_f mrec non_rec_case show ?thesis
   108           by auto
   108           by (auto simp: mrec.psimps)
   109       next
   109       next
   110         case (Inr b)
   110         case (Inr b)
   111         note Inr' = this
   111         note Inr' = this
   112         show ?thesis
   112         show ?thesis
   113         proof (cases "mrec b h1")
   113         proof (cases "mrec b h1")
   120           moreover note mrec mrec_rec exec_f Inl' Inr' 1(1) 1(3)
   120           moreover note mrec mrec_rec exec_f Inl' Inr' 1(1) 1(3)
   121           ultimately show ?thesis
   121           ultimately show ?thesis
   122             apply auto
   122             apply auto
   123             apply (rule rec_case)
   123             apply (rule rec_case)
   124             apply auto
   124             apply auto
   125             unfolding MREC_def by auto
   125             unfolding MREC_def by (auto simp: mrec.psimps)
   126         next
   126         next
   127           case None
   127           case None
   128           from this 1(1) exec_f mrec Inr' 1(3) show ?thesis by auto
   128           from this 1(1) exec_f mrec Inr' 1(3) show ?thesis by (auto simp: mrec.psimps)
   129         qed
   129         qed
   130       qed
   130       qed
   131     next
   131     next
   132       case None
   132       case None
   133       from this 1(1) mrec 1(3) show ?thesis by simp
   133       from this 1(1) mrec 1(3) show ?thesis by (simp add: mrec.psimps)
   134     qed
   134     qed
   135   qed
   135   qed
   136   from this h'_r show ?thesis by simp
   136   from this h'_r show ?thesis by simp
   137 qed
   137 qed
   138 
   138