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