Fixing function for jvaluex structures.
Function:
(defun jvaluex-fix$inline (acl2::x) (declare (xargs :guard (jvaluexp acl2::x))) (let ((__function__ 'jvaluex-fix)) (declare (ignorable __function__)) (mbe :logic (case (jvaluex-kind acl2::x) (:primitive (b* ((get (primitivex-value-fix acl2::x))) get)) (:reference (b* ((get (reference-value-fix acl2::x))) get))) :exec acl2::x)))
Theorem:
(defthm jvaluexp-of-jvaluex-fix (b* ((new-x (jvaluex-fix$inline acl2::x))) (jvaluexp new-x)) :rule-classes :rewrite)
Theorem:
(defthm jvaluex-fix-when-jvaluexp (implies (jvaluexp acl2::x) (equal (jvaluex-fix acl2::x) acl2::x)))
Function:
(defun jvaluex-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (jvaluexp acl2::x) (jvaluexp acl2::y)))) (equal (jvaluex-fix acl2::x) (jvaluex-fix acl2::y)))
Theorem:
(defthm jvaluex-equiv-is-an-equivalence (and (booleanp (jvaluex-equiv x y)) (jvaluex-equiv x x) (implies (jvaluex-equiv x y) (jvaluex-equiv y x)) (implies (and (jvaluex-equiv x y) (jvaluex-equiv y z)) (jvaluex-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm jvaluex-equiv-implies-equal-jvaluex-fix-1 (implies (jvaluex-equiv acl2::x x-equiv) (equal (jvaluex-fix acl2::x) (jvaluex-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm jvaluex-fix-under-jvaluex-equiv (jvaluex-equiv (jvaluex-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-jvaluex-fix-1-forward-to-jvaluex-equiv (implies (equal (jvaluex-fix acl2::x) acl2::y) (jvaluex-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-jvaluex-fix-2-forward-to-jvaluex-equiv (implies (equal acl2::x (jvaluex-fix acl2::y)) (jvaluex-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jvaluex-equiv-of-jvaluex-fix-1-forward (implies (jvaluex-equiv (jvaluex-fix acl2::x) acl2::y) (jvaluex-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jvaluex-equiv-of-jvaluex-fix-2-forward (implies (jvaluex-equiv acl2::x (jvaluex-fix acl2::y)) (jvaluex-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jvaluex-kind$inline-of-jvaluex-fix-x (equal (jvaluex-kind$inline (jvaluex-fix acl2::x)) (jvaluex-kind$inline acl2::x)))
Theorem:
(defthm jvaluex-kind$inline-jvaluex-equiv-congruence-on-x (implies (jvaluex-equiv acl2::x x-equiv) (equal (jvaluex-kind$inline acl2::x) (jvaluex-kind$inline x-equiv))) :rule-classes :congruence)