• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
            • Vl-follow-hidexpr
            • Vl-index-expr-typetrace
            • Vl-follow-scopeexpr
            • Vl-follow-hidexpr-dimscheck
            • Vl-datatype-resolve-selects
            • Vl-datatype-remove-dim
            • Vl-operandinfo
            • Vl-follow-hidexpr-dimcheck
            • Vl-follow-data-selects
            • Vl-follow-hidexpr-error
              • Vl-hidstep
              • Vl-scopestack-find-item/ss/path
              • Vl-follow-array-indices
              • Vl-scopecontext
              • Vl-datatype-set-unsigned
              • Vl-selstep
              • Vl-scopestack-find-elabpath
              • Vl-hid-prefix-for-subhid
              • Vl-find-structmember
              • Vl-select
              • Vl-scopeexpr-replace-hid
              • Vl-genblocklist-find-block
              • Vl-partselect-width
              • Vl-seltrace->indices
              • Vl-datatype->structmembers
              • Vl-hidexpr-resolved-p
              • Vl-operandinfo->indices
              • Vl-flatten-hidindex
              • Vl-subhid-p
              • Vl-seltrace-usertypes-ok
              • Vl-flatten-hidexpr
              • Vl-scopeexpr->hid
              • Vl-seltrace-index-count
              • Vl-operandinfo-usertypes-ok
              • Vl-operandinfo-index-count
              • Vl-datatype-dims-count
              • Vl-scopeexpr-index-count
              • Vl-hidexpr-index-count
              • Vl-usertype-lookup
              • Vl-hidindex-resolved-p
              • Vl-scopeexpr-resolved-p
              • Vl-selstep-usertypes-ok
              • Vl-hidtrace
              • Vl-seltrace
              • Vl-scopedef-interface-p
            • Filtering-by-name
            • Vl-interface-mocktype
            • Stripping-functions
            • Genblob
            • Expr-tools
            • Extract-vl-types
            • Hierarchy
            • 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
      • Math
      • Testing-utilities
    • Hid-tools

    Vl-follow-hidexpr-error

    Report an error while following a HID.

    Signature
    (vl-follow-hidexpr-error short ss &key (origx 'origx) (x 'x)) 
      → 
    msg
    Arguments
    short — Brief description of the error.
        Guard (vl-msg-p short).
    ss — Detailed context for the error.
        Guard (vl-scopestack-p ss).
    origx — Original, full HID being resolved.
        Guard (vl-scopeexpr-p origx).
    x — Current place in the HID.
        Guard (vl-hidexpr-p x).
    Returns
    msg — Type (vl-msg-p msg).

    This is smart in a few ways: it distinguishes between ordinary identifiers and hierarchical identifiers in the error type, and avoids providing excessive context if we haven't gotten anywhere down into the HID yet.

    Definitions and Theorems

    Function: vl-follow-hidexpr-error-fn

    (defun vl-follow-hidexpr-error-fn (short ss origx x)
     (declare (xargs :guard (and (vl-msg-p short)
                                 (vl-scopestack-p ss)
                                 (vl-scopeexpr-p origx)
                                 (vl-hidexpr-p x))))
     (let ((__function__ 'vl-follow-hidexpr-error))
      (declare (ignorable __function__))
      (b* ((x (vl-hidexpr-fix x))
           (origx (vl-scopeexpr-fix origx))
           (short (vl-msg-fix short))
           (endp (vl-scopeexpr-case origx :end))
           ((when (and endp
                       (equal x (vl-scopeexpr-end->hid origx))))
            (vmsg "error resolving ~a1: ~@2."
                  nil origx short)))
       (vmsg
        "error resolving ~a1: ~@2.~%~
                               (Failed to resolve ~a3 in ~s4)."
        nil origx
        short x (vl-scopestack->path ss)))))

    Theorem: vl-msg-p-of-vl-follow-hidexpr-error

    (defthm vl-msg-p-of-vl-follow-hidexpr-error
      (b* ((msg (vl-follow-hidexpr-error-fn short ss origx x)))
        (vl-msg-p msg))
      :rule-classes :rewrite)

    Theorem: vl-follow-hidexpr-error-fn-of-vl-msg-fix-short

    (defthm vl-follow-hidexpr-error-fn-of-vl-msg-fix-short
      (equal (vl-follow-hidexpr-error-fn (vl-msg-fix short)
                                         ss origx x)
             (vl-follow-hidexpr-error-fn short ss origx x)))

    Theorem: vl-follow-hidexpr-error-fn-vl-msg-equiv-congruence-on-short

    (defthm vl-follow-hidexpr-error-fn-vl-msg-equiv-congruence-on-short
      (implies
           (vl-msg-equiv short short-equiv)
           (equal (vl-follow-hidexpr-error-fn short ss origx x)
                  (vl-follow-hidexpr-error-fn short-equiv ss origx x)))
      :rule-classes :congruence)

    Theorem: vl-follow-hidexpr-error-fn-of-vl-scopestack-fix-ss

    (defthm vl-follow-hidexpr-error-fn-of-vl-scopestack-fix-ss
      (equal (vl-follow-hidexpr-error-fn short (vl-scopestack-fix ss)
                                         origx x)
             (vl-follow-hidexpr-error-fn short ss origx x)))

    Theorem: vl-follow-hidexpr-error-fn-vl-scopestack-equiv-congruence-on-ss

    (defthm
        vl-follow-hidexpr-error-fn-vl-scopestack-equiv-congruence-on-ss
      (implies
           (vl-scopestack-equiv ss ss-equiv)
           (equal (vl-follow-hidexpr-error-fn short ss origx x)
                  (vl-follow-hidexpr-error-fn short ss-equiv origx x)))
      :rule-classes :congruence)

    Theorem: vl-follow-hidexpr-error-fn-of-vl-scopeexpr-fix-origx

    (defthm vl-follow-hidexpr-error-fn-of-vl-scopeexpr-fix-origx
      (equal
           (vl-follow-hidexpr-error-fn short ss (vl-scopeexpr-fix origx)
                                       x)
           (vl-follow-hidexpr-error-fn short ss origx x)))

    Theorem: vl-follow-hidexpr-error-fn-vl-scopeexpr-equiv-congruence-on-origx

    (defthm
      vl-follow-hidexpr-error-fn-vl-scopeexpr-equiv-congruence-on-origx
      (implies
           (vl-scopeexpr-equiv origx origx-equiv)
           (equal (vl-follow-hidexpr-error-fn short ss origx x)
                  (vl-follow-hidexpr-error-fn short ss origx-equiv x)))
      :rule-classes :congruence)

    Theorem: vl-follow-hidexpr-error-fn-of-vl-hidexpr-fix-x

    (defthm vl-follow-hidexpr-error-fn-of-vl-hidexpr-fix-x
     (equal
          (vl-follow-hidexpr-error-fn short ss origx (vl-hidexpr-fix x))
          (vl-follow-hidexpr-error-fn short ss origx x)))

    Theorem: vl-follow-hidexpr-error-fn-vl-hidexpr-equiv-congruence-on-x

    (defthm vl-follow-hidexpr-error-fn-vl-hidexpr-equiv-congruence-on-x
      (implies
           (vl-hidexpr-equiv x x-equiv)
           (equal (vl-follow-hidexpr-error-fn short ss origx x)
                  (vl-follow-hidexpr-error-fn short ss origx x-equiv)))
      :rule-classes :congruence)