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