• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
            • Vl-interfaceportlist->ifnames
            • Vl-blockscope
            • Vl-scope-find-item
            • Vl-scopestack-find-item/ss/package
            • Vl-importlist-find-explicit-item
            • Vl-scopestack-find-item/context
            • Vl-importlist-find-implicit-item
            • Vl-import-stars-find-item
            • Vl-scopeinfo
            • Vl-importlist->explicit-item-alist
            • Vl-scopestack-find-definition/ss
            • Vl-scopeitem
            • Vl-scopeinfo-find-item
            • Vl-scopestack-find-package/ss
            • Vl-scopestack-find-item/ss
              • Vl-scopestack
              • Vl-scopestack-find-class/ss
              • Scopestack-constants
              • Vl-scope-namespace
              • Vl-scopestack-push
              • Vl-maybe-scope
              • Vl-importresult
              • Vl-scope-find-item-fast
              • Vl-module-scope-find-item
              • Vl-interface-scope-find-item
              • Vl-import-stars-itemnames
              • Vl-genblob-scope-find-item
              • Vl-scope->scopeinfo
              • Vl-design-scope-find-definition
              • Vl-scopestack-find-item
              • Vl-scopestack-find-definition
              • Vl-package-scope-find-item
              • Vl-interface-scope-find-portdecl
              • Vl-design-scope-find-item
              • Vl-blockscope-scope-find-item
              • Vl-scopestack-find-package
              • Vl-scopeinfo->itemnames
              • Vl-scope-find-portdecl
              • Vl-scope-find-definition
              • Vl-module-scope-find-portdecl
              • Vl-genblob-scope-find-portdecl
              • Vl-design-scope-find-package
              • Vl-class-scope-find-item
              • Vl-scope-find-package
              • Vl-design-scope-find-class
              • Vl-scopestack-find-class
              • Vl-scope-find-class
              • Vl-scopestack->hashkey
              • Vl-scope-find-portdecl-fast
              • Vl-scope-definition-alist
              • Vl-package-scope-item-alist-top
              • Vl-scopestack->path-aux
              • Vl-scopedef
              • Vl-scope-portdecl-alist
              • Vl-scope-package-alist
              • Vl-scope-find-package-fast
              • Vl-scope-find-definition-fast
              • Vl-scope-class-alist
              • Vl-scope-find-class-fast
              • Vl-scopestack->path
              • Vl-scopestack->design
              • Vl-scopestack-init
              • Vl-scopeitem->name
              • Vl-scope
              • Vl-importlist->star-packages
              • Vl-scopestack->toplevel
              • Vl-scopestack-pop
              • Vl-scopestack-nesting-level
              • Vl-scope->scopetype
              • Vl-scope->id
              • Vl-bindlist->modinsts
              • Vl-design-scope-package-alist-top
              • Vl-scopestack-toplevel-p
              • Vl-scopestacks-free
              • Vl-importresult-alist
            • Hid-tools
            • Filtering-by-name
            • Vl-interface-mocktype
            • Stripping-functions
            • Genblob
            • Expr-tools
            • Hierarchy
            • Extract-vl-types
            • Range-tools
            • Finding-by-name
            • Stmt-tools
            • Modnamespace
            • Flat-warnings
            • Reordering-by-name
            • Datatype-tools
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Scopestack

    Vl-scopestack-find-item/ss

    Look up a plain identifier in the current scope stack.

    Signature
    (vl-scopestack-find-item/ss name ss) → (mv item item-ss)
    Arguments
    name — Guard (stringp name).
    ss — Guard (vl-scopestack-p ss).
    Returns
    item — The item declaration, if found.
        Type (iff (vl-scopeitem-p item) item).
    item-ss — The scopestack for the context in which the item was declared.
        Type (vl-scopestack-p item-ss).

    Definitions and Theorems

    Function: vl-scopestack-find-item/ss

    (defun
     vl-scopestack-find-item/ss (name ss)
     (declare (xargs :guard (and (stringp name)
                                 (vl-scopestack-p ss))))
     (let
      ((__function__ 'vl-scopestack-find-item/ss))
      (declare (ignorable __function__))
      (b*
       (((mv item context-ss pkg-name)
         (vl-scopestack-find-item/context name ss))
        ((unless pkg-name) (mv item context-ss))
        (design (vl-scopestack->design context-ss))
        (pkg
         (and
           design
           (cdr (hons-get pkg-name
                          (vl-design-scope-package-alist-top design)))))
        ((unless pkg) (mv item nil))
        (pkg-ss (vl-scopestack-push pkg (vl-scopestack-init design))))
       (mv item pkg-ss))))

    Theorem: return-type-of-vl-scopestack-find-item/ss.item

    (defthm return-type-of-vl-scopestack-find-item/ss.item
            (b* (((mv ?item ?item-ss)
                  (vl-scopestack-find-item/ss name ss)))
                (iff (vl-scopeitem-p item) item))
            :rule-classes :rewrite)

    Theorem: vl-scopestack-p-of-vl-scopestack-find-item/ss.item-ss

    (defthm vl-scopestack-p-of-vl-scopestack-find-item/ss.item-ss
            (b* (((mv ?item ?item-ss)
                  (vl-scopestack-find-item/ss name ss)))
                (vl-scopestack-p item-ss))
            :rule-classes :rewrite)

    Theorem: vl-scopestack-find-item/ss-of-str-fix-name

    (defthm vl-scopestack-find-item/ss-of-str-fix-name
            (equal (vl-scopestack-find-item/ss (str-fix name)
                                               ss)
                   (vl-scopestack-find-item/ss name ss)))

    Theorem: vl-scopestack-find-item/ss-streqv-congruence-on-name

    (defthm vl-scopestack-find-item/ss-streqv-congruence-on-name
            (implies (streqv name name-equiv)
                     (equal (vl-scopestack-find-item/ss name ss)
                            (vl-scopestack-find-item/ss name-equiv ss)))
            :rule-classes :congruence)

    Theorem: vl-scopestack-find-item/ss-of-vl-scopestack-fix-ss

    (defthm
         vl-scopestack-find-item/ss-of-vl-scopestack-fix-ss
         (equal (vl-scopestack-find-item/ss name (vl-scopestack-fix ss))
                (vl-scopestack-find-item/ss name ss)))

    Theorem: vl-scopestack-find-item/ss-vl-scopestack-equiv-congruence-on-ss

    (defthm
         vl-scopestack-find-item/ss-vl-scopestack-equiv-congruence-on-ss
         (implies (vl-scopestack-equiv ss ss-equiv)
                  (equal (vl-scopestack-find-item/ss name ss)
                         (vl-scopestack-find-item/ss name ss-equiv)))
         :rule-classes :congruence)