• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
          • Defstobj
          • Defabsstobj
          • Stobj-table
          • Preservation-thms
          • Nested-stobjs
          • Defrstobj
          • With-global-stobj
          • User-stobjs-modified-warnings
          • Stobj-example-1
          • Defrstobj
          • Stobj-example-3
          • Stobj-example-1-proofs
          • With-local-stobj
          • Stobj-example-1-defuns
          • Declare-stobjs
          • Trans-eval-and-stobjs
          • With-local-state
          • Stobj-example-2
          • Stobj-example-1-implementation
          • Add-global-stobj
          • Swap-stobjs
          • Resize-list
          • Nth-aliases-table
          • Def-stobj-frame
          • Trans-eval-and-locally-bound-stobjs
          • 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
            • Count-keys
            • Update-nth-array
            • Remove-global-stobj
          • State
          • Mutual-recursion
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defmacro
          • Loop$-primer
          • Fast-alists
          • Defconst
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Efficiency
          • Irrelevant-formals
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • 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)))