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

    (bitset-subsetp x y) efficiently determines if X is a subset of Y.

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

    Definitions and Theorems

    Function: bitset-subsetp$inline

    (defun acl2::bitset-subsetp$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-subsetp))
        (declare (ignorable __function__))
        (eql 0
             (the unsigned-byte
                  (bitset-difference x y)))))

    Theorem: booleanp-of-bitset-subsetp

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

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

    (defthm bitset-subsetp-when-not-natp-left
      (implies (not (natp x))
               (equal (bitset-subsetp x y) t)))

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

    (defthm bitset-subsetp-when-not-natp-right
      (implies (not (natp y))
               (equal (bitset-subsetp x y) (zp x))))

    Theorem: bitset-subsetp-of-nfix-left

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

    Theorem: bitset-subsetp-of-nfix-right

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

    Theorem: bitset-subsetp-removal

    (defthm bitset-subsetp-removal
      (equal (bitset-subsetp x y)
             (subset (bitset-members x)
                     (bitset-members y))))