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)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((certificate (std::da-nth 0 (cdr x)))) (certificatep certificate)))) ((eq (car x) :receive) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((message (std::da-nth 0 (cdr x)))) (messagep message)))) ((eq (car x) :store) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((validator (std::da-nth 0 (cdr x))) (certificate (std::da-nth 1 (cdr x)))) (and (addressp validator) (certificatep certificate))))) ((eq (car x) :advance) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((validator (std::da-nth 0 (cdr x)))) (addressp validator)))) ((eq (car x) :commit) (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) :timeout) (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)