• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
            • Following-hids
              • Vl-follow-hidexpr
              • Vl-partselect-type-top-dimension-replacement
              • Vl-hidindex-datatype-resolve-dims
              • Vl-follow-hidexpr-error
              • Vl-follow-hidexpr-dimscheck
              • Vl-index-find-type
              • Vl-follow-hidexpr-dimcheck
              • Vl-partselect-expr-type
              • Vl-ss-find-hidexpr-range!!
                • Vl-hidstep
                • Vl-ss-find-hidexpr-range
                • Vl-genarrayblocklist-find-block
                • Vl-flatten-hidindex
                • Vl-hidexpr-resolved-p
                • Vl-flatten-hidexpr
                • Vl-hidindex-resolved-p
                • Vl-hidtrace
              • Vl-hidexpr-traverse-datatype
              • Abstract-hids
              • Vl-hidexpr-find-type
            • Vl-consteval
            • Range-tools
            • Lvalexprs
            • Hierarchy
            • Finding-by-name
            • Expr-tools
            • Expr-slicing
            • Stripping-functions
            • Stmt-tools
            • Modnamespace
            • Vl-parse-expr-from-str
            • Welltyped
            • Reordering-by-name
            • Flat-warnings
            • Genblob
            • Expr-building
            • Datatype-tools
            • Syscalls
            • Relocate
            • Expr-cleaning
            • Namemangle
            • Caremask
            • Port-tools
            • Lvalues
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Following-hids

    Vl-ss-find-hidexpr-range!!

    The exclamation marks are there to get your attention.

    Signature
    (vl-ss-find-hidexpr-range!! x ss) → (mv warning range)
    Arguments
    x — Guard (vl-expr-p x).
    ss — Guard (vl-scopestack-p ss).
    Returns
    warning — Type (iff (vl-warning-p warning) warning).
    range — Type (vl-maybe-range-p range).

    This finds the range of the datatype of the given hid, using vl-datatype-range. In code that is not aware of multidimensional arrays/vectors, you should use vl-ss-find-hidexpr-range (without the exclamation marks) instead; it finds the datatype range using vl-datatype-range-conservative which will correctly produce warnings when the datatype is multidimensional.

    Definitions and Theorems

    Function: vl-ss-find-hidexpr-range!!

    (defun vl-ss-find-hidexpr-range!! (x ss)
      (declare (xargs :guard (and (vl-expr-p x)
                                  (vl-scopestack-p ss))))
      (declare (xargs :guard (vl-hidexpr-p x)))
      (let ((__function__ 'vl-ss-find-hidexpr-range!!))
        (declare (ignorable __function__))
        (b* (((mv warning type)
              (vl-hidexpr-find-type x ss (vl-expr-fix x)))
             ((when warning) (mv warning nil)))
          (vl-datatype-range type))))

    Theorem: return-type-of-vl-ss-find-hidexpr-range!!.warning

    (defthm return-type-of-vl-ss-find-hidexpr-range!!.warning
      (b* (((mv common-lisp::?warning ?range)
            (vl-ss-find-hidexpr-range!! x ss)))
        (iff (vl-warning-p warning) warning))
      :rule-classes :rewrite)

    Theorem: vl-maybe-range-p-of-vl-ss-find-hidexpr-range!!.range

    (defthm vl-maybe-range-p-of-vl-ss-find-hidexpr-range!!.range
      (b* (((mv common-lisp::?warning ?range)
            (vl-ss-find-hidexpr-range!! x ss)))
        (vl-maybe-range-p range))
      :rule-classes :rewrite)

    Theorem: vl-ss-find-hidexpr-range!!-of-vl-expr-fix-x

    (defthm vl-ss-find-hidexpr-range!!-of-vl-expr-fix-x
      (equal (vl-ss-find-hidexpr-range!! (vl-expr-fix x)
                                         ss)
             (vl-ss-find-hidexpr-range!! x ss)))

    Theorem: vl-ss-find-hidexpr-range!!-vl-expr-equiv-congruence-on-x

    (defthm vl-ss-find-hidexpr-range!!-vl-expr-equiv-congruence-on-x
      (implies (vl-expr-equiv x x-equiv)
               (equal (vl-ss-find-hidexpr-range!! x ss)
                      (vl-ss-find-hidexpr-range!! x-equiv ss)))
      :rule-classes :congruence)

    Theorem: vl-ss-find-hidexpr-range!!-of-vl-scopestack-fix-ss

    (defthm vl-ss-find-hidexpr-range!!-of-vl-scopestack-fix-ss
      (equal (vl-ss-find-hidexpr-range!! x (vl-scopestack-fix ss))
             (vl-ss-find-hidexpr-range!! x ss)))

    Theorem: vl-ss-find-hidexpr-range!!-vl-scopestack-equiv-congruence-on-ss

    (defthm
        vl-ss-find-hidexpr-range!!-vl-scopestack-equiv-congruence-on-ss
      (implies (vl-scopestack-equiv ss ss-equiv)
               (equal (vl-ss-find-hidexpr-range!! x ss)
                      (vl-ss-find-hidexpr-range!! x ss-equiv)))
      :rule-classes :congruence)