Recognizer for certificate structures.
(certificatep x) → *
Function:
(defun certificatep (x) (declare (xargs :guard t)) (let ((__function__ 'certificatep)) (declare (ignorable __function__)) (and (mbe :logic (and (alistp x) (equal (strip-cars x) '(author round transactions previous endorsers))) :exec (fty::alist-with-carsp x '(author round transactions previous endorsers))) (b* ((author (cdr (std::da-nth 0 x))) (round (cdr (std::da-nth 1 x))) (transactions (cdr (std::da-nth 2 x))) (previous (cdr (std::da-nth 3 x))) (endorsers (cdr (std::da-nth 4 x)))) (and (addressp author) (posp round) (transaction-listp transactions) (address-setp previous) (address-setp endorsers))))))
Theorem:
(defthm consp-when-certificatep (implies (certificatep x) (consp x)) :rule-classes :compound-recognizer)