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