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