src/HOL/Code_Eval.thy
changeset 31048 ac146fc38b51
parent 31031 cbec39ebf8f2
child 31139 0b615ac7eeaf
equal deleted inserted replaced
31047:c13b0406c039 31048:ac146fc38b51
    31 ML {*
    31 ML {*
    32 structure Eval =
    32 structure Eval =
    33 struct
    33 struct
    34 
    34 
    35 fun mk_term f g (Const (c, ty)) =
    35 fun mk_term f g (Const (c, ty)) =
    36       @{term Const} $ Message_String.mk c $ g ty
    36       @{term Const} $ HOLogic.mk_message_string c $ g ty
    37   | mk_term f g (t1 $ t2) =
    37   | mk_term f g (t1 $ t2) =
    38       @{term App} $ mk_term f g t1 $ mk_term f g t2
    38       @{term App} $ mk_term f g t1 $ mk_term f g t2
    39   | mk_term f g (Free v) = f v
    39   | mk_term f g (Free v) = f v
    40   | mk_term f g (Bound i) = Bound i
    40   | mk_term f g (Bound i) = Bound i
    41   | mk_term f g (Abs (v, _, t)) = Abs (v, @{typ term}, mk_term f g t);
    41   | mk_term f g (Abs (v, _, t)) = Abs (v, @{typ term}, mk_term f g t);
   152 
   152 
   153 code_const Const and App
   153 code_const Const and App
   154   (Eval "Term.Const/ (_, _)" and "Term.$/ (_, _)")
   154   (Eval "Term.Const/ (_, _)" and "Term.$/ (_, _)")
   155 
   155 
   156 code_const "term_of \<Colon> message_string \<Rightarrow> term"
   156 code_const "term_of \<Colon> message_string \<Rightarrow> term"
   157   (Eval "Message'_String.mk")
   157   (Eval "HOLogic.mk'_message'_string")
       
   158 
       
   159 code_reserved Eval HOLogic
   158 
   160 
   159 
   161 
   160 subsection {* Evaluation setup *}
   162 subsection {* Evaluation setup *}
   161 
   163 
   162 ML {*
   164 ML {*