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