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