Recognizer for event structures.
(eventp x) → *
Function:
(defun eventp (x) (declare (xargs :guard t)) (let ((__function__ 'eventp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :create-certificate)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((certificate (std::da-nth 0 (cdr x)))) (certificatep certificate)))) ((eq (car x) :receive-certificate) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((message (std::da-nth 0 (cdr x)))) (messagep message)))) ((eq (car x) :store-certificate) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((certificate (std::da-nth 0 (cdr x))) (validator (std::da-nth 1 (cdr x)))) (and (certificatep certificate) (addressp validator))))) ((eq (car x) :advance-round) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((validator (std::da-nth 0 (cdr x)))) (addressp validator)))) ((eq (car x) :commit-anchors) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((validator (std::da-nth 0 (cdr x)))) (addressp validator)))) (t (and (eq (car x) :timer-expires) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((validator (std::da-nth 0 (cdr x)))) (addressp validator))))))))
Theorem:
(defthm consp-when-eventp (implies (eventp x) (consp x)) :rule-classes :compound-recognizer)