Recognizer for byte.
(bytep x) → yes/no
Function:
(defun bytep (x) (declare (xargs :guard t)) (mbe :logic (unsigned-byte-p (char-bit) x) :exec (and (integerp x) (<= 0 x) (< x (expt 2 (char-bit))))))
Theorem:
(defthm booleanp-of-bytep (b* ((yes/no (bytep x))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm bytep-forward-unsigned-byte-p (implies (bytep x) (unsigned-byte-p (char-bit) x)) :rule-classes :forward-chaining)
Theorem:
(defthm unsigned-byte-p-rewrite-bytep (equal (unsigned-byte-p (char-bit) x) (bytep x)))
Theorem:
(defthm natp-when-bytep (implies (bytep x) (natp x)) :rule-classes :compound-recognizer)