Eliminate dead code in function scopes.
We transform all the function information values of the map.
Function:
(defun funscope-dead (funscope) (declare (xargs :guard (funscopep funscope))) (let ((__function__ 'funscope-dead)) (declare (ignorable __function__)) (b* ((funscope (funscope-fix funscope)) ((when (omap::emptyp funscope)) nil) ((mv name info) (omap::head funscope))) (omap::update name (funinfo-dead info) (funscope-dead (omap::tail funscope))))))
Theorem:
(defthm funscopep-of-funscope-dead (b* ((new-funscope (funscope-dead funscope))) (funscopep new-funscope)) :rule-classes :rewrite)
Theorem:
(defthm keys-of-funscope-dead (implies (funscopep funscope) (equal (omap::keys (funscope-dead funscope)) (omap::keys funscope))))
Theorem:
(defthm consp-of-in-of-funscope-dead (implies (funscopep funscope) (equal (consp (omap::assoc fun (funscope-dead funscope))) (consp (omap::assoc fun funscope)))))
Theorem:
(defthm cdr-of-in-of-funscope-dead (implies (and (funscopep funscope) (omap::assoc fun funscope)) (equal (cdr (omap::assoc fun (funscope-dead funscope))) (funinfo-dead (cdr (omap::assoc fun funscope))))))
Theorem:
(defthm funscope-dead-of-update (implies (and (identifierp name) (funinfop info) (funscopep funscope)) (equal (funscope-dead (omap::update name info funscope)) (omap::update name (funinfo-dead info) (funscope-dead funscope)))))
Theorem:
(defthm funscope-dead-of-funscope-fix-funscope (equal (funscope-dead (funscope-fix funscope)) (funscope-dead funscope)))
Theorem:
(defthm funscope-dead-funscope-equiv-congruence-on-funscope (implies (funscope-equiv funscope funscope-equiv) (equal (funscope-dead funscope) (funscope-dead funscope-equiv))) :rule-classes :congruence)