Reduce modularly ACL2 integers to values of type
Function:
(defun uchar-from-integer-mod (x) (declare (xargs :guard (integerp x))) (let ((__function__ 'uchar-from-integer-mod)) (declare (ignorable __function__)) (uchar-from-integer (mod (ifix x) (1+ (uchar-max))))))
Theorem:
(defthm ucharp-of-uchar-from-integer-mod (b* ((result (uchar-from-integer-mod x))) (ucharp result)) :rule-classes :rewrite)
Theorem:
(defthm uchar-from-integer-mod-of-ifix-x (equal (uchar-from-integer-mod (ifix x)) (uchar-from-integer-mod x)))
Theorem:
(defthm uchar-from-integer-mod-int-equiv-congruence-on-x (implies (acl2::int-equiv x x-equiv) (equal (uchar-from-integer-mod x) (uchar-from-integer-mod x-equiv))) :rule-classes :congruence)