(vl-module-portcheck x) → new-x
Function:
(defun vl-module-portcheck (x) (declare (xargs :guard (vl-module-p x))) (let ((__function__ 'vl-module-portcheck)) (declare (ignorable __function__)) (b* (((vl-module x) x) (bad-warnings (vl-portlist-check-wellformed x.ports)) ((when bad-warnings) (change-vl-module x :warnings (append bad-warnings x.warnings))) (warnings x.warnings) (warnings (vl-portlist-check-style x.ports warnings)) (decl-names (mergesort (vl-portdecllist->names x.portdecls))) (port-names (mergesort (vl-portlist->internalnames x.ports))) (warnings (if (subset decl-names port-names) warnings (fatal :type :vl-port-mismatch :msg "Port declarations for non-ports: ~&0." :args (list (difference decl-names port-names))))) (warnings (if (subset port-names decl-names) warnings (fatal :type :vl-port-mismatch :msg "Missing port declarations for ~&0." :args (list (difference port-names decl-names)))))) (change-vl-module x :warnings warnings))))
Theorem:
(defthm vl-module-p-of-vl-module-portcheck (b* ((new-x (vl-module-portcheck x))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module-portcheck-of-vl-module-fix-x (equal (vl-module-portcheck (vl-module-fix x)) (vl-module-portcheck x)))
Theorem:
(defthm vl-module-portcheck-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-portcheck x) (vl-module-portcheck x-equiv))) :rule-classes :congruence)