54 val extern_class: theory -> string -> xstring |
54 val extern_class: theory -> string -> xstring |
55 val intern_type: theory -> xstring -> string |
55 val intern_type: theory -> xstring -> string |
56 val extern_type: theory -> string -> xstring |
56 val extern_type: theory -> string -> xstring |
57 val intern_const: theory -> xstring -> string |
57 val intern_const: theory -> xstring -> string |
58 val extern_const: theory -> string -> xstring |
58 val extern_const: theory -> string -> xstring |
59 val intern_term: theory -> term -> term |
|
60 val arity_number: theory -> string -> int |
59 val arity_number: theory -> string -> int |
61 val arity_sorts: theory -> string -> sort -> sort list |
60 val arity_sorts: theory -> string -> sort -> sort list |
62 val certify_class: theory -> class -> class |
61 val certify_class: theory -> class -> class |
63 val certify_sort: theory -> sort -> sort |
62 val certify_sort: theory -> sort -> sort |
64 val certify_typ: theory -> typ -> typ |
63 val certify_typ: theory -> typ -> typ |
245 val intern_type = Name_Space.intern o type_space; |
244 val intern_type = Name_Space.intern o type_space; |
246 val extern_type = Name_Space.extern o type_space; |
245 val extern_type = Name_Space.extern o type_space; |
247 val intern_const = Name_Space.intern o const_space; |
246 val intern_const = Name_Space.intern o const_space; |
248 val extern_const = Name_Space.extern o const_space; |
247 val extern_const = Name_Space.extern o const_space; |
249 |
248 |
250 local |
|
251 |
|
252 fun map_typ f g (Type (c, Ts)) = Type (g c, map (map_typ f g) Ts) |
|
253 | map_typ f _ (TFree (x, S)) = TFree (x, map f S) |
|
254 | map_typ f _ (TVar (xi, S)) = TVar (xi, map f S); |
|
255 |
|
256 fun map_term f g h (Const (c, T)) = Const (h c, map_typ f g T) |
|
257 | map_term f g _ (Free (x, T)) = Free (x, map_typ f g T) |
|
258 | map_term f g _ (Var (xi, T)) = Var (xi, map_typ f g T) |
|
259 | map_term _ _ _ (t as Bound _) = t |
|
260 | map_term f g h (Abs (x, T, t)) = Abs (x, map_typ f g T, map_term f g h t) |
|
261 | map_term f g h (t $ u) = map_term f g h t $ map_term f g h u; |
|
262 |
|
263 in |
|
264 |
|
265 fun intern_term thy = map_term (intern_class thy) (intern_type thy) (intern_const thy); |
|
266 |
|
267 end; |
|
268 |
|
269 |
249 |
270 |
250 |
271 (** certify entities **) (*exception TYPE*) |
251 (** certify entities **) (*exception TYPE*) |
272 |
252 |
273 (* certify wrt. type signature *) |
253 (* certify wrt. type signature *) |