Recognizer for transaction structures.
(transactionp x) → *
Function:
(defun transactionp (x) (declare (xargs :guard t)) (let ((__function__ 'transactionp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :bond)) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((validator (std::da-nth 0 (cdr x))) (stake (std::da-nth 1 (cdr x)))) (and (addressp validator) (posp stake))))) ((eq (car x) :unbond) (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) :other) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((unwrap (std::da-nth 0 (cdr x)))) (any-p unwrap))))))))
Theorem:
(defthm consp-when-transactionp (implies (transactionp x) (consp x)) :rule-classes :compound-recognizer)