• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
        • Symbolic-test-vector
        • Vl-to-svex
          • Vl-to-sv
          • Vl-design->sv-design
            • Vl-simpconfig
            • Vl-hierarchy-sv-translation
            • Vl-expr-svex-translation
              • Sv::vl-expr.lisp
                • Vl-scopecontext-to-addr
                • Vl-binaryop-to-svex
                • Vl-expr-to-svex-maybe-typed
                • Vl-datatype-syscall-to-svex
                • Vl-operandinfo-to-svex-preproc
                • Vl-structmemberlist->types
                • Vl-seltrace-to-svex-select
                • Vl-portdecllist->types
                • Vl-operandinfo-to-svex-select
                • Vl-plusminus-partselect->svex
                • Vl-arrayrange->rel-lsb-and-width
                • Vl-unaryop-to-svex
                • Vl-funcall-args-to-ordered
                • Vl-expr-to-svex-lhs
                • Vl-operandinfo-to-svex
                • Vl-array-assignpat-keyval-resolve
                • Vl-err->vfatal
                • Vl-datatypelist-usertype-resolve
                • Vl-upscope-to-svex-upscope
                • Vl-err->fatal
                • Vl-streaming-concat-trunc/extend
                • Vl-operandinfo-base-svar
                • Vl-index-shift-amount
                • Vttree->constraints
                • Vl-slicesize-resolve
                • Vl-function-map-find-matching-aux
                • Vl-funname-lookup
                  • Vl-datatype-size-warn
                  • Svex-repeat-aux
                  • Vl-$test$plusargs-to-svex
                  • Svex-extend
                  • Vl-structmemberlist-shift-bits
                  • Vl-datatype-slot-width/range
                  • Vl-datatype-index-shift-amount
                  • Vl-datatype-field-shift-amount
                  • 4vec-extend
                  • Vl-function-pair-inputs-with-actuals
                  • Vl-expr-to-svex-untyped
                  • Vl-function-map-check-matching
                  • Vl-datatype-syscall-remove-dims
                  • Svex-concat-list-aux
                  • Vttree-add-constraints
                  • Vttree-add-warnings
                  • Vl-check-struct-assignpat-keys
                  • Vl-check-array-assignpat-keys
                  • Sv::constraintlist-subst-memo
                  • Vl-svex-keyval-index-lookup
                  • Vl-function-map-find-matching
                  • Vl-convert-dollarsign-to-expr
                  • Vttree->constraints-acc
                  • Vl-seltrace-type
                  • Vl-seltrace-to-path
                  • Vl-keyval-member-lookup
                  • Svex-repeat
                  • Vttree->warnings-acc
                  • Vl-trunc/extend-type-err
                  • Constraintlist-add-ctx
                  • Vl-hidtrace-add-to-path
                  • Svex-multiconcat
                  • Vttree-join
                  • Vl-value-to-string-aux
                  • Vl-seltrace-add-to-path
                  • Vl-value-to-4vec
                  • Vl-expr-to-svex-selfdet
                  • Vl-svex-keyval-default-lookup
                  • Vl-$test$plusargs-p
                  • Vl-value-to-svex
                  • Vl-value-in-range
                  • Vl-keyval-default-lookup
                  • Sv::svexlist-args-extract-constants
                  • Vl-string->bits
                  • Vl-size-to-unsigned-logic
                  • Vl-hidtrace-to-path
                  • Svex-concat-list
                  • Vttree->warnings
                  • Vl-seltrace-unres-count
                  • Vl-datatype-index-is-bitselect
                  • Vl-bitlist->4vec
                  • Vl-svex-keyvallist-vars
                  • Vl-hidstep->svex-index
                  • Vl-selstep->svex-name
                  • Vl-datatypelist-resolved-p
                  • Vl-datatype-$unpacked_dimensions
                  • Vl-datatype-$dimensions
                  • Vl-bitlist->offset
                  • Vl-bitlist->onset
                  • Vl-streamexprlist-has-with
                  • Vl-hidstep-resolved-p
                  • Vl-expr-needs-type-context
                  • Vl-streamexprlist->exprs
                  • Vl-integer-to-string
                  • Vl-hidtrace-resolved-p
                  • Vl-selstep-resolved-p
                  • Vl-select-resolved-p
                  • Vl-svex-keyvallist
                  • Vl-datatypelist
                  • Svex-x
                • Vttree
              • Vl-design->svex-modalist
              • Vl-svstmt
            • Vl-to-sv-main
            • Vl-simplify-sv
            • Vl-user-paramsettings->unparam-names
            • Vl-user-paramsettings->modnames
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Sv::vl-expr.lisp

    Vl-funname-lookup

    Signature
    (vl-funname-lookup x ss) → (mv err decl decl-ss elabpath)
    Arguments
    x — Guard (vl-scopeexpr-p x).
    ss — Guard (vl-scopestack-p ss).
    Returns
    err — Type (iff (vl-msg-p err) err).
    decl — Type (implies (not err) (vl-fundecl-p decl)).
    decl-ss — Type (implies (not err) (vl-scopestack-p decl-ss)).
    elabpath — Type (vl-elabtraversal-p elabpath).

    Definitions and Theorems

    Function: vl-funname-lookup

    (defun vl-funname-lookup (x ss)
     (declare (xargs :guard (and (vl-scopeexpr-p x)
                                 (vl-scopestack-p ss))))
     (let ((__function__ 'vl-funname-lookup))
      (declare (ignorable __function__))
      (b*
       (((mv err trace ?context ?tail)
         (vl-follow-scopeexpr x ss))
        ((when err) (mv err nil nil nil))
        ((unless (vl-hidtrace-resolved-p trace))
         (mv (vmsg "Function ~a0 has unresolved indices??"
                   :args (list (vl-scopeexpr-fix x)))
             nil nil nil))
        ((vl-hidstep lookup) (car trace))
        ((unless (eq (tag lookup.item) :vl-fundecl))
         (mv
          (vmsg
           "Function name ~a0 does not refer to a fundecl but instead ~
                       ~a1"
           :args (list (vl-scopeexpr-fix x) lookup.item))
          nil nil nil)))
       (mv nil lookup.item
           lookup.ss lookup.elabpath))))

    Theorem: return-type-of-vl-funname-lookup.err

    (defthm return-type-of-vl-funname-lookup.err
      (b* (((mv ?err ?decl ?decl-ss ?elabpath)
            (vl-funname-lookup x ss)))
        (iff (vl-msg-p err) err))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-funname-lookup.decl

    (defthm return-type-of-vl-funname-lookup.decl
      (b* (((mv ?err ?decl ?decl-ss ?elabpath)
            (vl-funname-lookup x ss)))
        (implies (not err) (vl-fundecl-p decl)))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-funname-lookup.decl-ss

    (defthm return-type-of-vl-funname-lookup.decl-ss
      (b* (((mv ?err ?decl ?decl-ss ?elabpath)
            (vl-funname-lookup x ss)))
        (implies (not err)
                 (vl-scopestack-p decl-ss)))
      :rule-classes :rewrite)

    Theorem: vl-elabtraversal-p-of-vl-funname-lookup.elabpath

    (defthm vl-elabtraversal-p-of-vl-funname-lookup.elabpath
      (b* (((mv ?err ?decl ?decl-ss ?elabpath)
            (vl-funname-lookup x ss)))
        (vl-elabtraversal-p elabpath))
      :rule-classes :rewrite)

    Theorem: vl-funname-lookup-of-vl-scopeexpr-fix-x

    (defthm vl-funname-lookup-of-vl-scopeexpr-fix-x
      (equal (vl-funname-lookup (vl-scopeexpr-fix x)
                                ss)
             (vl-funname-lookup x ss)))

    Theorem: vl-funname-lookup-vl-scopeexpr-equiv-congruence-on-x

    (defthm vl-funname-lookup-vl-scopeexpr-equiv-congruence-on-x
      (implies (vl-scopeexpr-equiv x x-equiv)
               (equal (vl-funname-lookup x ss)
                      (vl-funname-lookup x-equiv ss)))
      :rule-classes :congruence)

    Theorem: vl-funname-lookup-of-vl-scopestack-fix-ss

    (defthm vl-funname-lookup-of-vl-scopestack-fix-ss
      (equal (vl-funname-lookup x (vl-scopestack-fix ss))
             (vl-funname-lookup x ss)))

    Theorem: vl-funname-lookup-vl-scopestack-equiv-congruence-on-ss

    (defthm vl-funname-lookup-vl-scopestack-equiv-congruence-on-ss
      (implies (vl-scopestack-equiv ss ss-equiv)
               (equal (vl-funname-lookup x ss)
                      (vl-funname-lookup x ss-equiv)))
      :rule-classes :congruence)