• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • 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-hid-prefix-for-subhid

    Given a hid and a suffix, such as a.b.c.d and c.d, return the hid without the suffix, i.e. a.b.

    Signature
    (vl-hid-prefix-for-subhid outer inner) → prefix-hid
    Arguments
    outer — Guard (vl-hidexpr-p outer).
    inner — Guard (vl-hidexpr-p inner).
    Returns
    prefix-hid — Type (vl-hidexpr-p prefix-hid).

    Definitions and Theorems

    Function: vl-hid-prefix-for-subhid

    (defun vl-hid-prefix-for-subhid (outer inner)
     (declare (xargs :guard (and (vl-hidexpr-p outer)
                                 (vl-hidexpr-p inner))))
     (declare (xargs :guard (vl-subhid-p inner outer)))
     (let ((__function__ 'vl-hid-prefix-for-subhid))
      (declare (ignorable __function__))
      (vl-hidexpr-case
         outer :end (vl-hidexpr-fix outer)
         :dot
         (if (vl-hidexpr-equiv inner outer)
             (make-vl-hidexpr-end :name (vl-hidindex->name outer.first))
           (make-vl-hidexpr-dot
                :first outer.first
                :rest (vl-hid-prefix-for-subhid outer.rest inner))))))

    Theorem: vl-hidexpr-p-of-vl-hid-prefix-for-subhid

    (defthm vl-hidexpr-p-of-vl-hid-prefix-for-subhid
      (b* ((prefix-hid (vl-hid-prefix-for-subhid outer inner)))
        (vl-hidexpr-p prefix-hid))
      :rule-classes :rewrite)

    Theorem: vl-hid-prefix-for-subhid-of-vl-hidexpr-fix-outer

    (defthm vl-hid-prefix-for-subhid-of-vl-hidexpr-fix-outer
      (equal (vl-hid-prefix-for-subhid (vl-hidexpr-fix outer)
                                       inner)
             (vl-hid-prefix-for-subhid outer inner)))

    Theorem: vl-hid-prefix-for-subhid-vl-hidexpr-equiv-congruence-on-outer

    (defthm
          vl-hid-prefix-for-subhid-vl-hidexpr-equiv-congruence-on-outer
      (implies (vl-hidexpr-equiv outer outer-equiv)
               (equal (vl-hid-prefix-for-subhid outer inner)
                      (vl-hid-prefix-for-subhid outer-equiv inner)))
      :rule-classes :congruence)

    Theorem: vl-hid-prefix-for-subhid-of-vl-hidexpr-fix-inner

    (defthm vl-hid-prefix-for-subhid-of-vl-hidexpr-fix-inner
      (equal (vl-hid-prefix-for-subhid outer (vl-hidexpr-fix inner))
             (vl-hid-prefix-for-subhid outer inner)))

    Theorem: vl-hid-prefix-for-subhid-vl-hidexpr-equiv-congruence-on-inner

    (defthm
          vl-hid-prefix-for-subhid-vl-hidexpr-equiv-congruence-on-inner
      (implies (vl-hidexpr-equiv inner inner-equiv)
               (equal (vl-hid-prefix-for-subhid outer inner)
                      (vl-hid-prefix-for-subhid outer inner-equiv)))
      :rule-classes :congruence)