Fixing function for validator-state structures.
(validator-state-fix x) → new-x
Function:
(defun validator-state-fix$inline (x) (declare (xargs :guard (validator-statep x))) (let ((__function__ 'validator-state-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((round (pos-fix (cdr (std::da-nth 0 x)))) (dag (certificate-set-fix (cdr (std::da-nth 1 x)))) (buffer (certificate-set-fix (cdr (std::da-nth 2 x)))) (endorsed (address+pos-set-fix (cdr (std::da-nth 3 x)))) (last (nfix (cdr (std::da-nth 4 x)))) (blockchain (block-list-fix (cdr (std::da-nth 5 x)))) (committed (certificate-set-fix (cdr (std::da-nth 6 x)))) (timer (timer-fix (cdr (std::da-nth 7 x))))) (list (cons 'round round) (cons 'dag dag) (cons 'buffer buffer) (cons 'endorsed endorsed) (cons 'last last) (cons 'blockchain blockchain) (cons 'committed committed) (cons 'timer timer))) :exec x)))
Theorem:
(defthm validator-statep-of-validator-state-fix (b* ((new-x (validator-state-fix$inline x))) (validator-statep new-x)) :rule-classes :rewrite)
Theorem:
(defthm validator-state-fix-when-validator-statep (implies (validator-statep x) (equal (validator-state-fix x) x)))
Function:
(defun validator-state-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (validator-statep acl2::x) (validator-statep acl2::y)))) (equal (validator-state-fix acl2::x) (validator-state-fix acl2::y)))
Theorem:
(defthm validator-state-equiv-is-an-equivalence (and (booleanp (validator-state-equiv x y)) (validator-state-equiv x x) (implies (validator-state-equiv x y) (validator-state-equiv y x)) (implies (and (validator-state-equiv x y) (validator-state-equiv y z)) (validator-state-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm validator-state-equiv-implies-equal-validator-state-fix-1 (implies (validator-state-equiv acl2::x x-equiv) (equal (validator-state-fix acl2::x) (validator-state-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm validator-state-fix-under-validator-state-equiv (validator-state-equiv (validator-state-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-validator-state-fix-1-forward-to-validator-state-equiv (implies (equal (validator-state-fix acl2::x) acl2::y) (validator-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-validator-state-fix-2-forward-to-validator-state-equiv (implies (equal acl2::x (validator-state-fix acl2::y)) (validator-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm validator-state-equiv-of-validator-state-fix-1-forward (implies (validator-state-equiv (validator-state-fix acl2::x) acl2::y) (validator-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm validator-state-equiv-of-validator-state-fix-2-forward (implies (validator-state-equiv acl2::x (validator-state-fix acl2::y)) (validator-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)