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