src/Tools/Code/code_runtime.ML
changeset 64988 93aaff2b0ae0
parent 64987 1985502518ce
child 64989 40c36a4aee1f
equal deleted inserted replaced
64987:1985502518ce 64988:93aaff2b0ae0
    31   val code_reflect: (string * string list option) list -> string list -> string
    31   val code_reflect: (string * string list option) list -> string list -> string
    32     -> string option -> theory -> theory
    32     -> string option -> theory -> theory
    33   datatype truth = Holds
    33   datatype truth = Holds
    34   val put_truth: (unit -> truth) -> Proof.context -> Proof.context
    34   val put_truth: (unit -> truth) -> Proof.context -> Proof.context
    35   val mount_computation: Proof.context -> (string * typ) list -> typ
    35   val mount_computation: Proof.context -> (string * typ) list -> typ
    36     -> (term -> 'ml) -> ((term -> term) -> 'ml -> 'a) -> Proof.context -> term -> 'a
    36     -> (term -> 'ml) -> ((term -> term) -> 'ml option -> 'a) -> Proof.context -> term -> 'a
    37   val polyml_as_definition: (binding * typ) list -> Path.T list -> theory -> theory
    37   val polyml_as_definition: (binding * typ) list -> Path.T list -> theory -> theory
    38   val trace: bool Config.T
    38   val trace: bool Config.T
    39 end;
    39 end;
    40 
    40 
    41 structure Code_Runtime : CODE_RUNTIME =
    41 structure Code_Runtime : CODE_RUNTIME =
   352 
   352 
   353 fun checked_computation cTs T raw_computation ctxt =
   353 fun checked_computation cTs T raw_computation ctxt =
   354   check_typ ctxt T
   354   check_typ ctxt T
   355   #> reject_vars ctxt
   355   #> reject_vars ctxt
   356   #> check_computation_input ctxt cTs
   356   #> check_computation_input ctxt cTs
   357   #> raw_computation;
   357   #> Exn.capture raw_computation
       
   358   #> partiality_as_none;
   358 
   359 
   359 fun mount_computation ctxt cTs T raw_computation lift_postproc =
   360 fun mount_computation ctxt cTs T raw_computation lift_postproc =
   360   Code_Preproc.static_value { ctxt = ctxt, lift_postproc = lift_postproc, consts = [] }
   361   Code_Preproc.static_value { ctxt = ctxt, lift_postproc = lift_postproc, consts = [] }
   361     (K (checked_computation cTs T raw_computation));
   362     (K (checked_computation cTs T raw_computation));
   362 
   363