Fixing function for transaction structures.
(transaction-fix x) → new-x
Function:
(defun transaction-fix$inline (x) (declare (xargs :guard (transactionp x))) (let ((__function__ 'transaction-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((nonce (word-fix (std::da-nth 0 (cdr x)))) (gas-price (word-fix (std::da-nth 1 (cdr x)))) (gas-limit (word-fix (std::da-nth 2 (cdr x)))) (to (maybe-byte-list20-fix (std::da-nth 3 (cdr x)))) (value (word-fix (std::da-nth 4 (cdr x)))) (init/data (byte-list-fix (std::da-nth 5 (cdr x)))) (sign-v (nfix (std::da-nth 6 (cdr x)))) (sign-r (word-fix (std::da-nth 7 (cdr x)))) (sign-s (word-fix (std::da-nth 8 (cdr x))))) (cons :transaction (list nonce gas-price gas-limit to value init/data sign-v sign-r sign-s))) :exec x)))
Theorem:
(defthm transactionp-of-transaction-fix (b* ((new-x (transaction-fix$inline x))) (transactionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm transaction-fix-when-transactionp (implies (transactionp x) (equal (transaction-fix x) x)))
Function:
(defun transaction-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (transactionp acl2::x) (transactionp acl2::y)))) (equal (transaction-fix acl2::x) (transaction-fix acl2::y)))
Theorem:
(defthm transaction-equiv-is-an-equivalence (and (booleanp (transaction-equiv x y)) (transaction-equiv x x) (implies (transaction-equiv x y) (transaction-equiv y x)) (implies (and (transaction-equiv x y) (transaction-equiv y z)) (transaction-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm transaction-equiv-implies-equal-transaction-fix-1 (implies (transaction-equiv acl2::x x-equiv) (equal (transaction-fix acl2::x) (transaction-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm transaction-fix-under-transaction-equiv (transaction-equiv (transaction-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-transaction-fix-1-forward-to-transaction-equiv (implies (equal (transaction-fix acl2::x) acl2::y) (transaction-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-transaction-fix-2-forward-to-transaction-equiv (implies (equal acl2::x (transaction-fix acl2::y)) (transaction-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm transaction-equiv-of-transaction-fix-1-forward (implies (transaction-equiv (transaction-fix acl2::x) acl2::y) (transaction-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm transaction-equiv-of-transaction-fix-2-forward (implies (transaction-equiv acl2::x (transaction-fix acl2::y)) (transaction-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)