Fixing function for pointer structures.
Function:
(defun pointer-fix$inline (x) (declare (xargs :guard (pointerp x))) (let ((__function__ 'pointer-fix)) (declare (ignorable __function__)) (mbe :logic (case (pointer-kind x) (:null (cons :null (list))) (:dangling (cons :dangling (list))) (:valid (b* ((get (objdesign-fix (std::da-nth 0 (cdr x))))) (cons :valid (list get))))) :exec x)))
Theorem:
(defthm pointerp-of-pointer-fix (b* ((new-x (pointer-fix$inline x))) (pointerp new-x)) :rule-classes :rewrite)
Theorem:
(defthm pointer-fix-when-pointerp (implies (pointerp x) (equal (pointer-fix x) x)))
Function:
(defun pointer-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (pointerp acl2::x) (pointerp acl2::y)))) (equal (pointer-fix acl2::x) (pointer-fix acl2::y)))
Theorem:
(defthm pointer-equiv-is-an-equivalence (and (booleanp (pointer-equiv x y)) (pointer-equiv x x) (implies (pointer-equiv x y) (pointer-equiv y x)) (implies (and (pointer-equiv x y) (pointer-equiv y z)) (pointer-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm pointer-equiv-implies-equal-pointer-fix-1 (implies (pointer-equiv acl2::x x-equiv) (equal (pointer-fix acl2::x) (pointer-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm pointer-fix-under-pointer-equiv (pointer-equiv (pointer-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-pointer-fix-1-forward-to-pointer-equiv (implies (equal (pointer-fix acl2::x) acl2::y) (pointer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-pointer-fix-2-forward-to-pointer-equiv (implies (equal acl2::x (pointer-fix acl2::y)) (pointer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm pointer-equiv-of-pointer-fix-1-forward (implies (pointer-equiv (pointer-fix acl2::x) acl2::y) (pointer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm pointer-equiv-of-pointer-fix-2-forward (implies (pointer-equiv acl2::x (pointer-fix acl2::y)) (pointer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm pointer-kind$inline-of-pointer-fix-x (equal (pointer-kind$inline (pointer-fix x)) (pointer-kind$inline x)))
Theorem:
(defthm pointer-kind$inline-pointer-equiv-congruence-on-x (implies (pointer-equiv x x-equiv) (equal (pointer-kind$inline x) (pointer-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-pointer-fix (consp (pointer-fix x)) :rule-classes :type-prescription)