Resolve arguments in a vl-modinst-p.
(vl-modinst-argresolve x ss warnings) → (mv warnings new-x)
Function:
(defun vl-modinst-argresolve (x ss warnings) (declare (xargs :guard (and (vl-modinst-p x) (vl-scopestack-p ss) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-modinst-argresolve)) (declare (ignorable __function__)) (b* ((x (vl-modinst-fix x)) ((vl-modinst x) x) (submod (vl-scopestack-find-definition x.modname ss)) ((unless (and submod (or (eq (tag submod) :vl-module) (eq (tag submod) :vl-interface)))) (mv (fatal :type :vl-unresolved-instance :msg "~a0 refers to undefined module ~m1." :args (list x x.modname)) x)) (submod-warnings (if (eq (tag submod) :vl-module) (vl-module->warnings submod) (vl-interface->warnings submod))) (submod-parse-errors (vl-keep-warnings '(:vl-parse-error) submod-warnings)) ((when submod-parse-errors) (mv (fatal :type :vl-instance-of-unparsed :msg "~a0 refers to ~s1 ~m2, which has a parse error." :args (list x (if (eq (tag submod) :vl-module) "module" "interface") x.modname)) x)) (submod.ports (if (eq (tag submod) :vl-module) (vl-module->ports submod) (vl-interface->ports submod))) ((mv warnings new-args) (vl-arguments-argresolve x.portargs ss submod.ports submod warnings x)) (new-x (change-vl-modinst x :portargs new-args))) (mv (ok) new-x))))
Theorem:
(defthm vl-warninglist-p-of-vl-modinst-argresolve.warnings (b* (((mv ?warnings ?new-x) (vl-modinst-argresolve x ss warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-modinst-p-of-vl-modinst-argresolve.new-x (b* (((mv ?warnings ?new-x) (vl-modinst-argresolve x ss warnings))) (vl-modinst-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-modinst-argresolve-of-vl-modinst-fix-x (equal (vl-modinst-argresolve (vl-modinst-fix x) ss warnings) (vl-modinst-argresolve x ss warnings)))
Theorem:
(defthm vl-modinst-argresolve-vl-modinst-equiv-congruence-on-x (implies (vl-modinst-equiv x x-equiv) (equal (vl-modinst-argresolve x ss warnings) (vl-modinst-argresolve x-equiv ss warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-modinst-argresolve-of-vl-scopestack-fix-ss (equal (vl-modinst-argresolve x (vl-scopestack-fix ss) warnings) (vl-modinst-argresolve x ss warnings)))
Theorem:
(defthm vl-modinst-argresolve-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-modinst-argresolve x ss warnings) (vl-modinst-argresolve x ss-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-modinst-argresolve-of-vl-warninglist-fix-warnings (equal (vl-modinst-argresolve x ss (vl-warninglist-fix warnings)) (vl-modinst-argresolve x ss warnings)))
Theorem:
(defthm vl-modinst-argresolve-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-modinst-argresolve x ss warnings) (vl-modinst-argresolve x ss warnings-equiv))) :rule-classes :congruence)