Equivalence (a.k.a. if and only if, xnor) for bitps.
Function:
(defun b-eqv$inline (i j) (declare (xargs :guard (and (bitp i) (bitp j)))) (let ((__function__ 'b-eqv)) (declare (ignorable __function__)) (mbe :logic (if (zbp i) (if (zbp j) 1 0) (if (zbp j) 0 1)) :exec (the (unsigned-byte 1) (logxor (the (unsigned-byte 1) (logxor (the (unsigned-byte 1) i) (the (unsigned-byte 1) j))) 1)))))
Theorem:
(defthm bitp-of-b-eqv (b* ((bit (b-eqv$inline i j))) (bitp bit)) :rule-classes :type-prescription)