src/Pure/codegen.ML
changeset 39253 0c47d615a69b
parent 38329 16bb1e60204b
child 40316 665862241968
equal deleted inserted replaced
39252:8f176e575a49 39253:0c47d615a69b
    74   val strip_tname: string -> string
    74   val strip_tname: string -> string
    75   val mk_type: bool -> typ -> Pretty.T
    75   val mk_type: bool -> typ -> Pretty.T
    76   val mk_term_of: codegr -> string -> bool -> typ -> Pretty.T
    76   val mk_term_of: codegr -> string -> bool -> typ -> Pretty.T
    77   val mk_gen: codegr -> string -> bool -> string list -> string -> typ -> Pretty.T
    77   val mk_gen: codegr -> string -> bool -> string list -> string -> typ -> Pretty.T
    78   val test_fn: (int -> term list option) Unsynchronized.ref
    78   val test_fn: (int -> term list option) Unsynchronized.ref
    79   val test_term: Proof.context -> bool -> term -> int -> term list option * (bool list * bool)
    79   val test_term: Proof.context -> term -> int -> term list option * (bool list * bool)
    80   val eval_result: (unit -> term) Unsynchronized.ref
    80   val eval_result: (unit -> term) Unsynchronized.ref
    81   val eval_term: theory -> term -> term
    81   val eval_term: theory -> term -> term
    82   val evaluation_conv: cterm -> thm
    82   val evaluation_conv: cterm -> thm
    83   val parse_mixfix: (string -> 'a) -> string -> 'a mixfix list
    83   val parse_mixfix: (string -> 'a) -> string -> 'a mixfix list
    84   val quotes_of: 'a mixfix list -> 'a list
    84   val quotes_of: 'a mixfix list -> 'a list
   867          (if member (op =) xs s then [str a] else []))));
   867          (if member (op =) xs s then [str a] else []))));
   868 
   868 
   869 val test_fn : (int -> term list option) Unsynchronized.ref =
   869 val test_fn : (int -> term list option) Unsynchronized.ref =
   870   Unsynchronized.ref (fn _ => NONE);
   870   Unsynchronized.ref (fn _ => NONE);
   871 
   871 
   872 fun test_term ctxt report t =
   872 fun test_term ctxt t =
   873   let
   873   let
   874     val thy = ProofContext.theory_of ctxt;
   874     val thy = ProofContext.theory_of ctxt;
   875     val (code, gr) = setmp_CRITICAL mode ["term_of", "test"]
   875     val (code, gr) = setmp_CRITICAL mode ["term_of", "test"]
   876       (generate_code_i thy [] "Generated") [("testf", t)];
   876       (generate_code_i thy [] "Generated") [("testf", t)];
   877     val Ts = map snd (fst (strip_abs t));
   877     val Ts = map snd (fst (strip_abs t));