Recognizer for message structures.
(messagep x) → *
Function:
(defun messagep (x) (declare (xargs :guard t)) (let ((__function__ 'messagep)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :proposal)) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((proposal (std::da-nth 0 (cdr x))) (destination (std::da-nth 1 (cdr x)))) (and (proposalp proposal) (addressp destination))))) ((eq (car x) :endorsement) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((proposal (std::da-nth 0 (cdr x))) (endorser (std::da-nth 1 (cdr x)))) (and (proposalp proposal) (addressp endorser))))) (t (and (eq (car x) :certificate) (and (true-listp (cdr x)) (eql (len (cdr x)) 2)) (b* ((certificate (std::da-nth 0 (cdr x))) (destination (std::da-nth 1 (cdr x)))) (and (certificatep certificate) (addressp destination)))))))))
Theorem:
(defthm consp-when-messagep (implies (messagep x) (consp x)) :rule-classes :compound-recognizer)