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