src/Pure/sign.ML
changeset 36449 78721f3adb13
parent 36179 f45c708bcc01
child 36450 62eaaffe6e47
equal deleted inserted replaced
36448:edb757388592 36449:78721f3adb13
    23   val classes_of: theory -> Sorts.algebra
    23   val classes_of: theory -> Sorts.algebra
    24   val all_classes: theory -> class list
    24   val all_classes: theory -> class list
    25   val super_classes: theory -> class -> class list
    25   val super_classes: theory -> class -> class list
    26   val minimize_sort: theory -> sort -> sort
    26   val minimize_sort: theory -> sort -> sort
    27   val complete_sort: theory -> sort -> sort
    27   val complete_sort: theory -> sort -> sort
       
    28   val set_defsort: sort -> theory -> theory
    28   val defaultS: theory -> sort
    29   val defaultS: theory -> sort
    29   val subsort: theory -> sort * sort -> bool
    30   val subsort: theory -> sort * sort -> bool
    30   val of_sort: theory -> typ * sort -> bool
    31   val of_sort: theory -> typ * sort -> bool
    31   val witness_sorts: theory -> (typ * sort) list -> sort list -> (typ * sort) list
    32   val witness_sorts: theory -> (typ * sort) list -> sort list -> (typ * sort) list
    32   val is_logtype: theory -> string -> bool
    33   val is_logtype: theory -> string -> bool
    66   val certify_term: theory -> term -> term * typ * int
    67   val certify_term: theory -> term -> term * typ * int
    67   val cert_term: theory -> term -> term
    68   val cert_term: theory -> term -> term
    68   val cert_prop: theory -> term -> term
    69   val cert_prop: theory -> term -> term
    69   val no_frees: Pretty.pp -> term -> term
    70   val no_frees: Pretty.pp -> term -> term
    70   val no_vars: Pretty.pp -> term -> term
    71   val no_vars: Pretty.pp -> term -> term
    71   val add_defsort: string -> theory -> theory
       
    72   val add_defsort_i: sort -> theory -> theory
       
    73   val add_types: (binding * int * mixfix) list -> theory -> theory
    72   val add_types: (binding * int * mixfix) list -> theory -> theory
    74   val add_nonterminals: binding list -> theory -> theory
    73   val add_nonterminals: binding list -> theory -> theory
    75   val add_type_abbrev: binding * string list * typ -> theory -> theory
    74   val add_type_abbrev: binding * string list * typ -> theory -> theory
    76   val add_syntax: (string * string * mixfix) list -> theory -> theory
    75   val add_syntax: (string * string * mixfix) list -> theory -> theory
    77   val add_syntax_i: (string * typ * mixfix) list -> theory -> theory
    76   val add_syntax_i: (string * typ * mixfix) list -> theory -> theory
   196 val all_classes = Sorts.all_classes o classes_of;
   195 val all_classes = Sorts.all_classes o classes_of;
   197 val super_classes = Sorts.super_classes o classes_of;
   196 val super_classes = Sorts.super_classes o classes_of;
   198 val minimize_sort = Sorts.minimize_sort o classes_of;
   197 val minimize_sort = Sorts.minimize_sort o classes_of;
   199 val complete_sort = Sorts.complete_sort o classes_of;
   198 val complete_sort = Sorts.complete_sort o classes_of;
   200 
   199 
       
   200 val set_defsort = map_tsig o Type.set_defsort;
   201 val defaultS = Type.defaultS o tsig_of;
   201 val defaultS = Type.defaultS o tsig_of;
   202 val subsort = Type.subsort o tsig_of;
   202 val subsort = Type.subsort o tsig_of;
   203 val of_sort = Type.of_sort o tsig_of;
   203 val of_sort = Type.of_sort o tsig_of;
   204 val witness_sorts = Type.witness_sorts o tsig_of;
   204 val witness_sorts = Type.witness_sorts o tsig_of;
   205 val is_logtype = member (op =) o Type.logical_types o tsig_of;
   205 val is_logtype = member (op =) o Type.logical_types o tsig_of;
   331 val no_vars = no_variables "schematic" Term.add_vars Term.add_tvars Var TVar;
   331 val no_vars = no_variables "schematic" Term.add_vars Term.add_tvars Var TVar;
   332 
   332 
   333 
   333 
   334 
   334 
   335 (** signature extension functions **)  (*exception ERROR/TYPE*)
   335 (** signature extension functions **)  (*exception ERROR/TYPE*)
   336 
       
   337 (* add default sort *)
       
   338 
       
   339 fun gen_add_defsort prep_sort s thy =
       
   340   thy |> map_tsig (Type.set_defsort (prep_sort thy s));
       
   341 
       
   342 val add_defsort = gen_add_defsort Syntax.read_sort_global;
       
   343 val add_defsort_i = gen_add_defsort certify_sort;
       
   344 
       
   345 
   336 
   346 (* add type constructors *)
   337 (* add type constructors *)
   347 
   338 
   348 fun add_types types thy = thy |> map_sign (fn (naming, syn, tsig, consts) =>
   339 fun add_types types thy = thy |> map_sign (fn (naming, syn, tsig, consts) =>
   349   let
   340   let