Recognizer for constraint structures.
(constraintp x) → *
Function:
(defun constraintp (x) (declare (xargs :guard t)) (let ((__function__ 'constraintp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :equal)) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((left (std::da-nth 0 (cdr x))) (right (std::da-nth 1 (cdr x)))) (and (expressionp left) (expressionp right))))) (t (and (eq (car x) :relation) (and (true-listp (cdr x)) (eql (len (cdr x)) 2)) (b* ((name (std::da-nth 0 (cdr x))) (args (std::da-nth 1 (cdr x)))) (and (stringp name) (expression-listp args)))))))))
Theorem:
(defthm consp-when-constraintp (implies (constraintp x) (consp x)) :rule-classes :compound-recognizer)