Fixing function for primitive-value structures.
(primitive-value-fix acl2::x) → new-x
Function:
(defun primitive-value-fix$inline (acl2::x) (declare (xargs :guard (primitive-valuep acl2::x))) (let ((__function__ 'primitive-value-fix)) (declare (ignorable __function__)) (mbe :logic (case (primitive-value-kind acl2::x) (:boolean (b* ((get (boolean-value-fix acl2::x))) get)) (:char (b* ((get (char-value-fix acl2::x))) get)) (:byte (b* ((get (byte-value-fix acl2::x))) get)) (:short (b* ((get (short-value-fix acl2::x))) get)) (:int (b* ((get (int-value-fix acl2::x))) get)) (:long (b* ((get (long-value-fix acl2::x))) get)) (:float (b* ((get (float-value-fix acl2::x))) get)) (:double (b* ((get (double-value-fix acl2::x))) get))) :exec acl2::x)))
Theorem:
(defthm primitive-valuep-of-primitive-value-fix (b* ((new-x (primitive-value-fix$inline acl2::x))) (primitive-valuep new-x)) :rule-classes :rewrite)
Theorem:
(defthm primitive-value-fix-when-primitive-valuep (implies (primitive-valuep acl2::x) (equal (primitive-value-fix acl2::x) acl2::x)))
Function:
(defun primitive-value-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (primitive-valuep acl2::x) (primitive-valuep acl2::y)))) (equal (primitive-value-fix acl2::x) (primitive-value-fix acl2::y)))
Theorem:
(defthm primitive-value-equiv-is-an-equivalence (and (booleanp (primitive-value-equiv x y)) (primitive-value-equiv x x) (implies (primitive-value-equiv x y) (primitive-value-equiv y x)) (implies (and (primitive-value-equiv x y) (primitive-value-equiv y z)) (primitive-value-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm primitive-value-equiv-implies-equal-primitive-value-fix-1 (implies (primitive-value-equiv acl2::x x-equiv) (equal (primitive-value-fix acl2::x) (primitive-value-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm primitive-value-fix-under-primitive-value-equiv (primitive-value-equiv (primitive-value-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-primitive-value-fix-1-forward-to-primitive-value-equiv (implies (equal (primitive-value-fix acl2::x) acl2::y) (primitive-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-primitive-value-fix-2-forward-to-primitive-value-equiv (implies (equal acl2::x (primitive-value-fix acl2::y)) (primitive-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm primitive-value-equiv-of-primitive-value-fix-1-forward (implies (primitive-value-equiv (primitive-value-fix acl2::x) acl2::y) (primitive-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm primitive-value-equiv-of-primitive-value-fix-2-forward (implies (primitive-value-equiv acl2::x (primitive-value-fix acl2::y)) (primitive-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm primitive-value-kind$inline-of-primitive-value-fix-x (equal (primitive-value-kind$inline (primitive-value-fix acl2::x)) (primitive-value-kind$inline acl2::x)))
Theorem:
(defthm primitive-value-kind$inline-primitive-value-equiv-congruence-on-x (implies (primitive-value-equiv acl2::x x-equiv) (equal (primitive-value-kind$inline acl2::x) (primitive-value-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-primitive-value-fix (consp (primitive-value-fix acl2::x)) :rule-classes :type-prescription)