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