(path-alist-fix x) is an fty alist fixing function that follows the fix-keys strategy.
(path-alist-fix x) → fty::newx
Note that in the execution this is just an inline identity function.
Function:
(defun path-alist-fix$inline (x) (declare (xargs :guard (path-alist-p x))) (let ((__function__ 'path-alist-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) x (if (consp (car x)) (cons (cons (path-fix (caar x)) (cdar x)) (path-alist-fix (cdr x))) (path-alist-fix (cdr x)))) :exec x)))
Theorem:
(defthm path-alist-p-of-path-alist-fix (b* ((fty::newx (path-alist-fix$inline x))) (path-alist-p fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm path-alist-fix-when-path-alist-p (implies (path-alist-p x) (equal (path-alist-fix x) x)))
Function:
(defun path-alist-equiv$inline (x y) (declare (xargs :guard (and (path-alist-p x) (path-alist-p y)))) (equal (path-alist-fix x) (path-alist-fix y)))
Theorem:
(defthm path-alist-equiv-is-an-equivalence (and (booleanp (path-alist-equiv x y)) (path-alist-equiv x x) (implies (path-alist-equiv x y) (path-alist-equiv y x)) (implies (and (path-alist-equiv x y) (path-alist-equiv y z)) (path-alist-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm path-alist-equiv-implies-equal-path-alist-fix-1 (implies (path-alist-equiv x x-equiv) (equal (path-alist-fix x) (path-alist-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm path-alist-fix-under-path-alist-equiv (path-alist-equiv (path-alist-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-path-alist-fix-1-forward-to-path-alist-equiv (implies (equal (path-alist-fix x) y) (path-alist-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-path-alist-fix-2-forward-to-path-alist-equiv (implies (equal x (path-alist-fix y)) (path-alist-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm path-alist-equiv-of-path-alist-fix-1-forward (implies (path-alist-equiv (path-alist-fix x) y) (path-alist-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm path-alist-equiv-of-path-alist-fix-2-forward (implies (path-alist-equiv x (path-alist-fix y)) (path-alist-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm cons-of-path-fix-k-under-path-alist-equiv (path-alist-equiv (cons (cons (path-fix acl2::k) acl2::v) x) (cons (cons acl2::k acl2::v) x)))
Theorem:
(defthm cons-path-equiv-congruence-on-k-under-path-alist-equiv (implies (path-equiv acl2::k k-equiv) (path-alist-equiv (cons (cons acl2::k acl2::v) x) (cons (cons k-equiv acl2::v) x))) :rule-classes :congruence)
Theorem:
(defthm cons-of-path-alist-fix-y-under-path-alist-equiv (path-alist-equiv (cons x (path-alist-fix y)) (cons x y)))
Theorem:
(defthm cons-path-alist-equiv-congruence-on-y-under-path-alist-equiv (implies (path-alist-equiv y y-equiv) (path-alist-equiv (cons x y) (cons x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm path-alist-fix-of-acons (equal (path-alist-fix (cons (cons acl2::a acl2::b) x)) (cons (cons (path-fix acl2::a) acl2::b) (path-alist-fix x))))
Theorem:
(defthm path-alist-fix-of-append (equal (path-alist-fix (append std::a std::b)) (append (path-alist-fix std::a) (path-alist-fix std::b))))
Theorem:
(defthm consp-car-of-path-alist-fix (equal (consp (car (path-alist-fix x))) (consp (path-alist-fix x))))