checking.lisp 730 B

12345678910111213141516171819202122
  1. ;;;; checking.lisp
  2. ;;;;
  3. ;;;; Copyright (c) 2020 Samuel W. Flint <swflint@flintfam.org>
  4. (in-package #:lcsp)
  5. ;;; "lcsp" goes here.
  6. (defmethod check-constraint (constraint vvps &key suppress-cc-update-p) :around
  7. (let ((result (call-next-method)))
  8. (unless suppress-cc-update-p
  9. (incf (constraint-checks (problem constraint))))
  10. result))
  11. (defmethod check-constraint ((constraint <constraint-combined>) vvps &key &allow-other-keys)
  12. (let ((value t))
  13. (do* ((constraints (constraints constraint) (rest constraints))
  14. (constr (first constraints) (first constraints)))
  15. ((or (not value) (null constr)) value)
  16. (setf value (check-constraint constr vvps :suppress-cc-update-p t)))))
  17. ;;; End lcsp