Browse Source

Add constraint checking for intension constraints

Samuel W. Flint 4 years ago
parent
commit
ab812bdc38
1 changed files with 7 additions and 0 deletions
  1. 7 0
      checking.lisp

+ 7 - 0
checking.lisp

@@ -40,4 +40,11 @@
         (not is-member-p)
         is-member-p)))
 
+(defmethod check-constraint ((constraint <constraint-intension>) vvps &key &allow-other-keys)
+  (unless (= (length vvps) (constraint-adicity constraint))
+    (error "Incorrect number of VVPs (~a vs. ~a)."
+           (length vvps)
+           (constraint-adicity constraint)))
+  (funcall (constraint-function constraint) (fix-vvps vvps constraint)))
+
 ;;; End lcsp