• 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-follow-array-indices

    Signature
    (vl-follow-array-indices x type) → (mv err trace)
    Arguments
    x — Guard (vl-exprlist-p x).
    type — Guard (vl-datatype-p type).
    Returns
    err — Type (iff (vl-msg-p err) err).
    trace — Type (vl-seltrace-p trace).

    Definitions and Theorems

    Function: vl-follow-array-indices

    (defun vl-follow-array-indices (x type)
     (declare (xargs :guard (and (vl-exprlist-p x)
                                 (vl-datatype-p type))))
     (declare (xargs :guard (vl-datatype-resolved-p type)))
     (let ((__function__ 'vl-follow-array-indices))
      (declare (ignorable __function__))
      (b* (((when (atom x)) (mv nil nil))
           ((mv err caveat newtype &)
            (vl-datatype-remove-dim type))
           ((when err) (mv err nil))
           ((mv err rest)
            (vl-follow-array-indices (cdr x)
                                     newtype))
           ((when err) (mv err nil)))
       (mv
        nil
        (cons
            (make-vl-selstep :select (make-vl-select-index :val (car x))
                             :type newtype
                             :caveat caveat)
            rest)))))

    Theorem: return-type-of-vl-follow-array-indices.err

    (defthm return-type-of-vl-follow-array-indices.err
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (iff (vl-msg-p err) err))
      :rule-classes :rewrite)

    Theorem: vl-seltrace-p-of-vl-follow-array-indices.trace

    (defthm vl-seltrace-p-of-vl-follow-array-indices.trace
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (vl-seltrace-p trace))
      :rule-classes :rewrite)

    Theorem: vl-seltrace-usertypes-ok-of-follow-array-indices

    (defthm vl-seltrace-usertypes-ok-of-follow-array-indices
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (implies (vl-datatype-resolved-p type)
                 (vl-seltrace-usertypes-ok trace))))

    Theorem: true-listp-of-vl-follow-array-indices-trace

    (defthm true-listp-of-vl-follow-array-indices-trace
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (true-listp trace))
      :rule-classes :type-prescription)

    Theorem: vl-seltrace->indices-of-vl-follow-array-indices

    (defthm vl-seltrace->indices-of-vl-follow-array-indices
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (implies (not err)
                 (equal (vl-seltrace->indices trace)
                        (vl-exprlist-fix x)))))

    Theorem: consp-of-vl-follow-array-indices

    (defthm consp-of-vl-follow-array-indices
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (implies (not err)
                 (equal (consp trace) (consp x)))))

    Theorem: len-of-vl-follow-array-indices

    (defthm len-of-vl-follow-array-indices
      (b* (((mv ?err common-lisp::?trace)
            (vl-follow-array-indices x type)))
        (implies (not err)
                 (equal (len trace) (len x)))))

    Theorem: vl-follow-array-indices-of-vl-exprlist-fix-x

    (defthm vl-follow-array-indices-of-vl-exprlist-fix-x
      (equal (vl-follow-array-indices (vl-exprlist-fix x)
                                      type)
             (vl-follow-array-indices x type)))

    Theorem: vl-follow-array-indices-vl-exprlist-equiv-congruence-on-x

    (defthm vl-follow-array-indices-vl-exprlist-equiv-congruence-on-x
      (implies (vl-exprlist-equiv x x-equiv)
               (equal (vl-follow-array-indices x type)
                      (vl-follow-array-indices x-equiv type)))
      :rule-classes :congruence)

    Theorem: vl-follow-array-indices-of-vl-datatype-fix-type

    (defthm vl-follow-array-indices-of-vl-datatype-fix-type
      (equal (vl-follow-array-indices x (vl-datatype-fix type))
             (vl-follow-array-indices x type)))

    Theorem: vl-follow-array-indices-vl-datatype-equiv-congruence-on-type

    (defthm vl-follow-array-indices-vl-datatype-equiv-congruence-on-type
      (implies (vl-datatype-equiv type type-equiv)
               (equal (vl-follow-array-indices x type)
                      (vl-follow-array-indices x type-equiv)))
      :rule-classes :congruence)