Convert gates throughout a module.
(vl-module-gate-elim x primalist) → (mv new-x addmods)
Function:
(defun vl-module-gate-elim (x primalist) (declare (xargs :guard (and (vl-module-p x) (vl-primalist-p primalist)))) (let ((__function__ 'vl-module-gate-elim)) (declare (ignorable __function__)) (b* (((vl-module x) x) ((when (vl-module->hands-offp x)) (mv x nil)) ((unless x.gateinsts) (mv x nil)) ((mv warnings new-gateinsts new-modinsts addmods) (vl-gateinstlist-gate-elim x.gateinsts primalist x.warnings)) (new-x (change-vl-module x :warnings warnings :gateinsts new-gateinsts :modinsts (append new-modinsts x.modinsts)))) (mv new-x addmods))))
Theorem:
(defthm vl-module-p-of-vl-module-gate-elim.new-x (implies (and (force (vl-module-p x)) (force (vl-primalist-p primalist))) (b* (((mv ?new-x ?addmods) (vl-module-gate-elim x primalist))) (vl-module-p new-x))) :rule-classes :rewrite)
Theorem:
(defthm vl-modulelist-p-of-vl-module-gate-elim.addmods (implies (and (force (vl-module-p x)) (force (vl-primalist-p primalist))) (b* (((mv ?new-x ?addmods) (vl-module-gate-elim x primalist))) (vl-modulelist-p addmods))) :rule-classes :rewrite)
Theorem:
(defthm vl-module-gate-elim-mvtypes-1 (true-listp (mv-nth 1 (vl-module-gate-elim x primalist))) :rule-classes :type-prescription)