src/HOL/Product_Type.thy
changeset 43654 3f1a44c2d645
parent 43595 7ae4a23b5be6
child 43866 8a50dc70cbff
equal deleted inserted replaced
43653:905f17258bca 43654:3f1a44c2d645
    25     and [code]: "HOL.equal True P \<longleftrightarrow> P" 
    25     and [code]: "HOL.equal True P \<longleftrightarrow> P" 
    26     and [code]: "HOL.equal P False \<longleftrightarrow> \<not> P" 
    26     and [code]: "HOL.equal P False \<longleftrightarrow> \<not> P" 
    27     and [code]: "HOL.equal P True \<longleftrightarrow> P"
    27     and [code]: "HOL.equal P True \<longleftrightarrow> P"
    28     and [code nbe]: "HOL.equal P P \<longleftrightarrow> True"
    28     and [code nbe]: "HOL.equal P P \<longleftrightarrow> True"
    29   by (simp_all add: equal)
    29   by (simp_all add: equal)
       
    30 
       
    31 lemma If_case_cert:
       
    32   assumes "CASE \<equiv> (\<lambda>b. If b f g)"
       
    33   shows "(CASE True \<equiv> f) &&& (CASE False \<equiv> g)"
       
    34   using assms by simp_all
       
    35 
       
    36 setup {*
       
    37   Code.add_case @{thm If_case_cert}
       
    38 *}
    30 
    39 
    31 code_const "HOL.equal \<Colon> bool \<Rightarrow> bool \<Rightarrow> bool"
    40 code_const "HOL.equal \<Colon> bool \<Rightarrow> bool \<Rightarrow> bool"
    32   (Haskell infix 4 "==")
    41   (Haskell infix 4 "==")
    33 
    42 
    34 code_instance bool :: equal
    43 code_instance bool :: equal