Added function abs_def.
authorberghofe
Tue, 09 Jul 2002 18:03:26 +0200
changeset 13325 5b5e12f0aee0
parent 13324 39d1b3a4c6f4
child 13326 900f220c800d
Added function abs_def.
src/Pure/drule.ML
--- a/src/Pure/drule.ML	Tue Jul 09 17:25:42 2002 +0200
+++ b/src/Pure/drule.ML	Tue Jul 09 18:03:26 2002 +0200
@@ -130,6 +130,7 @@
   val conj_elim_list: thm -> thm list
   val conj_elim_precise: int -> thm -> thm list
   val conj_intr_thm: thm
+  val abs_def: thm -> thm
 end;
 
 structure Drule: DRULE =
@@ -589,6 +590,16 @@
 
 val refl_implies = reflexive implies;
 
+fun abs_def thm =
+  let
+    val (_, cvs) = strip_comb (fst (dest_equals (cprop_of thm)));
+    val thm' = foldr (fn (ct, thm) => Thm.abstract_rule
+      (case term_of ct of Var ((a, _), _) => a | Free (a, _) => a | _ => "x")
+        ct thm) (cvs, thm)
+  in transitive
+    (symmetric (eta_conversion (fst (dest_equals (cprop_of thm'))))) thm'
+  end;
+
 
 (*** Some useful meta-theorems ***)