123456789101112131415161718192021222324252627282930 |
- ;;;; 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))
- (defmethod check-constraint ((constraint <constraint-combined>) vvps &key &allow-other-keys)
- (let ((value t))
- (do* ((constraints (constraints constraint) (rest constraints))
- (constr (first constraints) (first constraints)))
- ((or (not value) (null constr)) value)
- (setf value (check-constraint constr vvps :suppress-cc-update-p t)))))
- (defun fix-vvps (vvps constraint)
- (let ((variables (variables constraint)))
- (mapcar #'(lambda (var)
- (find var vvps
- :key #'car
- :test #'equal))
- variables)))
- ;;; End lcsp
|