theory ComputeHOL imports Complex_Main "Compute_Oracle/Compute_Oracle" begin
lemma Trueprop_eq_eq: "Trueprop X == (X == True)"by (simp add: atomize_eq) lemma meta_eq_trivial: "x == y \ x == y" by simp lemma meta_eq_imp_eq: "x == y \ x = y" by auto lemma eq_trivial: "x = y \ x = y" by auto lemma bool_to_true: "x :: bool \ x == True" by simp lemma transmeta_1: "x = y \ y == z \ x = z" by simp lemma transmeta_2: "x == y \ y = z \ x = z" by simp lemma transmeta_3: "x == y \ y == z \ x = z" by simp
(**** compute_if ****)
lemma If_True: "If True = (\ x y. x)" by ((rule ext)+,auto) lemma If_False: "If False = (\ x y. y)" by ((rule ext)+, auto)
ML \<open> signature ComputeHOL =
sig
val prep_thms : thm list -> thm list
val to_meta_eq : thm -> thm
val to_hol_eq : thm -> thm
val symmetric : thm -> thm
val trans : thm -> thm -> thm end
structure ComputeHOL : ComputeHOL =
struct
local fun lhs_of eq = fst (Thm.dest_equals (Thm.cprop_of eq)); in fun rewrite_conv [] ct = raise CTERM ("rewrite_conv", [ct])
| rewrite_conv (eq :: eqs) ct = Thm.instantiate (Thm.match (lhs_of eq, ct)) eq
handle Pattern.MATCH => rewrite_conv eqs ct; end
val convert_conditions = Conv.fconv_rule (Conv.prems_conv ~1 (Conv.try_conv (rewrite_conv [@{thm"Trueprop_eq_eq"}])))
val eq_th = @{thm"HOL.eq_reflection"}
val meta_eq_trivial = @{thm"ComputeHOL.meta_eq_trivial"}
val bool_to_true = @{thm"ComputeHOL.bool_to_true"}
fun to_meta_eq th = eq_th OF [th] handle THM _ => meta_eq_trivial OF [th] handle THM _ => bool_to_true OF [th]
fun to_hol_eq th = @{thm"meta_eq_imp_eq"} OF [th] handle THM _ => @{thm"eq_trivial"} OF [th]
fun prep_thms ths = map (convert_conditions o to_meta_eq) ths
fun symmetric th = @{thm"HOL.sym"} OF [th] handle THM _ => @{thm"Pure.symmetric"} OF [th]
local
val trans_HOL = @{thm"HOL.trans"}
val trans_HOL_1 = @{thm"ComputeHOL.transmeta_1"}
val trans_HOL_2 = @{thm"ComputeHOL.transmeta_2"}
val trans_HOL_3 = @{thm"ComputeHOL.transmeta_3"} fun tr [] th1 th2 = trans_HOL OF [th1, th2]
| tr (t::ts) th1 th2 = (t OF [th1, th2] handle THM _ => tr ts th1 th2) in fun trans th1 th2 = tr [trans_HOL, trans_HOL_1, trans_HOL_2, trans_HOL_3] th1 th2 end
end \<close>
end
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.