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