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