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