Fixing function for certificate structures.
(certificate-fix x) → new-x
Function:
(defun certificate-fix$inline (x) (declare (xargs :guard (certificatep x))) (let ((__function__ 'certificate-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((author (address-fix (cdr (std::da-nth 0 x)))) (round (pos-fix (cdr (std::da-nth 1 x)))) (transactions (transaction-list-fix (cdr (std::da-nth 2 x)))) (previous (address-set-fix (cdr (std::da-nth 3 x)))) (endorsers (address-set-fix (cdr (std::da-nth 4 x))))) (list (cons 'author author) (cons 'round round) (cons 'transactions transactions) (cons 'previous previous) (cons 'endorsers endorsers))) :exec x)))
Theorem:
(defthm certificatep-of-certificate-fix (b* ((new-x (certificate-fix$inline x))) (certificatep new-x)) :rule-classes :rewrite)
Theorem:
(defthm certificate-fix-when-certificatep (implies (certificatep x) (equal (certificate-fix x) x)))
Function:
(defun certificate-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (certificatep acl2::x) (certificatep acl2::y)))) (equal (certificate-fix acl2::x) (certificate-fix acl2::y)))
Theorem:
(defthm certificate-equiv-is-an-equivalence (and (booleanp (certificate-equiv x y)) (certificate-equiv x x) (implies (certificate-equiv x y) (certificate-equiv y x)) (implies (and (certificate-equiv x y) (certificate-equiv y z)) (certificate-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm certificate-equiv-implies-equal-certificate-fix-1 (implies (certificate-equiv acl2::x x-equiv) (equal (certificate-fix acl2::x) (certificate-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm certificate-fix-under-certificate-equiv (certificate-equiv (certificate-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-certificate-fix-1-forward-to-certificate-equiv (implies (equal (certificate-fix acl2::x) acl2::y) (certificate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-certificate-fix-2-forward-to-certificate-equiv (implies (equal acl2::x (certificate-fix acl2::y)) (certificate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm certificate-equiv-of-certificate-fix-1-forward (implies (certificate-equiv (certificate-fix acl2::x) acl2::y) (certificate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm certificate-equiv-of-certificate-fix-2-forward (implies (certificate-equiv acl2::x (certificate-fix acl2::y)) (certificate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)