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