Moved function for renaming bound variables to Pure/drule.ML
authorberghofe
Sun, 29 Jun 2003 21:29:15 +0200 (2003-06-29)
changeset 14082 c69d5bf3047d
parent 14081 6c0f67e2f8d5
child 14083 aed5d25c4a0c
Moved function for renaming bound variables to Pure/drule.ML
src/Pure/Isar/attrib.ML
--- a/src/Pure/Isar/attrib.ML	Sun Jun 29 21:28:13 2003 +0200
+++ b/src/Pure/Isar/attrib.ML	Sun Jun 29 21:29:15 2003 +0200
@@ -263,26 +263,8 @@
 
 (* rename_abs *)
 
-fun rename [] t = ([], t)
-  | rename (x' :: xs) (Abs (x, T, t)) =
-      let val (xs', t') = rename xs t
-      in (xs', Abs (if_none x' x, T, t')) end
-  | rename xs (t $ u) =
-      let
-        val (xs', t') = rename xs t;
-        val (xs'', u') = rename xs' u
-      in (xs'', t' $ u') end
-  | rename xs t = (xs, t);
-
-fun rename_abs_thm xs (ctxt, thm) =
-  let val {sign, prop, ...} = rep_thm thm;
-  in case rename xs prop of
-      ([], prop') => (ctxt, equal_elim (reflexive (cterm_of sign prop')) thm)
-    | _ => error "More names than abstractions in theorem"
-  end;
-
 fun rename_abs src = syntax
-  (Scan.lift (Scan.repeat Args.name_dummy >> rename_abs_thm)) src;
+  (Scan.lift (Scan.repeat Args.name_dummy >> (apsnd o Drule.rename_bvars'))) src;
 
 
 (* unfold / fold definitions *)