• 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
          • Vl-consteval
            • Vl-consteval-$bits
            • Vl-consteval-shiftop
            • Vl-consteval-concat
              • Vl-consteval-ans
              • Vl-consteval-unary-reduxop
              • Vl-consteval-binop
              • Vl-consteval-cmpop
              • Vl-consteval-usertype-bits
              • Vl-consteval-binlogic
              • Vl-clog2
              • Vl-consteval-basictype-bits
              • Vl-consteval-wideunary
              • Vl-consteval-main
              • *vl-fake-elem-for-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
    • Vl-consteval

    Vl-consteval-concat

    Signature
    (vl-consteval-concat x val-acc width-acc) → ans
    Arguments
    x — Guard (vl-exprlist-p x).
    val-acc — Guard (natp val-acc).
    width-acc — Guard (natp width-acc).
    Returns
    ans — Type (vl-expr-p ans).

    Definitions and Theorems

    Function: vl-consteval-concat

    (defun vl-consteval-concat (x val-acc width-acc)
     (declare (xargs :guard (and (vl-exprlist-p x)
                                 (natp val-acc)
                                 (natp width-acc))))
     (declare (xargs :guard (and (vl-exprlist-resolved-p x)
                                 (consp x)
                                 (unsigned-byte-p width-acc val-acc))))
     (let ((__function__ 'vl-consteval-concat))
       (declare (ignorable __function__))
       (b*
         (((vl-constint x1)
           (vl-atom->guts (car x)))
          (val-acc (acl2::logapp x1.origwidth x1.value (lnfix val-acc)))
          (width-acc (+ x1.origwidth (lnfix width-acc)))
          ((when (atom (cdr x)))
           (vl-consteval-ans :value val-acc
                             :width width-acc
                             :type :vl-unsigned)))
         (vl-consteval-concat (cdr x)
                              val-acc width-acc))))

    Theorem: vl-expr-p-of-vl-consteval-concat

    (defthm vl-expr-p-of-vl-consteval-concat
      (b* ((ans (vl-consteval-concat x val-acc width-acc)))
        (vl-expr-p ans))
      :rule-classes :rewrite)

    Theorem: vl-expr-welltyped-p-of-vl-consteval-concat

    (defthm vl-expr-welltyped-p-of-vl-consteval-concat
      (b* ((ans (vl-consteval-concat x val-acc width-acc)))
        (vl-expr-welltyped-p ans))
      :rule-classes :rewrite)

    Theorem: vl-expr->finalwidth-of-vl-consteval-concat

    (defthm vl-expr->finalwidth-of-vl-consteval-concat
      (b* ((ans (vl-consteval-concat x val-acc width-acc)))
        (implies (and (vl-exprlist-welltyped-p x)
                      (vl-exprlist-resolved-p x)
                      (consp x))
                 (equal (vl-expr->finalwidth ans)
                        (+ (nfix width-acc)
                           (sum-nats (vl-exprlist->finalwidths x))))))
      :rule-classes :rewrite)

    Theorem: vl-expr->finaltype-of-vl-consteval-concat

    (defthm vl-expr->finaltype-of-vl-consteval-concat
      (b* ((ans (vl-consteval-concat x val-acc width-acc)))
        (equal (vl-expr->finaltype ans)
               :vl-unsigned))
      :rule-classes :rewrite)

    Theorem: vl-expr-resolved-p-of-vl-consteval-concat

    (defthm vl-expr-resolved-p-of-vl-consteval-concat
      (b* ((ans (vl-consteval-concat x val-acc width-acc)))
        (vl-expr-resolved-p ans))
      :rule-classes :rewrite)

    Theorem: vl-consteval-concat-of-vl-exprlist-fix-x

    (defthm vl-consteval-concat-of-vl-exprlist-fix-x
      (equal (vl-consteval-concat (vl-exprlist-fix x)
                                  val-acc width-acc)
             (vl-consteval-concat x val-acc width-acc)))

    Theorem: vl-consteval-concat-vl-exprlist-equiv-congruence-on-x

    (defthm vl-consteval-concat-vl-exprlist-equiv-congruence-on-x
      (implies (vl-exprlist-equiv x x-equiv)
               (equal (vl-consteval-concat x val-acc width-acc)
                      (vl-consteval-concat x-equiv val-acc width-acc)))
      :rule-classes :congruence)

    Theorem: vl-consteval-concat-of-nfix-val-acc

    (defthm vl-consteval-concat-of-nfix-val-acc
      (equal (vl-consteval-concat x (nfix val-acc)
                                  width-acc)
             (vl-consteval-concat x val-acc width-acc)))

    Theorem: vl-consteval-concat-nat-equiv-congruence-on-val-acc

    (defthm vl-consteval-concat-nat-equiv-congruence-on-val-acc
      (implies (acl2::nat-equiv val-acc val-acc-equiv)
               (equal (vl-consteval-concat x val-acc width-acc)
                      (vl-consteval-concat x val-acc-equiv width-acc)))
      :rule-classes :congruence)

    Theorem: vl-consteval-concat-of-nfix-width-acc

    (defthm vl-consteval-concat-of-nfix-width-acc
      (equal (vl-consteval-concat x val-acc (nfix width-acc))
             (vl-consteval-concat x val-acc width-acc)))

    Theorem: vl-consteval-concat-nat-equiv-congruence-on-width-acc

    (defthm vl-consteval-concat-nat-equiv-congruence-on-width-acc
      (implies (acl2::nat-equiv width-acc width-acc-equiv)
               (equal (vl-consteval-concat x val-acc width-acc)
                      (vl-consteval-concat x val-acc width-acc-equiv)))
      :rule-classes :congruence)