• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
      • Std/system
      • Std/typed-lists
      • Std/bitsets
        • Bitsets
          • Bitset-members
          • Bitset-insert
          • Bitset-delete
          • Bitset-intersectp
          • Bitset-intersect
          • Bitset-difference
          • Bitset-subsetp
          • Bitset-union
          • Bitset-memberp
          • Bitset-singleton
          • Bitset-list
          • Bitset-cardinality
          • Bitset-list*
          • Utilities
            • Bits-between
            • Bits-0-31
            • 60bits-0-59
            • Add-to-each
            • Bits-0-7
            • 60bits-0-7
            • 60bits-0-3
          • Sbitsets
          • Reasoning
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Utilities

    60bits-0-3

    Like bits-0-7, but since 8 doesn't divide 60, we have this goofy function for the final bits.

    Signature
    (60bits-0-3 offset x acc) → *

    Definitions and Theorems

    Function: 60bits-0-3

    (defun 60bits-0-3 (offset x acc)
      (declare (type unsigned-byte offset)
               (type (unsigned-byte 60) x))
      (let ((__function__ '60bits-0-3))
        (declare (ignorable __function__))
        (b* ((acc (if (logbitp 3 x)
                      (cons (+ 3 offset) acc)
                    acc))
             (acc (if (logbitp 2 x)
                      (cons (+ 2 offset) acc)
                    acc))
             (acc (if (logbitp 1 x)
                      (cons (+ 1 offset) acc)
                    acc))
             (acc (if (logbitp 0 x)
                      (cons offset acc)
                    acc)))
          acc)))

    Theorem: 60bits-0-3-redef

    (defthm 60bits-0-3-redef
      (implies (force (natp offset))
               (equal (60bits-0-3 offset x acc)
                      (append (add-to-each offset (bits-between 0 4 x))
                              acc))))