(vl-portdecl-sign-main portdecls vardecls warnings) → (mv warnings new-portdecls new-vardecls)
Function:
(defun vl-portdecl-sign-main (portdecls vardecls warnings) (declare (xargs :guard (and (vl-portdecllist-p portdecls) (vl-vardecllist-p vardecls) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-portdecl-sign-main)) (declare (ignorable __function__)) (b* ((portdecls (vl-portdecllist-fix portdecls)) (vardecls (vl-vardecllist-fix vardecls)) (pnames (vl-portdecllist->names portdecls)) (vnames (vl-vardecllist->names vardecls)) (dupe-ports (duplicated-members pnames)) ((when dupe-ports) (mv (fatal :type :vl-bad-ports :msg "Ports are declared multiple times: ~&0." :args (list dupe-ports)) portdecls vardecls)) (dupe-vars (duplicated-members vnames)) ((when dupe-vars) (mv (fatal :type :vl-bad-variables :msg "Variables are declared multiple times: ~&0." :args (list dupe-vars)) portdecls vardecls)) (missing (difference (mergesort pnames) (mergesort vnames))) ((when missing) (mv (fatal :type :vl-bad-ports :msg "Ports have no corresponding variable ~ declarations: ~&0." :args (list missing)) portdecls vardecls)) (port-vars (vl-reorder-vardecls pnames vardecls)) (non-port-vars (vl-delete-vardecls pnames vardecls)) ((mv ?okp warnings new-portdecls new-port-vars) (vl-portdecl-sign-list portdecls port-vars warnings)) (new-vardecls (append new-port-vars non-port-vars))) (mv (ok) new-portdecls new-vardecls))))
Theorem:
(defthm vl-warninglist-p-of-vl-portdecl-sign-main.warnings (b* (((mv ?warnings ?new-portdecls ?new-vardecls) (vl-portdecl-sign-main portdecls vardecls warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-portdecllist-p-of-vl-portdecl-sign-main.new-portdecls (b* (((mv ?warnings ?new-portdecls ?new-vardecls) (vl-portdecl-sign-main portdecls vardecls warnings))) (vl-portdecllist-p new-portdecls)) :rule-classes :rewrite)
Theorem:
(defthm vl-vardecllist-p-of-vl-portdecl-sign-main.new-vardecls (b* (((mv ?warnings ?new-portdecls ?new-vardecls) (vl-portdecl-sign-main portdecls vardecls warnings))) (vl-vardecllist-p new-vardecls)) :rule-classes :rewrite)
Theorem:
(defthm vl-portdecl-sign-main-of-vl-portdecllist-fix-portdecls (equal (vl-portdecl-sign-main (vl-portdecllist-fix portdecls) vardecls warnings) (vl-portdecl-sign-main portdecls vardecls warnings)))
Theorem:
(defthm vl-portdecl-sign-main-vl-portdecllist-equiv-congruence-on-portdecls (implies (vl-portdecllist-equiv portdecls portdecls-equiv) (equal (vl-portdecl-sign-main portdecls vardecls warnings) (vl-portdecl-sign-main portdecls-equiv vardecls warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-portdecl-sign-main-of-vl-vardecllist-fix-vardecls (equal (vl-portdecl-sign-main portdecls (vl-vardecllist-fix vardecls) warnings) (vl-portdecl-sign-main portdecls vardecls warnings)))
Theorem:
(defthm vl-portdecl-sign-main-vl-vardecllist-equiv-congruence-on-vardecls (implies (vl-vardecllist-equiv vardecls vardecls-equiv) (equal (vl-portdecl-sign-main portdecls vardecls warnings) (vl-portdecl-sign-main portdecls vardecls-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-portdecl-sign-main-of-vl-warninglist-fix-warnings (equal (vl-portdecl-sign-main portdecls vardecls (vl-warninglist-fix warnings)) (vl-portdecl-sign-main portdecls vardecls warnings)))
Theorem:
(defthm vl-portdecl-sign-main-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-portdecl-sign-main portdecls vardecls warnings) (vl-portdecl-sign-main portdecls vardecls warnings-equiv))) :rule-classes :congruence)