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