src/Pure/sorts.ML
changeset 29269 5c25a2012975
parent 28922 ac2c34cad840
child 29972 aee7610106fd
child 30240 5b25fee0362c
equal deleted inserted replaced
29268:6aefc5ff8e63 29269:5c25a2012975
     1 (*  Title:      Pure/sorts.ML
     1 (*  Title:      Pure/sorts.ML
     2     ID:         $Id$
       
     3     Author:     Markus Wenzel and Stefan Berghofer, TU Muenchen
     2     Author:     Markus Wenzel and Stefan Berghofer, TU Muenchen
     4 
     3 
     5 The order-sorted algebra of type classes.
     4 The order-sorted algebra of type classes.
     6 
     5 
     7 Classes denote (possibly empty) collections of types that are
     6 Classes denote (possibly empty) collections of types that are
    72 struct
    71 struct
    73 
    72 
    74 
    73 
    75 (** ordered lists of sorts **)
    74 (** ordered lists of sorts **)
    76 
    75 
    77 val make = OrdList.make Term.sort_ord;
    76 val make = OrdList.make TermOrd.sort_ord;
    78 val op subset = OrdList.subset Term.sort_ord;
    77 val op subset = OrdList.subset TermOrd.sort_ord;
    79 val op union = OrdList.union Term.sort_ord;
    78 val op union = OrdList.union TermOrd.sort_ord;
    80 val subtract = OrdList.subtract Term.sort_ord;
    79 val subtract = OrdList.subtract TermOrd.sort_ord;
    81 
    80 
    82 val remove_sort = OrdList.remove Term.sort_ord;
    81 val remove_sort = OrdList.remove TermOrd.sort_ord;
    83 val insert_sort = OrdList.insert Term.sort_ord;
    82 val insert_sort = OrdList.insert TermOrd.sort_ord;
    84 
    83 
    85 fun insert_typ (TFree (_, S)) Ss = insert_sort S Ss
    84 fun insert_typ (TFree (_, S)) Ss = insert_sort S Ss
    86   | insert_typ (TVar (_, S)) Ss = insert_sort S Ss
    85   | insert_typ (TVar (_, S)) Ss = insert_sort S Ss
    87   | insert_typ (Type (_, Ts)) Ss = insert_typs Ts Ss
    86   | insert_typ (Type (_, Ts)) Ss = insert_typs Ts Ss
    88 and insert_typs [] Ss = Ss
    87 and insert_typs [] Ss = Ss