Browse Source

Start adding checking

Samuel W. Flint 4 years ago
parent
commit
142bddc147
3 changed files with 17 additions and 1 deletions
  1. 15 0
      checking.lisp
  2. 1 0
      lcsp.asd
  3. 1 1
      types.lisp

+ 15 - 0
checking.lisp

@@ -0,0 +1,15 @@
+;;;; checking.lisp
+;;;;
+;;;; Copyright (c) 2020 Samuel W. Flint <swflint@flintfam.org>
+
+(in-package #:lcsp)
+
+;;; "lcsp" goes here.
+
+(defmethod check-constraint (constraint vvps &key suppress-cc-update-p) :around
+  (let ((result (call-next-method)))
+    (unless suppress-cc-update-p
+      (incf (constraint-checks (problem constraint))))
+    result))
+
+;;; End lcsp

+ 1 - 0
lcsp.asd

@@ -12,4 +12,5 @@
   :depends-on (#:alexandria)
   :components ((:file "package")
                (:file "types")
+               (:file "checking")
                (:file "LCSP")))

+ 1 - 1
types.lisp

@@ -47,7 +47,7 @@
   (with-slots (variables adicity) instance
     (setf adicity (length variables))))
 
-(defgeneric check-constraint (constraint &rest vvps))
+(defgeneric check-constraint (constraint vvps &key suppress-cc-update-p))
 
 (defclass <constraint-extension> (<constraint>)
   ((nogoodsp :reader nogoodsp