(vl-module-check-namespace x) → new-x
Function:
(defun vl-module-check-namespace (x) (declare (xargs :guard (vl-module-p x))) (let ((__function__ 'vl-module-check-namespace)) (declare (ignorable __function__)) (b* (((vl-module x) x) (warnings x.warnings) (portdupes (duplicated-members (remove nil (vl-portlist->names x.ports)))) (warnings (if portdupes (fatal :type :vl-bad-ports :msg "Duplicate port names: ~&0." :args (list portdupes)) warnings)) (pdnames (vl-portdecllist->names x.portdecls)) (pdnames-s (mergesort pdnames)) (warnings (if (mbe :logic (no-duplicatesp-equal pdnames) :exec (same-lengthp pdnames pdnames-s)) warnings (fatal :type :vl-bad-portdecls :msg "Duplicate port declaration names: ~&0." :args (list (duplicated-members pdnames))))) (namespace (vl-module->modnamespace x)) (namespace-s (mergesort namespace)) (warnings (if (mbe :logic (no-duplicatesp-equal namespace) :exec (same-lengthp namespace namespace-s)) warnings (fatal :type :vl-namespace-error :msg "Illegal redefinition of ~&0." :args (list (duplicated-members namespace))))) (overlap (intersect pdnames-s namespace-s)) (palist (vl-make-portdecl-alist x.portdecls)) (ialist (vl-make-moditem-alist x)) ((mv & warnings) (vl-overlap-compatible-p-warn overlap x palist ialist warnings))) (change-vl-module x :warnings warnings))))
Theorem:
(defthm vl-module-p-of-vl-module-check-namespace (b* ((new-x (vl-module-check-namespace x))) (vl-module-p new-x)) :rule-classes :rewrite)