equal
deleted
inserted
replaced
36 val type_map: (term -> term) -> typ -> typ |
36 val type_map: (term -> term) -> typ -> typ |
37 val const_of_class: class -> string |
37 val const_of_class: class -> string |
38 val class_of_const: string -> class |
38 val class_of_const: string -> class |
39 val mk_of_class: typ * class -> term |
39 val mk_of_class: typ * class -> term |
40 val dest_of_class: term -> typ * class |
40 val dest_of_class: term -> typ * class |
|
41 val mk_of_sort: typ * sort -> term list |
41 val name_classrel: string * string -> string |
42 val name_classrel: string * string -> string |
42 val mk_classrel: class * class -> term |
43 val mk_classrel: class * class -> term |
43 val dest_classrel: term -> class * class |
44 val dest_classrel: term -> class * class |
44 val name_arities: arity -> string list |
45 val name_arities: arity -> string list |
45 val name_arity: string * sort list * class -> string |
46 val name_arity: string * sort list * class -> string |
215 |
216 |
216 fun class_of_const c = unsuffix classN c |
217 fun class_of_const c = unsuffix classN c |
217 handle Fail _ => raise TERM ("class_of_const: bad name " ^ quote c, []); |
218 handle Fail _ => raise TERM ("class_of_const: bad name " ^ quote c, []); |
218 |
219 |
219 |
220 |
220 (* class membership *) |
221 (* class/sort membership *) |
221 |
222 |
222 fun mk_of_class (ty, c) = |
223 fun mk_of_class (ty, c) = |
223 Const (const_of_class c, Term.itselfT ty --> propT) $ mk_type ty; |
224 Const (const_of_class c, Term.itselfT ty --> propT) $ mk_type ty; |
224 |
225 |
225 fun dest_of_class (Const (c_class, _) $ ty) = (dest_type ty, class_of_const c_class) |
226 fun dest_of_class (Const (c_class, _) $ ty) = (dest_type ty, class_of_const c_class) |
226 | dest_of_class t = raise TERM ("dest_of_class", [t]); |
227 | dest_of_class t = raise TERM ("dest_of_class", [t]); |
|
228 |
|
229 fun mk_of_sort (ty, S) = map (fn c => mk_of_class (ty, c)) S; |
227 |
230 |
228 |
231 |
229 (* class relations *) |
232 (* class relations *) |
230 |
233 |
231 fun name_classrel (c1, c2) = |
234 fun name_classrel (c1, c2) = |