src/HOL/Library/Eval.thy
changeset 26267 ba710daf77a7
parent 26242 d64510d3c7b7
child 26587 58fb6e033c00
equal deleted inserted replaced
26266:35ae83ca190a 26267:ba710daf77a7
    44 
    44 
    45 fun mk_term f g (Const (c, ty)) =
    45 fun mk_term f g (Const (c, ty)) =
    46       @{term Const} $ Message_String.mk c $ g ty
    46       @{term Const} $ Message_String.mk c $ g ty
    47   | mk_term f g (t1 $ t2) =
    47   | mk_term f g (t1 $ t2) =
    48       @{term App} $ mk_term f g t1 $ mk_term f g t2
    48       @{term App} $ mk_term f g t1 $ mk_term f g t2
    49   | mk_term f g (Free v) = f v;
    49   | mk_term f g (Free v) = f v
       
    50   | mk_term f g (Bound i) = Bound i;
    50 
    51 
    51 fun mk_term_of ty t = Const (@{const_name term_of}, ty --> @{typ term}) $ t;
    52 fun mk_term_of ty t = Const (@{const_name term_of}, ty --> @{typ term}) $ t;
    52 
    53 
    53 end;
    54 end;
    54 *}
    55 *}
   155 subsection {* Evaluation setup *}
   156 subsection {* Evaluation setup *}
   156 
   157 
   157 ML {*
   158 ML {*
   158 signature EVAL =
   159 signature EVAL =
   159 sig
   160 sig
       
   161   val mk_term: ((string * typ) -> term) -> (typ -> term) -> term -> term
   160   val eval_ref: (unit -> term) option ref
   162   val eval_ref: (unit -> term) option ref
   161   val eval_term: theory -> term -> term
   163   val eval_term: theory -> term -> term
   162   val evaluate: Proof.context -> term -> unit
   164   val evaluate: Proof.context -> term -> unit
   163   val evaluate': string -> Proof.context -> term -> unit
   165   val evaluate': string -> Proof.context -> term -> unit
   164   val evaluate_cmd: string option -> string -> Toplevel.state -> unit
   166   val evaluate_cmd: string option -> string -> Toplevel.state -> unit
   232     (@{const_syntax dummy_term}, tr2')]
   234     (@{const_syntax dummy_term}, tr2')]
   233 end
   235 end
   234 *}
   236 *}
   235 
   237 
   236 hide (open) const term_of
   238 hide (open) const term_of
   237 hide const Const App dummy_term
   239 hide (open) const Const App
   238 
   240 hide const dummy_term
   239 end
   241 
       
   242 end