Inserted check for rewrite rules which introduce extra Vars on the rhs.
authornipkow
Mon, 30 Sep 1996 15:29:52 +0200
changeset 2046 fd26cd4da8cf
parent 2045 ae1030e66745
child 2047 a3701c4343ea
Inserted check for rewrite rules which introduce extra Vars on the rhs.
src/Pure/thm.ML
--- a/src/Pure/thm.ML	Mon Sep 30 11:10:22 1996 +0200
+++ b/src/Pure/thm.ML	Mon Sep 30 15:29:52 1996 +0200
@@ -1421,9 +1421,11 @@
       val (elhs,erhs) = Logic.dest_equals econcl
       val perm = var_perm(elhs,erhs) andalso not(elhs aconv erhs)
                                      andalso not(is_Var(elhs))
-  in
-     if not perm andalso loops sign prems (elhs,erhs) then
-       (prtm_warning "ignoring looping rewrite rule" sign prop; None)
+  in if not(term_vars(erhs) subset
+            (term_vars(elhs) union flat(map term_vars prems)))
+     then (prtm_warning "extra Var(s) on rhs" sign prop; None) else
+     if not perm andalso loops sign prems (elhs,erhs)
+     then (prtm_warning "ignoring looping rewrite rule" sign prop; None)
      else Some{thm=thm,lhs=lhs,perm=perm}
   end;