Main function for checking for name shadowing.
(vl-shadowcheck-aux x st warnings) → (mv st warnings)
Function:
(defun vl-shadowcheck-aux (x st warnings) (declare (xargs :guard (and (vl-genelementlist-p x) (vl-shadowcheck-state-p st) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-shadowcheck-aux)) (declare (ignorable __function__)) (b* ((x (vl-genelementlist-fix x)) (st (vl-shadowcheck-state-fix st)) (warnings (vl-warninglist-fix warnings)) ((when (atom x)) (mv st warnings)) ((unless (eq (vl-genelement-kind (car x)) :vl-genbase)) (vl-shadowcheck-aux (cdr x) st warnings)) (elem (vl-genelement-fix (car x))) (item (vl-genbase->item elem)) (tag (tag item)) (- (vl-shadowcheck-debug " ---- ~a0 ---- ~%" item)) ((when (or (eq tag :vl-interfaceport) (eq tag :vl-regularport))) (raise "We shouldn't see ports here.") (vl-shadowcheck-aux (cdr x) st warnings)) ((when (eq tag :vl-portdecl)) (b* (((mv st warnings) (vl-shadowcheck-portdecl item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-vardecl)) (b* (((mv st warnings) (vl-shadowcheck-vardecl item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-paramdecl)) (b* (((mv st warnings) (vl-shadowcheck-paramdecl item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-assign)) (b* (((mv st warnings) (vl-shadowcheck-assign item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-gateinst)) (b* (((mv st warnings) (vl-shadowcheck-gateinst item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-modinst)) (b* (((mv st warnings) (vl-shadowcheck-modinst item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-always)) (b* (((mv st warnings) (vl-shadowcheck-always item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-initial)) (b* (((mv st warnings) (vl-shadowcheck-initial item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-fundecl)) (b* (((mv st warnings) (vl-shadowcheck-fundecl item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-taskdecl)) (b* (((mv st warnings) (vl-shadowcheck-taskdecl item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) ((when (eq tag :vl-import)) (b* (((mv st warnings) (vl-shadowcheck-import item st warnings))) (vl-shadowcheck-aux (cdr x) st warnings))) (warnings (fatal :type :vl-unexpected-modelement :msg "~a0: unexpected kind of module item." :args (list item)))) (vl-shadowcheck-aux (cdr x) st warnings))))
Theorem:
(defthm vl-shadowcheck-state-p-of-vl-shadowcheck-aux.st (b* (((mv ?st ?warnings) (vl-shadowcheck-aux x st warnings))) (vl-shadowcheck-state-p st)) :rule-classes :rewrite)
Theorem:
(defthm vl-warninglist-p-of-vl-shadowcheck-aux.warnings (b* (((mv ?st ?warnings) (vl-shadowcheck-aux x st warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-shadowcheck-aux-of-vl-genelementlist-fix-x (equal (vl-shadowcheck-aux (vl-genelementlist-fix x) st warnings) (vl-shadowcheck-aux x st warnings)))
Theorem:
(defthm vl-shadowcheck-aux-vl-genelementlist-equiv-congruence-on-x (implies (vl-genelementlist-equiv x x-equiv) (equal (vl-shadowcheck-aux x st warnings) (vl-shadowcheck-aux x-equiv st warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-shadowcheck-aux-of-vl-shadowcheck-state-fix-st (equal (vl-shadowcheck-aux x (vl-shadowcheck-state-fix st) warnings) (vl-shadowcheck-aux x st warnings)))
Theorem:
(defthm vl-shadowcheck-aux-vl-shadowcheck-state-equiv-congruence-on-st (implies (vl-shadowcheck-state-equiv st st-equiv) (equal (vl-shadowcheck-aux x st warnings) (vl-shadowcheck-aux x st-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-shadowcheck-aux-of-vl-warninglist-fix-warnings (equal (vl-shadowcheck-aux x st (vl-warninglist-fix warnings)) (vl-shadowcheck-aux x st warnings)))
Theorem:
(defthm vl-shadowcheck-aux-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-shadowcheck-aux x st warnings) (vl-shadowcheck-aux x st warnings-equiv))) :rule-classes :congruence)