• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
      • 100-theorems
      • Arithmetic
      • Bit-vectors
        • Sparseint
        • Bitops
        • Bv
        • Ihs
          • Logops-definitions
            • Logops-byte-functions
              • Wrb
                • Ihs/wrb-lemmas
              • Rdb
              • Bsp
              • Bspp
              • Wrb-field
              • Bsp-size
              • Bsp-position
              • Rdb-test
              • Rdb-field
              • Wrb-guard
              • Rdb-guard
            • Defword
            • Defbytetype
            • Logext
            • Logrev
            • Loghead
            • Logops-bit-functions
            • Logtail
            • Logapp
            • Logsat
            • Binary--
            • Logcdr
            • Logcar
            • Logbit
            • Logextu
            • Logcons
            • Lshu
            • Logrpl
            • Ashu
            • Logmaskp
            • Lognotu
            • Logmask
            • Imod
            • Ifloor
            • Bfix
            • Bitmaskp
            • Logite
            • Expt2
            • Zbp
            • *logops-functions*
            • Word/bit-macros
            • Logops-definitions-theory
            • Logops-functions
            • Lbfix
            • Logextu-guard
            • Lshu-guard
            • Logtail-guard
            • Logrpl-guard
            • Logrev-guard
            • Lognotu-guard
            • Logmask-guard
            • Loghead-guard
            • Logext-guard
            • Logbit-guard
            • Logapp-guard
            • Ashu-guard
          • Math-lemmas
          • Ihs-theories
          • Ihs-init
          • Logops
        • Rtl
      • Algebra
    • Testing-utilities
  • Logops-byte-functions

Wrb

(wrb i bsp j) writes the (bsp-size bsp) low-order bits of i into the byte of j specified by bsp.

Signature
(wrb i bsp j) → int
Arguments
i — Guard (integerp i).
bsp — Guard (bspp bsp).
j — Guard (integerp j).
Returns
int — Type (integerp int).

This is analogous to Common Lisp's (dpb newbyte bytespec integer).

Definitions and Theorems

Function: wrb

(defun wrb (i bsp j)
  (declare (xargs :guard (and (integerp i)
                              (bspp bsp)
                              (integerp j))))
  (let ((__function__ 'wrb))
    (declare (ignorable __function__))
    (logapp (bsp-position bsp)
            (loghead (bsp-position bsp) j)
            (logapp (bsp-size bsp)
                    i
                    (logtail (+ (bsp-size bsp) (bsp-position bsp))
                             j)))))

Theorem: wrb-type

(defthm wrb-type
  (b* ((int (wrb i bsp j)))
    (integerp int))
  :rule-classes :type-prescription)

Subtopics

Ihs/wrb-lemmas