src/HOL/Codatatype/Tools/bnf_util.ML
changeset 49434 433dc7e028c8
parent 49425 f27f83f71e94
child 49463 83ac281bcdc2
equal deleted inserted replaced
49433:1095f240146a 49434:433dc7e028c8
   126   val find_indices: ''a list -> ''a list -> int list
   126   val find_indices: ''a list -> ''a list -> int list
   127 
   127 
   128   val certifyT: Proof.context -> typ -> ctyp
   128   val certifyT: Proof.context -> typ -> ctyp
   129   val certify: Proof.context -> term -> cterm
   129   val certify: Proof.context -> term -> cterm
   130 
   130 
       
   131   val parse_binding_colon: Token.T list -> binding * Token.T list
       
   132   val parse_opt_binding_colon: Token.T list -> binding * Token.T list
       
   133 
   131   val typedef: bool -> binding option -> binding * (string * sort) list * mixfix -> term ->
   134   val typedef: bool -> binding option -> binding * (string * sort) list * mixfix -> term ->
   132     (binding * binding) option -> tactic -> local_theory -> (string * Typedef.info) * local_theory
   135     (binding * binding) option -> tactic -> local_theory -> (string * Typedef.info) * local_theory
   133 
   136 
   134   val WRAP: ('a -> tactic) -> ('a -> tactic) -> 'a list -> tactic -> tactic
   137   val WRAP: ('a -> tactic) -> ('a -> tactic) -> 'a list -> tactic -> tactic
   135   val WRAP': ('a -> int -> tactic) -> ('a -> int -> tactic) -> 'a list -> (int -> tactic) -> int ->
   138   val WRAP': ('a -> int -> tactic) -> ('a -> int -> tactic) -> 'a list -> (int -> tactic) -> int ->
   247   | fold_map7 _ _ _ _ _ _ _ _ _ = raise ListPair.UnequalLengths;
   250   | fold_map7 _ _ _ _ _ _ _ _ _ = raise ListPair.UnequalLengths;
   248 
   251 
   249 (*stolen from ~~/src/HOL/Tools/SMT/smt_utils.ML*)
   252 (*stolen from ~~/src/HOL/Tools/SMT/smt_utils.ML*)
   250 fun certify ctxt = Thm.cterm_of (Proof_Context.theory_of ctxt);
   253 fun certify ctxt = Thm.cterm_of (Proof_Context.theory_of ctxt);
   251 fun certifyT ctxt = Thm.ctyp_of (Proof_Context.theory_of ctxt);
   254 fun certifyT ctxt = Thm.ctyp_of (Proof_Context.theory_of ctxt);
       
   255 
       
   256 val parse_binding_colon = Parse.binding --| @{keyword ":"};
       
   257 val parse_opt_binding_colon = Scan.optional parse_binding_colon Binding.empty;
   252 
   258 
   253 (*TODO: is this really different from Typedef.add_typedef_global?*)
   259 (*TODO: is this really different from Typedef.add_typedef_global?*)
   254 fun typedef def opt_name typ set opt_morphs tac lthy =
   260 fun typedef def opt_name typ set opt_morphs tac lthy =
   255   let
   261   let
   256     val ((name, info), (lthy, lthy_old)) =
   262     val ((name, info), (lthy, lthy_old)) =