• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • 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

    Get-bit

    Read the nth element of the bitarr array.

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

    Function: bits$ai

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