# HG changeset patch # User haftmann # Date 1202118759 -3600 # Node ID 8bf9e480a7b81144496350436700925313b2ad3c # Parent f9e779f119491ccf5ac03cecf3c384b6a36c5bc9 suppport for messages and indices diff -r f9e779f11949 -r 8bf9e480a7b8 src/HOL/Library/Eval.thy --- a/src/HOL/Library/Eval.thy Mon Feb 04 10:52:37 2008 +0100 +++ b/src/HOL/Library/Eval.thy Mon Feb 04 10:52:39 2008 +0100 @@ -6,7 +6,9 @@ header {* A simple term evaluation mechanism *} theory Eval -imports ATP_Linkup Code_Message +imports + ATP_Linkup Code_Message + Code_Index (* this theory is just imported for a term_of setup *) begin subsection {* Type reflection *} @@ -80,6 +82,7 @@ open Eval; in Eval.add_typ_of_def @{type_name prop} + #> Eval.add_typ_of_def @{type_name fun} #> Eval.add_typ_of_def @{type_name itself} #> Eval.add_typ_of_def @{type_name bool} #> Eval.add_typ_of_def @{type_name set} @@ -182,7 +185,8 @@ |-> (fn no_term_of => no_term_of ? add_term_of_def ty vs tyco) end; in - Code.type_interpretation interpretator + Eval.add_typ_of_def @{type_name fun} + #> Code.type_interpretation interpretator end *} @@ -231,6 +235,10 @@ lemmas [code func del] = term.recs term.cases term.size lemma [code func, code func del]: "(t1\term) = t2 \ t1 = t2" .. + +lemma [code func, code func del]: "(term_of \ typ \ term) = term_of" .. +lemma [code func, code func del]: "(term_of \ term \ term) = term_of" .. +lemma [code func, code func del]: "(term_of \ index \ term) = term_of" .. lemma [code func, code func del]: "(term_of \ message_string \ term) = term_of" .. code_type "term" @@ -239,6 +247,13 @@ code_const Const and App (SML "Term.Const/ (_, _)" and "Term.$/ (_, _)") +code_const "term_of \ index \ term" + (SML "HOLogic.mk'_number/ HOLogic.indexT") + +code_const "term_of \ message_string \ term" + (SML "Message'_String.mk") + + subsection {* Evaluation setup *} ML {*