src/Tools/Code/code_runtime.ML
changeset 39422 9019b6afaa4a
parent 39404 a8c337299bc1
child 39473 33638f4883ac
equal deleted inserted replaced
39421:b6a77cffc231 39422:9019b6afaa4a
     8 sig
     8 sig
     9   val target: string
     9   val target: string
    10   val value: string option
    10   val value: string option
    11     -> (Proof.context -> unit -> 'a) * ((unit -> 'a) -> Proof.context -> Proof.context) * string
    11     -> (Proof.context -> unit -> 'a) * ((unit -> 'a) -> Proof.context -> Proof.context) * string
    12     -> ((term -> term) -> 'a -> 'a) -> theory -> term -> string list -> 'a
    12     -> ((term -> term) -> 'a -> 'a) -> theory -> term -> string list -> 'a
       
    13   val code_reflect: (string * string list) list -> string list -> string -> string option
       
    14     -> theory -> theory
    13   val setup: theory -> theory
    15   val setup: theory -> theory
    14 end;
    16 end;
    15 
    17 
    16 structure Code_Runtime : CODE_RUNTIME =
    18 structure Code_Runtime : CODE_RUNTIME =
    17 struct
    19 struct
    18 
    20 
    19 (** evaluation **)
    21 (** evaluation **)
    20 
    22 
    21 val target = "Eval";
    23 val target = "Eval";
       
    24 
       
    25 val truth_struct = "Code_Truth";
    22 
    26 
    23 fun value some_target cookie postproc thy t args =
    27 fun value some_target cookie postproc thy t args =
    24   let
    28   let
    25     val ctxt = ProofContext.init_global thy;
    29     val ctxt = ProofContext.init_global thy;
    26     fun evaluator naming program ((_, (_, ty)), t) deps =
    30     fun evaluator naming program ((_, (_, ty)), t) deps =
   182   in
   186   in
   183     thy
   187     thy
   184     |> process result module_name some_file
   188     |> process result module_name some_file
   185   end;
   189   end;
   186 
   190 
   187 val code_reflect = gen_code_reflect Code_Target.cert_tyco Code.check_const;
   191 val code_reflect = gen_code_reflect Code_Target.cert_tyco (K I);
   188 val code_reflect_cmd = gen_code_reflect Code_Target.read_tyco Code.read_const;
   192 val code_reflect_cmd = gen_code_reflect Code_Target.read_tyco Code.read_const;
   189 
   193 
   190 
   194 
   191 (** Isar setup **)
   195 (** Isar setup **)
   192 
   196