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