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