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