--- a/src/Pure/type.ML Tue Aug 01 12:36:05 1995 +0200
+++ b/src/Pure/type.ML Tue Aug 01 17:17:49 1995 +0200
@@ -38,6 +38,7 @@
val subsort: type_sig -> sort * sort -> bool
val norm_sort: type_sig -> sort -> sort
val rem_sorts: typ -> typ
+ val nonempty_sort: type_sig -> (string * sort) list -> sort -> bool
val cert_typ: type_sig -> typ -> typ
val norm_typ: type_sig -> typ -> typ
val freeze: term -> term
@@ -399,6 +400,16 @@
| rem_sorts (TVar (xi, _)) = TVar (xi, []);
+(* nonempty_sort *)
+
+(* FIXME improve: proper sorts; non-base, non-ground types (vars from hyps) *)
+fun nonempty_sort _ _ [] = true
+ | nonempty_sort (tsig as TySg {arities, ...}) hyps S =
+ exists (exists (fn (c, ss) => [c] = S andalso null ss) o snd) arities
+ orelse exists (fn (_, S') => subsort tsig (S', S)) hyps;
+
+
+
(* typ_errors *)
(*check validity of (not necessarily normal) type; accumulate error messages*)