tuned expand_term;
authorwenzelm
Tue, 12 Dec 2006 20:49:28 +0100
changeset 21801 c77bc21b3eef
parent 21800 6035bfcd72d8
child 21802 e024aa65f4ce
tuned expand_term;
src/Pure/Isar/local_defs.ML
--- a/src/Pure/Isar/local_defs.ML	Tue Dec 12 20:49:27 2006 +0100
+++ b/src/Pure/Isar/local_defs.ML	Tue Dec 12 20:49:28 2006 +0100
@@ -74,12 +74,7 @@
   #> Drule.generalize ([], map (head_of_def o Thm.term_of) defs)
   #> funpow (length defs) (fn th => Drule.reflexive_thm RS th);
 
-fun expand_term defs =
-  let
-    val eqs = defs |> map (Thm.term_of #> abs_def #> (fn ((x, U), u) => (x, (U, u))));
-    fun get_def (Free (x, _)) = AList.lookup (op =) eqs x
-      | get_def _ = NONE;
-  in Envir.expand_term get_def end;
+val expand_term = Envir.expand_term_frees o map (abs_def o Thm.term_of);
 
 fun def_export _ defs = (expand defs, expand_term defs);