(vl-module-basicsanity x) → new-x
Function:
(defun vl-module-basicsanity (x) (declare (xargs :guard (vl-module-p x))) (let ((__function__ 'vl-module-basicsanity)) (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))))) (external-names (vl-portlist->names x.ports)) (dupes (duplicated-members (remove nil external-names))) (warnings (if (not dupes) warnings (fatal :type :vl-bad-ports :msg "Duplicate port names: ~&0." :args (list dupes))))) (change-vl-module x :warnings warnings))))
Theorem:
(defthm vl-module-p-of-vl-module-basicsanity (b* ((new-x (vl-module-basicsanity x))) (vl-module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-module-basicsanity-of-vl-module-fix-x (equal (vl-module-basicsanity (vl-module-fix x)) (vl-module-basicsanity x)))
Theorem:
(defthm vl-module-basicsanity-vl-module-equiv-congruence-on-x (implies (vl-module-equiv x x-equiv) (equal (vl-module-basicsanity x) (vl-module-basicsanity x-equiv))) :rule-classes :congruence)