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