Fixing function for system-state structures.
(system-state-fix x) → new-x
Function:
(defun system-state-fix$inline (x) (declare (xargs :guard (system-statep x))) (let ((__function__ 'system-state-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((validators (validators-state-fix (cdr (std::da-nth 0 x)))) (network (message-set-fix (cdr (std::da-nth 1 x))))) (list (cons 'validators validators) (cons 'network network))) :exec x)))
Theorem:
(defthm system-statep-of-system-state-fix (b* ((new-x (system-state-fix$inline x))) (system-statep new-x)) :rule-classes :rewrite)
Theorem:
(defthm system-state-fix-when-system-statep (implies (system-statep x) (equal (system-state-fix x) x)))
Function:
(defun system-state-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (system-statep acl2::x) (system-statep acl2::y)))) (equal (system-state-fix acl2::x) (system-state-fix acl2::y)))
Theorem:
(defthm system-state-equiv-is-an-equivalence (and (booleanp (system-state-equiv x y)) (system-state-equiv x x) (implies (system-state-equiv x y) (system-state-equiv y x)) (implies (and (system-state-equiv x y) (system-state-equiv y z)) (system-state-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm system-state-equiv-implies-equal-system-state-fix-1 (implies (system-state-equiv acl2::x x-equiv) (equal (system-state-fix acl2::x) (system-state-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm system-state-fix-under-system-state-equiv (system-state-equiv (system-state-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-system-state-fix-1-forward-to-system-state-equiv (implies (equal (system-state-fix acl2::x) acl2::y) (system-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-system-state-fix-2-forward-to-system-state-equiv (implies (equal acl2::x (system-state-fix acl2::y)) (system-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm system-state-equiv-of-system-state-fix-1-forward (implies (system-state-equiv (system-state-fix acl2::x) acl2::y) (system-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm system-state-equiv-of-system-state-fix-2-forward (implies (system-state-equiv acl2::x (system-state-fix acl2::y)) (system-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)