--- 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;