Look up a plain identifier to find an item in a scope.
(vl-scope-find-item name scope design) → (mv pkg-name item)
Function:
(defun vl-scope-find-item (name scope design) (declare (xargs :guard (and (stringp name) (vl-scope-p scope) (vl-maybe-design-p design)))) (let ((__function__ 'vl-scope-find-item)) (declare (ignorable __function__)) (b* ((scope (vl-scope-fix scope))) (case (tag scope) (:vl-interface (b* (((vl-interface scope :quietp t)) (item (vl-interface-scope-find-item name scope)) ((when item) (mv nil item)) ((mv pkg item) (vl-importlist-find-explicit-item name scope.imports design)) ((when (or pkg item)) (mv pkg item))) (vl-importlist-find-implicit-item name scope.imports design))) (:vl-module (b* (((vl-module scope :quietp t)) (item (vl-module-scope-find-item name scope)) ((when item) (mv nil item)) ((mv pkg item) (vl-importlist-find-explicit-item name scope.imports design)) ((when (or pkg item)) (mv pkg item))) (vl-importlist-find-implicit-item name scope.imports design))) (:vl-genblob (b* (((vl-genblob scope :quietp t)) (item (vl-genblob-scope-find-item name scope)) ((when item) (mv nil item)) ((mv pkg item) (vl-importlist-find-explicit-item name scope.imports design)) ((when (or pkg item)) (mv pkg item))) (vl-importlist-find-implicit-item name scope.imports design))) (:vl-blockscope (b* (((vl-blockscope scope :quietp t)) (item (vl-blockscope-scope-find-item name scope)) ((when item) (mv nil item)) ((mv pkg item) (vl-importlist-find-explicit-item name scope.imports design)) ((when (or pkg item)) (mv pkg item))) (vl-importlist-find-implicit-item name scope.imports design))) (:vl-design (b* (((vl-design scope :quietp t)) (item (vl-design-scope-find-item name scope)) ((when item) (mv nil item)) ((mv pkg item) (vl-importlist-find-explicit-item name scope.imports design)) ((when (or pkg item)) (mv pkg item))) (vl-importlist-find-implicit-item name scope.imports design))) (:vl-package (b* (((vl-package scope :quietp t)) (item (vl-package-scope-find-item name scope)) ((when item) (mv nil item)) ((mv pkg item) (vl-importlist-find-explicit-item name scope.imports design)) ((when (or pkg item)) (mv pkg item))) (vl-importlist-find-implicit-item name scope.imports design))) (:vl-scopeinfo (vl-scopeinfo-find-item name scope design)) (otherwise (mv nil nil))))))
Theorem:
(defthm return-type-of-vl-scope-find-item.pkg-name (b* (((mv ?pkg-name ?item) (vl-scope-find-item name scope design))) (iff (stringp pkg-name) pkg-name)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-scope-find-item.item (b* (((mv ?pkg-name ?item) (vl-scope-find-item name scope design))) (iff (vl-scopeitem-p item) item)) :rule-classes :rewrite)
Theorem:
(defthm maybe-string-type-of-vl-scope-find-item-pkg-name (b* (((mv ?pkg-name ?item) (vl-scope-find-item name scope design))) (or (stringp pkg-name) (not pkg-name))) :rule-classes :type-prescription)
Theorem:
(defthm vl-scope-find-item-of-str-fix-name (equal (vl-scope-find-item (str-fix name) scope design) (vl-scope-find-item name scope design)))
Theorem:
(defthm vl-scope-find-item-streqv-congruence-on-name (implies (streqv name name-equiv) (equal (vl-scope-find-item name scope design) (vl-scope-find-item name-equiv scope design))) :rule-classes :congruence)
Theorem:
(defthm vl-scope-find-item-of-vl-scope-fix-scope (equal (vl-scope-find-item name (vl-scope-fix scope) design) (vl-scope-find-item name scope design)))
Theorem:
(defthm vl-scope-find-item-vl-scope-equiv-congruence-on-scope (implies (vl-scope-equiv scope scope-equiv) (equal (vl-scope-find-item name scope design) (vl-scope-find-item name scope-equiv design))) :rule-classes :congruence)
Theorem:
(defthm vl-scope-find-item-of-vl-maybe-design-fix-design (equal (vl-scope-find-item name scope (vl-maybe-design-fix design)) (vl-scope-find-item name scope design)))
Theorem:
(defthm vl-scope-find-item-vl-maybe-design-equiv-congruence-on-design (implies (vl-maybe-design-equiv design design-equiv) (equal (vl-scope-find-item name scope design) (vl-scope-find-item name scope design-equiv))) :rule-classes :congruence)