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