(vl-module-elim-supplies x) → new-x
Function:
(defun vl-module-elim-supplies (x) (declare (xargs :guard (vl-module-p x))) (let ((__function__ 'vl-module-elim-supplies)) (declare (ignorable __function__)) (b* (((vl-module x) (vl-module-fix x)) ((when (vl-module->hands-offp x)) x) (palist (vl-make-portdecl-alist x.portdecls)) ((mv warnings new-decls supply0s supply1s) (vl-collect-supplies x.vardecls x.portdecls palist x.warnings)) (- (fast-alist-free palist)) ((when (and (not supply0s) (not supply1s) (equal warnings x.warnings))) x) (x (change-vl-module x :vardecls new-decls :warnings warnings)) (zeroes (replicate (length supply0s) (make-vl-atom :guts (make-vl-constint :origwidth 1 :origtype :vl-unsigned :value 0) :finalwidth 1 :finaltype :vl-unsigned))) (ones (replicate (length supply1s) (make-vl-atom :guts (make-vl-constint :origwidth 1 :origtype :vl-unsigned :value 1) :finalwidth 1 :finaltype :vl-unsigned))) (sigma (revappend (pairlis$ supply0s zeroes) (pairlis$ supply1s ones)))) (with-fast-alist sigma (vl-module-subst x sigma)))))
Theorem:
(defthm vl-module-p-of-vl-module-elim-supplies (b* ((new-x (vl-module-elim-supplies x))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module-elim-supplies-of-vl-module-fix-x (equal (vl-module-elim-supplies (vl-module-fix x)) (vl-module-elim-supplies x)))
Theorem:
(defthm vl-module-elim-supplies-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-elim-supplies x) (vl-module-elim-supplies x-equiv))) :rule-classes :congruence)