• 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->hashkey

    Produce a honsed, hopefully-unique hash key for this scope.

    Signature
    (vl-scopestack->hashkey x) → key
    Arguments
    x — Guard (vl-scopestack-p x).

    Uses the names of the scopes, so: if any scope is not named, it causes a hard error; and if the name of each scope isn't unique within its parent scope, then the hash key won't be unique.

    Running addnames before using this should ensure that scopes are named, and the names generated should be unique.

    Definitions and Theorems

    Function: vl-scopestack->hashkey

    (defun
     vl-scopestack->hashkey (x)
     (declare (xargs :guard (vl-scopestack-p x)))
     (let
       ((__function__ 'vl-scopestack->hashkey))
       (declare (ignorable __function__))
       (vl-scopestack-case
            x
            :null nil
            :global (hons :root nil)
            :local (b* ((super (vl-scopestack->hashkey x.super)))
                       (hons (or (vl-scope->id x.top)
                                 (raise "Unnamed scope under ~x0: ~x1~%"
                                        (rev super)
                                        x.top))
                             super)))))

    Theorem: vl-scopestack->hashkey-of-vl-scopestack-fix-x

    (defthm vl-scopestack->hashkey-of-vl-scopestack-fix-x
            (equal (vl-scopestack->hashkey (vl-scopestack-fix x))
                   (vl-scopestack->hashkey x)))

    Theorem: vl-scopestack->hashkey-vl-scopestack-equiv-congruence-on-x

    (defthm vl-scopestack->hashkey-vl-scopestack-equiv-congruence-on-x
            (implies (vl-scopestack-equiv x x-equiv)
                     (equal (vl-scopestack->hashkey x)
                            (vl-scopestack->hashkey x-equiv)))
            :rule-classes :congruence)