Check if a mathematical integer is
in the range of (i.e. representable in) type
Function:
(defun schar-rangep (val) (declare (xargs :guard (integerp val))) (let ((__function__ 'schar-rangep)) (declare (ignorable __function__)) (and (<= (schar-min) (ifix val)) (<= (ifix val) (schar-max)))))
Theorem:
(defthm booleanp-of-schar-rangep (b* ((yes/no (schar-rangep val))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm schar-rangep-of-ifix-val (equal (schar-rangep (ifix val)) (schar-rangep val)))
Theorem:
(defthm schar-rangep-int-equiv-congruence-on-val (implies (acl2::int-equiv val val-equiv) (equal (schar-rangep val) (schar-rangep val-equiv))) :rule-classes :congruence)