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