• 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
          • 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
            • Vl-make-binary-gateinstlist
            • Vl-make-binary-gateinst
            • Vl-make-unary-gateinstlist
            • Vl-make-bitselect
            • Vl-make-unary-gateinst
            • Vl-make-partselect
            • Vl-make-msb-to-lsb-bitselects
            • Vl-make-list-of-bitselects
              • Vl-default-n-bit-expr
            • 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
    • Expr-building

    Vl-make-list-of-bitselects

    Build a list of expressions, (expr[low] ... expr[high]).

    Signature
    (vl-make-list-of-bitselects expr low high) → exprs
    Arguments
    expr — Guard (vl-expr-p expr).
    low — Guard (natp low).
    high — Guard (natp high).
    Returns
    exprs — Type (vl-exprlist-p exprs).

    Definitions and Theorems

    Function: vl-make-list-of-bitselects

    (defun vl-make-list-of-bitselects (expr low high)
      (declare (xargs :guard (and (vl-expr-p expr)
                                  (natp low)
                                  (natp high))))
      (declare (xargs :guard (<= low high)))
      (let ((__function__ 'vl-make-list-of-bitselects))
        (declare (ignorable __function__))
        (if (mbe :logic (zp (- (nfix high) (nfix low)))
                 :exec (eql high low))
            (list (vl-make-bitselect expr low))
          (cons (vl-make-bitselect expr low)
                (vl-make-list-of-bitselects expr (+ (nfix low) 1)
                                            high)))))

    Theorem: vl-exprlist-p-of-vl-make-list-of-bitselects

    (defthm vl-exprlist-p-of-vl-make-list-of-bitselects
      (b* ((exprs (vl-make-list-of-bitselects expr low high)))
        (vl-exprlist-p exprs))
      :rule-classes :rewrite)

    Theorem: len-of-vl-make-list-of-bitselects

    (defthm len-of-vl-make-list-of-bitselects
      (equal (len (vl-make-list-of-bitselects expr low high))
             (+ 1 (nfix (- (nfix high) (nfix low))))))

    Theorem: vl-exprlist->finalwidths-of-vl-make-list-of-bitselects

    (defthm vl-exprlist->finalwidths-of-vl-make-list-of-bitselects
      (equal (vl-exprlist->finalwidths
                  (vl-make-list-of-bitselects expr low high))
             (replicate (+ 1 (nfix (- (nfix high) (nfix low))))
                        1)))

    Theorem: vl-exprlist->finaltypes-of-vl-make-list-of-bitselects

    (defthm vl-exprlist->finaltypes-of-vl-make-list-of-bitselects
      (equal (vl-exprlist->finaltypes
                  (vl-make-list-of-bitselects expr low high))
             (replicate (+ 1 (nfix (- (nfix high) (nfix low))))
                        :vl-unsigned)))

    Theorem: vl-make-list-of-bitselects-of-vl-expr-fix-expr

    (defthm vl-make-list-of-bitselects-of-vl-expr-fix-expr
      (equal (vl-make-list-of-bitselects (vl-expr-fix expr)
                                         low high)
             (vl-make-list-of-bitselects expr low high)))

    Theorem: vl-make-list-of-bitselects-vl-expr-equiv-congruence-on-expr

    (defthm vl-make-list-of-bitselects-vl-expr-equiv-congruence-on-expr
      (implies (vl-expr-equiv expr expr-equiv)
               (equal (vl-make-list-of-bitselects expr low high)
                      (vl-make-list-of-bitselects expr-equiv low high)))
      :rule-classes :congruence)

    Theorem: vl-make-list-of-bitselects-of-nfix-low

    (defthm vl-make-list-of-bitselects-of-nfix-low
      (equal (vl-make-list-of-bitselects expr (nfix low)
                                         high)
             (vl-make-list-of-bitselects expr low high)))

    Theorem: vl-make-list-of-bitselects-nat-equiv-congruence-on-low

    (defthm vl-make-list-of-bitselects-nat-equiv-congruence-on-low
      (implies (acl2::nat-equiv low low-equiv)
               (equal (vl-make-list-of-bitselects expr low high)
                      (vl-make-list-of-bitselects expr low-equiv high)))
      :rule-classes :congruence)

    Theorem: vl-make-list-of-bitselects-of-nfix-high

    (defthm vl-make-list-of-bitselects-of-nfix-high
      (equal (vl-make-list-of-bitselects expr low (nfix high))
             (vl-make-list-of-bitselects expr low high)))

    Theorem: vl-make-list-of-bitselects-nat-equiv-congruence-on-high

    (defthm vl-make-list-of-bitselects-nat-equiv-congruence-on-high
      (implies (acl2::nat-equiv high high-equiv)
               (equal (vl-make-list-of-bitselects expr low high)
                      (vl-make-list-of-bitselects expr low high-equiv)))
      :rule-classes :congruence)