Right shift of a value of type
Function:
(defun shr-uint (x y) (declare (xargs :guard (and (uintp x) (integerp y) (shr-uint-okp x y)))) (uint-from-integer-mod (truncate (integer-from-uint x) (expt 2 (ifix y)))))
Theorem:
(defthm uintp-of-shr-uint (uintp (shr-uint x y)))
Theorem:
(defthm shr-uint-of-uint-fix-x (equal (shr-uint (uint-fix x) y) (shr-uint x y)))
Theorem:
(defthm shr-uint-uint-equiv-congruence-on-x (implies (uint-equiv x x-equiv) (equal (shr-uint x y) (shr-uint x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm shr-uint-of-ifix-y (equal (shr-uint x (ifix y)) (shr-uint x y)))
Theorem:
(defthm shr-uint-int-equiv-congruence-on-y (implies (acl2::int-equiv y y-equiv) (equal (shr-uint x y) (shr-uint x y-equiv))) :rule-classes :congruence)