declare_constraints: declare (fix) type variables within constraints, but not terms themselves;
authorwenzelm
Wed, 26 Sep 2007 11:27:46 +0200
changeset 24719 21d1cdab2d8c
parent 24718 16b11ba36350
child 24720 4d2f2e375fa1
declare_constraints: declare (fix) type variables within constraints, but not terms themselves;
src/Pure/variable.ML
--- a/src/Pure/variable.ML	Wed Sep 26 09:05:58 2007 +0200
+++ b/src/Pure/variable.ML	Wed Sep 26 11:27:46 2007 +0200
@@ -156,10 +156,13 @@
 
 (* type occurrences *)
 
+fun decl_type_occsT T = fold_atyps (fn TFree (a, _) => Symtab.default (a, []) | _ => I) T;
+
 val decl_type_occs = fold_term_types
   (fn Free (x, _) => fold_atyps (fn TFree (a, _) => Symtab.insert_list (op =) (a, x) | _ => I)
-    | _ => fold_atyps (fn TFree (a, _) => Symtab.default (a, []) | _ => I));
+    | _ => decl_type_occsT);
 
+val declare_type_occsT = map_type_occs o fold_types decl_type_occsT;
 val declare_type_occs = map_type_occs o decl_type_occs;
 
 
@@ -179,6 +182,7 @@
         | TVar v => constrain_tvar v
         | _ => I)) t sorts;
   in (types', sorts') end)
+  #> declare_type_occsT t
   #> declare_type_names t;