• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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-flatten-hidindex-aux
              • 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-flatten-hidindex

Converts a vl-hidindex-p into a string like "bar[3][4][5]".

Signature
(vl-flatten-hidindex x) → flat-string
Arguments
x — Guard (vl-expr-p x).
Returns
flat-string — Type (stringp flat-string).

Definitions and Theorems

Function: vl-flatten-hidindex

(defun vl-flatten-hidindex (x)
  (declare (xargs :guard (vl-expr-p x)))
  (declare (xargs :guard (and (vl-hidindex-p x)
                              (vl-hidindex-resolved-p x))))
  (let ((__function__ 'vl-flatten-hidindex))
    (declare (ignorable __function__))
    (b* ((name (vl-hidindex->name x))
         (indices (vl-hidindex->indices x))
         ((when (atom indices)) name)
         (acc nil)
         (acc (str::revappend-chars name acc))
         (acc (vl-flatten-hidindex-aux indices acc)))
      (str::rchars-to-string acc))))

Theorem: stringp-of-vl-flatten-hidindex

(defthm stringp-of-vl-flatten-hidindex
  (b* ((flat-string (vl-flatten-hidindex x)))
    (stringp flat-string))
  :rule-classes :type-prescription)

Theorem: vl-flatten-hidindex-of-vl-expr-fix-x

(defthm vl-flatten-hidindex-of-vl-expr-fix-x
  (equal (vl-flatten-hidindex (vl-expr-fix x))
         (vl-flatten-hidindex x)))

Theorem: vl-flatten-hidindex-vl-expr-equiv-congruence-on-x

(defthm vl-flatten-hidindex-vl-expr-equiv-congruence-on-x
  (implies (vl-expr-equiv x x-equiv)
           (equal (vl-flatten-hidindex x)
                  (vl-flatten-hidindex x-equiv)))
  :rule-classes :congruence)

Subtopics

Vl-flatten-hidindex-aux