Eliminate dead code in function environments.
We transform all the function scopes in the list.
Function:
(defun funenv-dead (funenv) (declare (xargs :guard (funenvp funenv))) (let ((__function__ 'funenv-dead)) (declare (ignorable __function__)) (cond ((endp funenv) nil) (t (cons (funscope-dead (car funenv)) (funenv-dead (cdr funenv)))))))
Theorem:
(defthm funenvp-of-funenv-dead (b* ((new-funenv (funenv-dead funenv))) (funenvp new-funenv)) :rule-classes :rewrite)
Theorem:
(defthm funenv-dead-of-cons (equal (funenv-dead (cons funscope funscopes)) (cons (funscope-dead funscope) (funenv-dead funscopes))))
Theorem:
(defthm funenv-dead-of-funenv-fix-funenv (equal (funenv-dead (funenv-fix funenv)) (funenv-dead funenv)))
Theorem:
(defthm funenv-dead-funenv-equiv-congruence-on-funenv (implies (funenv-equiv funenv funenv-equiv) (equal (funenv-dead funenv) (funenv-dead funenv-equiv))) :rule-classes :congruence)