(funenv-fix x) is a usual ACL2::fty list fixing function.
In the logic, we apply funscope-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.
Function:
(defun funenv-fix$inline (x) (declare (xargs :guard (funenvp x))) (let ((__function__ 'funenv-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (cons (funscope-fix (car x)) (funenv-fix (cdr x)))) :exec x)))
Theorem:
(defthm funenvp-of-funenv-fix (b* ((fty::newx (funenv-fix$inline x))) (funenvp fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm funenv-fix-when-funenvp (implies (funenvp x) (equal (funenv-fix x) x)))
Function:
(defun funenv-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (funenvp acl2::x) (funenvp acl2::y)))) (equal (funenv-fix acl2::x) (funenv-fix acl2::y)))
Theorem:
(defthm funenv-equiv-is-an-equivalence (and (booleanp (funenv-equiv x y)) (funenv-equiv x x) (implies (funenv-equiv x y) (funenv-equiv y x)) (implies (and (funenv-equiv x y) (funenv-equiv y z)) (funenv-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm funenv-equiv-implies-equal-funenv-fix-1 (implies (funenv-equiv acl2::x x-equiv) (equal (funenv-fix acl2::x) (funenv-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm funenv-fix-under-funenv-equiv (funenv-equiv (funenv-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-funenv-fix-1-forward-to-funenv-equiv (implies (equal (funenv-fix acl2::x) acl2::y) (funenv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-funenv-fix-2-forward-to-funenv-equiv (implies (equal acl2::x (funenv-fix acl2::y)) (funenv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm funenv-equiv-of-funenv-fix-1-forward (implies (funenv-equiv (funenv-fix acl2::x) acl2::y) (funenv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm funenv-equiv-of-funenv-fix-2-forward (implies (funenv-equiv acl2::x (funenv-fix acl2::y)) (funenv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm car-of-funenv-fix-x-under-funscope-equiv (funscope-equiv (car (funenv-fix acl2::x)) (car acl2::x)))
Theorem:
(defthm car-funenv-equiv-congruence-on-x-under-funscope-equiv (implies (funenv-equiv acl2::x x-equiv) (funscope-equiv (car acl2::x) (car x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cdr-of-funenv-fix-x-under-funenv-equiv (funenv-equiv (cdr (funenv-fix acl2::x)) (cdr acl2::x)))
Theorem:
(defthm cdr-funenv-equiv-congruence-on-x-under-funenv-equiv (implies (funenv-equiv acl2::x x-equiv) (funenv-equiv (cdr acl2::x) (cdr x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cons-of-funscope-fix-x-under-funenv-equiv (funenv-equiv (cons (funscope-fix acl2::x) acl2::y) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-funscope-equiv-congruence-on-x-under-funenv-equiv (implies (funscope-equiv acl2::x x-equiv) (funenv-equiv (cons acl2::x acl2::y) (cons x-equiv acl2::y))) :rule-classes :congruence)
Theorem:
(defthm cons-of-funenv-fix-y-under-funenv-equiv (funenv-equiv (cons acl2::x (funenv-fix acl2::y)) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-funenv-equiv-congruence-on-y-under-funenv-equiv (implies (funenv-equiv acl2::y y-equiv) (funenv-equiv (cons acl2::x acl2::y) (cons acl2::x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-funenv-fix (equal (consp (funenv-fix acl2::x)) (consp acl2::x)))
Theorem:
(defthm funenv-fix-under-iff (iff (funenv-fix acl2::x) (consp acl2::x)))
Theorem:
(defthm funenv-fix-of-cons (equal (funenv-fix (cons a x)) (cons (funscope-fix a) (funenv-fix x))))
Theorem:
(defthm len-of-funenv-fix (equal (len (funenv-fix acl2::x)) (len acl2::x)))
Theorem:
(defthm funenv-fix-of-append (equal (funenv-fix (append std::a std::b)) (append (funenv-fix std::a) (funenv-fix std::b))))
Theorem:
(defthm funenv-fix-of-repeat (equal (funenv-fix (repeat acl2::n acl2::x)) (repeat acl2::n (funscope-fix acl2::x))))
Theorem:
(defthm list-equiv-refines-funenv-equiv (implies (list-equiv acl2::x acl2::y) (funenv-equiv acl2::x acl2::y)) :rule-classes :refinement)
Theorem:
(defthm nth-of-funenv-fix (equal (nth acl2::n (funenv-fix acl2::x)) (if (< (nfix acl2::n) (len acl2::x)) (funscope-fix (nth acl2::n acl2::x)) nil)))
Theorem:
(defthm funenv-equiv-implies-funenv-equiv-append-1 (implies (funenv-equiv acl2::x fty::x-equiv) (funenv-equiv (append acl2::x acl2::y) (append fty::x-equiv acl2::y))) :rule-classes (:congruence))
Theorem:
(defthm funenv-equiv-implies-funenv-equiv-append-2 (implies (funenv-equiv acl2::y fty::y-equiv) (funenv-equiv (append acl2::x acl2::y) (append acl2::x fty::y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm funenv-equiv-implies-funenv-equiv-nthcdr-2 (implies (funenv-equiv acl2::l l-equiv) (funenv-equiv (nthcdr acl2::n acl2::l) (nthcdr acl2::n l-equiv))) :rule-classes (:congruence))
Theorem:
(defthm funenv-equiv-implies-funenv-equiv-take-2 (implies (funenv-equiv acl2::l l-equiv) (funenv-equiv (take acl2::n acl2::l) (take acl2::n l-equiv))) :rule-classes (:congruence))