(sparseint$-unary-bittest-offset op offset x) → test
Function:
(defun sparseint$-unary-bittest-offset (op offset x) (declare (type (unsigned-byte 2) op)) (declare (xargs :guard (and (integerp op) (natp offset) (sparseint$-p x)))) (let ((__function__ 'sparseint$-unary-bittest-offset)) (declare (ignorable __function__)) (b* ((op (mbe :logic (loghead 2 op) :exec op))) (case op (0 nil) (1 (not (sparseint$-equal-int offset x -1))) (2 (not (sparseint$-equal-int offset x 0))) (t t)))))
Theorem:
(defthm booleanp-of-sparseint$-unary-bittest-offset (b* ((test (sparseint$-unary-bittest-offset op offset x))) (booleanp test)) :rule-classes :type-prescription)
Theorem:
(defthm sparseint$-unary-bittest-offset-correct (b* ((?test (sparseint$-unary-bittest-offset op offset x))) (equal test (not (equal (unary-bitop op (logtail offset (sparseint$-val x))) 0)))))
Theorem:
(defthm sparseint$-unary-bittest-offset-of-ifix-op (equal (sparseint$-unary-bittest-offset (ifix op) offset x) (sparseint$-unary-bittest-offset op offset x)))
Theorem:
(defthm sparseint$-unary-bittest-offset-int-equiv-congruence-on-op (implies (int-equiv op op-equiv) (equal (sparseint$-unary-bittest-offset op offset x) (sparseint$-unary-bittest-offset op-equiv offset x))) :rule-classes :congruence)
Theorem:
(defthm sparseint$-unary-bittest-offset-of-nfix-offset (equal (sparseint$-unary-bittest-offset op (nfix offset) x) (sparseint$-unary-bittest-offset op offset x)))
Theorem:
(defthm sparseint$-unary-bittest-offset-nat-equiv-congruence-on-offset (implies (nat-equiv offset offset-equiv) (equal (sparseint$-unary-bittest-offset op offset x) (sparseint$-unary-bittest-offset op offset-equiv x))) :rule-classes :congruence)
Theorem:
(defthm sparseint$-unary-bittest-offset-of-sparseint$-fix-x (equal (sparseint$-unary-bittest-offset op offset (sparseint$-fix x)) (sparseint$-unary-bittest-offset op offset x)))
Theorem:
(defthm sparseint$-unary-bittest-offset-sparseint$-equiv-congruence-on-x (implies (sparseint$-equiv x x-equiv) (equal (sparseint$-unary-bittest-offset op offset x) (sparseint$-unary-bittest-offset op offset x-equiv))) :rule-classes :congruence)