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