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