Fixing function for state32 structures.
Function:
(defun state32-fix$inline (x) (declare (xargs :guard (state32p x))) (let ((__function__ 'state32-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((xregfile (xregfile32-fix (std::da-nth 0 (cdr x)))) (pc (ubyte32-fix (std::da-nth 1 (cdr x)))) (mem (memory32-fix (std::da-nth 2 (cdr x)))) (error (acl2::bool-fix (std::da-nth 3 (cdr x))))) (cons :state32 (list xregfile pc mem error))) :exec x)))
Theorem:
(defthm state32p-of-state32-fix (b* ((new-x (state32-fix$inline x))) (state32p new-x)) :rule-classes :rewrite)
Theorem:
(defthm state32-fix-when-state32p (implies (state32p x) (equal (state32-fix x) x)))
Function:
(defun state32-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (state32p acl2::x) (state32p acl2::y)))) (equal (state32-fix acl2::x) (state32-fix acl2::y)))
Theorem:
(defthm state32-equiv-is-an-equivalence (and (booleanp (state32-equiv x y)) (state32-equiv x x) (implies (state32-equiv x y) (state32-equiv y x)) (implies (and (state32-equiv x y) (state32-equiv y z)) (state32-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm state32-equiv-implies-equal-state32-fix-1 (implies (state32-equiv acl2::x x-equiv) (equal (state32-fix acl2::x) (state32-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm state32-fix-under-state32-equiv (state32-equiv (state32-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-state32-fix-1-forward-to-state32-equiv (implies (equal (state32-fix acl2::x) acl2::y) (state32-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-state32-fix-2-forward-to-state32-equiv (implies (equal acl2::x (state32-fix acl2::y)) (state32-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm state32-equiv-of-state32-fix-1-forward (implies (state32-equiv (state32-fix acl2::x) acl2::y) (state32-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm state32-equiv-of-state32-fix-2-forward (implies (state32-equiv acl2::x (state32-fix acl2::y)) (state32-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)