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