(bitset-intersectp x y) efficiently determines if
This is efficient because, unlike bitset-intersect, we don't actually construct the intersection.
Function:
(defun acl2::bitset-intersectp$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-intersectp)) (declare (ignorable __function__)) (logtest (the unsigned-byte (lnfix x)) (the unsigned-byte (lnfix y)))))
Theorem:
(defthm acl2::booleanp-of-bitset-intersectp (b* ((intersectp (acl2::bitset-intersectp$inline x y))) (booleanp intersectp)) :rule-classes :type-prescription)
Theorem:
(defthm bitset-intersectp-when-not-natp-left (implies (not (natp x)) (equal (bitset-intersectp x y) nil)))
Theorem:
(defthm bitset-intersectp-when-not-natp-right (implies (not (natp y)) (equal (bitset-intersectp x y) nil)))
Theorem:
(defthm bitset-intersectp-of-nfix-left (equal (bitset-intersectp (nfix x) y) (bitset-intersectp x y)))
Theorem:
(defthm bitset-intersectp-of-nfix-right (equal (bitset-intersectp x (nfix y)) (bitset-intersectp x y)))
Theorem:
(defthm bitset-intersectp-removal (implies (bitset-intersectp x y) (intersect (bitset-members x) (bitset-members y))))