removed obsolete Drule.frees/vars_of etc.;
authorwenzelm
Wed, 02 Aug 2006 22:26:37 +0200
changeset 20286 4cf8e86a2d29
parent 20285 23f5cd23c1e1
child 20287 8cbcb46c3c09
removed obsolete Drule.frees/vars_of etc.;
src/HOL/Import/proof_kernel.ML
src/HOL/Tools/datatype_realizer.ML
src/Pure/codegen.ML
--- a/src/HOL/Import/proof_kernel.ML	Wed Aug 02 18:33:46 2006 +0200
+++ b/src/HOL/Import/proof_kernel.ML	Wed Aug 02 22:26:37 2006 +0200
@@ -2199,8 +2199,10 @@
 		    [NONE, NONE, NONE, SOME (cterm_of thy' (Free ("a", aty))), SOME (cterm_of thy' (Free ("r", tT)))]
                     typedef_hol2hollight
 	    val th4 = (#type_definition typedef_info) RS typedef_hol2hollight'
-            val _ = if Drule.tvars_of th4 = [] then () else raise ERR "type_introduction" "no type variables expected any more" 
-            val _ = if Drule.vars_of th4 = [] then () else raise ERR "type_introduction" "no term variables expected any more"
+            val _ = null (Drule.fold_terms Term.add_tvars th4 []) orelse
+              raise ERR "type_introduction" "no type variables expected any more"
+            val _ = null (Drule.fold_terms Term.add_vars th4 []) orelse
+              raise ERR "type_introduction" "no term variables expected any more"
 	    val _ = message ("step 3: thyname="^thyname^", tycname="^tycname^", fulltyname="^fulltyname)
             val thy'' = add_hol4_type_mapping thyname tycname true fulltyname thy'
 	    val _ = ImportRecorder.add_hol_type_mapping thyname tycname fulltyname
--- a/src/HOL/Tools/datatype_realizer.ML	Wed Aug 02 18:33:46 2006 +0200
+++ b/src/HOL/Tools/datatype_realizer.ML	Wed Aug 02 22:26:37 2006 +0200
@@ -136,9 +136,8 @@
         ((space_implode "_" (ind_name :: vs @ ["correctness"]), thm), [])
       ||> Theory.restore_naming thy;
 
-    val ivs = Drule.vars_of_terms
-      [Logic.varify (DatatypeProp.make_ind [descr] sorts)];
-    val rvs = Drule.vars_of_terms [prop_of thm'];
+    val ivs = rev (Term.add_vars (Logic.varify (DatatypeProp.make_ind [descr] sorts)) []);
+    val rvs = rev (Drule.fold_terms Term.add_vars thm' []);
     val ivs1 = map Var (filter_out (fn (_, T) =>
       tname_of (body_type T) mem ["set", "bool"]) ivs);
     val ivs2 = map (fn (ixn, _) => Var (ixn, valOf (AList.lookup (op =) rvs ixn))) ivs;
--- a/src/Pure/codegen.ML	Wed Aug 02 18:33:46 2006 +0200
+++ b/src/Pure/codegen.ML	Wed Aug 02 22:26:37 2006 +0200
@@ -534,7 +534,7 @@
 fun rename_terms ts =
   let
     val names = foldr add_term_names
-      (map (fst o fst) (Drule.vars_of_terms ts)) ts;
+      (map (fst o fst) (rev (fold Term.add_vars ts []))) ts;
     val reserved = names inter ThmDatabase.ml_reserved;
     val (illegal, alt_names) = split_list (map_filter (fn s =>
       let val s' = mk_id s in if s = s' then NONE else SOME (s, s') end) names)