clarified check of defining equations
authorhaftmann
Fri, 16 Mar 2007 21:32:20 +0100
changeset 22462 2a93fb199302
parent 22461 052cfe1c86dc
child 22463 d0e12f0d4e44
clarified check of defining equations
src/Pure/Tools/codegen_func.ML
--- a/src/Pure/Tools/codegen_func.ML	Fri Mar 16 21:32:19 2007 +0100
+++ b/src/Pure/Tools/codegen_func.ML	Fri Mar 16 21:32:20 2007 +0100
@@ -88,10 +88,13 @@
             ) args [])
           then bad_thm "Repeated variables on left hand side of defining equation" thm
           else ()
-        fun no_abs (Abs _) = bad_thm "Abstraction on left hand side of defining equation" thm 
-          | no_abs (t1 $ t2) = (no_abs t1; no_abs t2)
-          | no_abs _ = ();
-        val _ = map no_abs args;
+        fun check _ (Abs _) = bad_thm
+              "Abstraction on left hand side of defining equation" thm
+          | check false (Var _) = bad_thm
+              "Variable with application on left hand side of defining equation" thm
+          | check _ (t1 $ t2) = (check false t1; check true t2)
+          | check _ _ = ();
+        val _ = map (check true) args;
       in thm end
   | NONE => bad_thm "Not a defining equation" thm;