src/Pure/sign.ML
changeset 35988 76ca601c941e
parent 35845 e5980f0ad025
child 36157 2fb3e278a5d7
equal deleted inserted replaced
35987:7c728daf4876 35988:76ca601c941e
    66   val certify_term: theory -> term -> term * typ * int
    66   val certify_term: theory -> term -> term * typ * int
    67   val cert_term: theory -> term -> term
    67   val cert_term: theory -> term -> term
    68   val cert_prop: theory -> term -> term
    68   val cert_prop: theory -> term -> term
    69   val no_frees: Pretty.pp -> term -> term
    69   val no_frees: Pretty.pp -> term -> term
    70   val no_vars: Pretty.pp -> term -> term
    70   val no_vars: Pretty.pp -> term -> term
    71   val cert_def: Proof.context -> term -> (string * typ) * term
       
    72   val add_defsort: string -> theory -> theory
    71   val add_defsort: string -> theory -> theory
    73   val add_defsort_i: sort -> theory -> theory
    72   val add_defsort_i: sort -> theory -> theory
    74   val add_types: (binding * int * mixfix) list -> theory -> theory
    73   val add_types: (binding * int * mixfix) list -> theory -> theory
    75   val add_nonterminals: binding list -> theory -> theory
    74   val add_nonterminals: binding list -> theory -> theory
    76   val add_tyabbrs: (binding * string list * string * mixfix) list -> theory -> theory
    75   val add_tyabbrs: (binding * string list * string * mixfix) list -> theory -> theory
   330        Pretty.commas (map (Pretty.term pp o mk) frees @ map (Pretty.typ pp o mkT) tfrees)))));
   329        Pretty.commas (map (Pretty.term pp o mk) frees @ map (Pretty.typ pp o mkT) tfrees)))));
   331 
   330 
   332 val no_frees = no_variables "free" Term.add_frees Term.add_tfrees Free TFree;
   331 val no_frees = no_variables "free" Term.add_frees Term.add_tfrees Free TFree;
   333 val no_vars = no_variables "schematic" Term.add_vars Term.add_tvars Var TVar;
   332 val no_vars = no_variables "schematic" Term.add_vars Term.add_tvars Var TVar;
   334 
   333 
   335 fun cert_def ctxt tm =
       
   336   let val ((lhs, rhs), _) = tm
       
   337     |> no_vars (Syntax.pp ctxt)
       
   338     |> Logic.strip_imp_concl
       
   339     |> Primitive_Defs.dest_def ctxt Term.is_Const (K false) (K false)
       
   340   in (Term.dest_Const (Term.head_of lhs), rhs) end
       
   341   handle TERM (msg, _) => error msg;
       
   342 
       
   343 
   334 
   344 
   335 
   345 (** signature extension functions **)  (*exception ERROR/TYPE*)
   336 (** signature extension functions **)  (*exception ERROR/TYPE*)
   346 
   337 
   347 (* add default sort *)
   338 (* add default sort *)