Name any unnamed module and gate instances throughout a module.
(vl-module-addinstnames x) → new-x
Function:
(defun vl-module-addinstnames (x) (declare (xargs :guard (vl-module-p x))) (let ((__function__ 'vl-module-addinstnames)) (declare (ignorable __function__)) (mbe :logic (b* (((vl-module x) x) ((when (vl-module->hands-offp x)) (vl-module-fix x)) (nf (vl-starting-namefactory x)) ((mv modinsts nf) (vl-modinstlist-addinstnames x.modinsts nf)) ((mv gateinsts ?nf) (vl-gateinstlist-addinstnames x.gateinsts nf))) (change-vl-module x :modinsts modinsts :gateinsts gateinsts)) :exec (b* (((vl-module x) x) ((when (vl-module->hands-offp x)) x) (mods-namedp (vl-modinstlist-all-named-p x.modinsts)) (gates-namedp (vl-gateinstlist-all-named-p x.gateinsts)) ((when (and mods-namedp gates-namedp)) x) (nf (vl-starting-namefactory x)) ((mv modinsts nf) (if mods-namedp (mv x.modinsts nf) (vl-modinstlist-addinstnames x.modinsts nf))) ((mv gateinsts nf) (if gates-namedp (mv x.gateinsts nf) (vl-gateinstlist-addinstnames x.gateinsts nf)))) (vl-free-namefactory nf) (change-vl-module x :modinsts modinsts :gateinsts gateinsts)))))
Theorem:
(defthm vl-module-p-of-vl-module-addinstnames (b* ((new-x (vl-module-addinstnames x))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module->name-of-vl-module-addinstnames (equal (vl-module->name (vl-module-addinstnames x)) (vl-module->name x)))
Theorem:
(defthm vl-module-addinstnames-of-vl-module-fix-x (equal (vl-module-addinstnames (vl-module-fix x)) (vl-module-addinstnames x)))
Theorem:
(defthm vl-module-addinstnames-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-addinstnames x) (vl-module-addinstnames x-equiv))) :rule-classes :congruence)