• 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
          • Sbitsets
          • Reasoning
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bitsets

    Bitset-memberp

    (bitset-memberp a x) tests whether a is a member of the set X.

    Signature
    (bitset-memberp a x) → bool
    Arguments
    a — Guard (natp a).
    x — Guard (natp x).
    Returns
    bool — Type (booleanp bool).

    This is reasonably efficient: it executes as logbitp and does not need to use bitset-members.

    We prefer to reason about (set::in a (bitset-members X)). We could have used this as the :logic definition, but the logbitp-based definition should be better for symbolic simulation with ACL2::gl.

    Definitions and Theorems

    Function: bitset-memberp$inline

    (defun acl2::bitset-memberp$inline (a x)
      (declare (type unsigned-byte a)
               (type unsigned-byte x))
      (declare (xargs :guard (and (natp a) (natp x))))
      (declare (xargs :split-types t))
      (let ((__function__ 'bitset-memberp))
        (declare (ignorable __function__))
        (logbitp a (the unsigned-byte (lnfix x)))))

    Theorem: booleanp-of-bitset-memberp

    (defthm acl2::booleanp-of-bitset-memberp
      (b* ((bool (acl2::bitset-memberp$inline a x)))
        (booleanp bool))
      :rule-classes :type-prescription)

    Theorem: bitset-memberp-removal

    (defthm bitset-memberp-removal
      (equal (bitset-memberp a x)
             (in (nfix a) (bitset-members x))))