• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/io
      • Std/osets
      • Std/system
      • Std/basic
      • Std/typed-lists
      • Std/bitsets
      • Std/testing
      • Std/typed-alists
      • Std/stobjs
        • Stobj-updater-independence
        • Def-1d-arr
        • Defstobj-clone
        • Def-2d-arr
        • Defabsstobj-events
        • Bitarr
          • Bits-equiv
          • Set-bit
            • Resize-bits
            • Get-bit
            • Bits-length
          • Natarr
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Bitarr

    Set-bit

    Modify the nth element of the bitarr array.

    In the execution this is an array write, but the logical definition is just a thin wrapper for update-nth:

    Function: update-bits$ai

    (defun
      update-bits$ai
      (stobjs::i stobjs::v bitarr$a)
      (declare (xargs :guard (and (bitarr$ap bitarr$a)
                                  (integerp stobjs::i)
                                  (<= 0 stobjs::i)
                                  (< stobjs::i (bits$a-length bitarr$a))
                                  (bitp stobjs::v)
                                  (stobjs::typep$ stobjs::v bit))))
      (ec-call (update-nth stobjs::i (bfix stobjs::v)
                           bitarr$a)))