• 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-difference

    (bitset-difference x y) constructs the set X - Y.

    Signature
    (bitset-difference x y) → bitset
    Arguments
    x — Guard (natp x).
    y — Guard (natp y).
    Returns
    bitset — Type (natp bitset).

    Definitions and Theorems

    Function: bitset-difference$inline

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

    Theorem: natp-of-bitset-difference

    (defthm acl2::natp-of-bitset-difference
      (b* ((bitset (acl2::bitset-difference$inline x y)))
        (natp bitset))
      :rule-classes :type-prescription)

    Theorem: bitset-difference-when-not-natp-left

    (defthm bitset-difference-when-not-natp-left
      (implies (not (natp x))
               (equal (bitset-difference x y) 0)))

    Theorem: bitset-difference-when-not-natp-right

    (defthm bitset-difference-when-not-natp-right
      (implies (not (natp y))
               (equal (bitset-difference x y)
                      (nfix x))))

    Theorem: bitset-difference-of-nfix-left

    (defthm bitset-difference-of-nfix-left
      (equal (bitset-difference (nfix x) y)
             (bitset-difference x y)))

    Theorem: bitset-difference-of-nfix-right

    (defthm bitset-difference-of-nfix-right
      (equal (bitset-difference x (nfix y))
             (bitset-difference x y)))

    Theorem: bitset-members-of-bitset-difference

    (defthm bitset-members-of-bitset-difference
      (equal (bitset-members (bitset-difference x y))
             (difference (bitset-members x)
                         (bitset-members y))))