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

    Converts a hierarchical identifier expression into a string like foo.bar[3][4][5].baz.

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

    Definitions and Theorems

    Function: vl-flatten-hidexpr

    (defun vl-flatten-hidexpr (x)
      (declare (xargs :guard (vl-expr-p x)))
      (declare (xargs :guard (and (vl-hidexpr-p x)
                                  (vl-hidexpr-resolved-p x))))
      (let ((__function__ 'vl-flatten-hidexpr))
        (declare (ignorable __function__))
        (if (vl-hidexpr->endp x)
            (vl-hidname->name x)
          (cat (vl-flatten-hidindex (vl-hidexpr->first x))
               "."
               (vl-flatten-hidexpr (vl-hidexpr->rest x))))))

    Theorem: stringp-of-vl-flatten-hidexpr

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

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

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

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

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