• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
          • Svstmt-case
          • Svstmt-while
          • Svstmt-p
          • Svstmt-if
          • Svstmt-equiv
          • Svstmt-xcond
          • Svstmt-scope
          • Svstmt-assign
          • Svstmt-compile
            • Svstmt-compile.lisp
              • Svstate-merge-branches
              • Svex-alist-merge-branches
              • Svstmt-assign->subst
              • Svstack-merge-branches
              • Svstacks-compatible
              • Svjumpstate-merge-svstate-branches
              • Svjumpstate-svstate-compatible
              • Svstmt-lhs-check-masks
              • Svjumpstate
              • Svjumpstates-compatible
              • Svstmtlist-compile-top
              • Svjumpstate-sequence-svstates
              • Constraintlist-merge-branches
              • Svjumpstate-merge-branches
              • Svex-replace-range
              • Svex-svstmt-ite
              • Svstmt-process-write
              • Svjumpstate-sequence
              • Svstmt-process-writelist
              • Svstack-assign
              • Svstmt-writelist-var-sizes
              • Svstates-compatible
              • 4vec-replace-range
                • Svstmt-write-var-sizes
                • Make-empty-svjumpstate
                • Constraintlist-add-pathcond
                • Svjumpstate-pop-scope
                • Constraintlist-compose-svstack
                • Svstack-to-svex-alist
                • Svstack-filter-global-lhs-vars
                • Svjumpstate-vars
                • Svex-svstmt-or
                • Svex-svstmt-andc1
                • Svstate-push-scope
                • Svstate-pop-scope
                • Svstate-vars
                • Svstack-lookup
                • Svar-subtract-delay
                • Svstmt-initialize-locals
                • Svstack-fork
                • Svstack-clean
                • Svstack-nonempty-fix
                • Svstate-fork
                • Svstate-clean
                • Svstack-globalp
                • Svjumpstate-fork
                • Svar-delayed-member
                • Svjumpstate-levels
                • Svjumpstate-free
                • Svstate-free
                • Svstack-free
                • Svstack
                • Svar-size-alist
              • Svstate
            • Svstmt-constraints
            • Svstmt-jump
            • Svstmtlist
            • Svstmt-kind
            • Svstmt.lisp
            • Svstmt-fix
            • Svstmt-count
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svstmt-compile.lisp

    4vec-replace-range

    Signature
    (4vec-replace-range x &key lsb width val) → new-x
    Arguments
    x — the non-replaced part.
        Guard (4vec-p x).
    lsb — Guard (natp lsb).
    width — Guard (natp width).
    val — Guard (4vec-p val).
    Returns
    new-x — Type (4vec-p new-x).

    Definitions and Theorems

    Function: 4vec-replace-range-fn

    (defun 4vec-replace-range-fn (x lsb width val)
      (declare (xargs :guard (and (4vec-p x)
                                  (natp lsb)
                                  (natp width)
                                  (4vec-p val))))
      (let ((__function__ '4vec-replace-range))
        (declare (ignorable __function__))
        (b* ((high-part (4vec-rsh (2vec (+ (lnfix width) (lnfix lsb)))
                                  x))
             (new+high (4vec-concat (2vec (lnfix width))
                                    val high-part)))
          (4vec-concat (2vec (lnfix lsb))
                       x new+high))))

    Theorem: 4vec-p-of-4vec-replace-range

    (defthm 4vec-p-of-4vec-replace-range
      (b* ((new-x (4vec-replace-range-fn x lsb width val)))
        (4vec-p new-x))
      :rule-classes :rewrite)

    Theorem: 4vec-replace-range-fn-of-4vec-fix-x

    (defthm 4vec-replace-range-fn-of-4vec-fix-x
      (equal (4vec-replace-range-fn (4vec-fix x)
                                    lsb width val)
             (4vec-replace-range-fn x lsb width val)))

    Theorem: 4vec-replace-range-fn-4vec-equiv-congruence-on-x

    (defthm 4vec-replace-range-fn-4vec-equiv-congruence-on-x
      (implies (4vec-equiv x x-equiv)
               (equal (4vec-replace-range-fn x lsb width val)
                      (4vec-replace-range-fn x-equiv lsb width val)))
      :rule-classes :congruence)

    Theorem: 4vec-replace-range-fn-of-nfix-lsb

    (defthm 4vec-replace-range-fn-of-nfix-lsb
      (equal (4vec-replace-range-fn x (nfix lsb)
                                    width val)
             (4vec-replace-range-fn x lsb width val)))

    Theorem: 4vec-replace-range-fn-nat-equiv-congruence-on-lsb

    (defthm 4vec-replace-range-fn-nat-equiv-congruence-on-lsb
      (implies (nat-equiv lsb lsb-equiv)
               (equal (4vec-replace-range-fn x lsb width val)
                      (4vec-replace-range-fn x lsb-equiv width val)))
      :rule-classes :congruence)

    Theorem: 4vec-replace-range-fn-of-nfix-width

    (defthm 4vec-replace-range-fn-of-nfix-width
      (equal (4vec-replace-range-fn x lsb (nfix width)
                                    val)
             (4vec-replace-range-fn x lsb width val)))

    Theorem: 4vec-replace-range-fn-nat-equiv-congruence-on-width

    (defthm 4vec-replace-range-fn-nat-equiv-congruence-on-width
      (implies (nat-equiv width width-equiv)
               (equal (4vec-replace-range-fn x lsb width val)
                      (4vec-replace-range-fn x lsb width-equiv val)))
      :rule-classes :congruence)

    Theorem: 4vec-replace-range-fn-of-4vec-fix-val

    (defthm 4vec-replace-range-fn-of-4vec-fix-val
      (equal (4vec-replace-range-fn x lsb width (4vec-fix val))
             (4vec-replace-range-fn x lsb width val)))

    Theorem: 4vec-replace-range-fn-4vec-equiv-congruence-on-val

    (defthm 4vec-replace-range-fn-4vec-equiv-congruence-on-val
      (implies (4vec-equiv val val-equiv)
               (equal (4vec-replace-range-fn x lsb width val)
                      (4vec-replace-range-fn x lsb width val-equiv)))
      :rule-classes :congruence)