Fixer for uint-integer.
(uint-integer-fix x) → fixed-x
Function:
(defun uint-integer-fix (x) (declare (xargs :guard (uint-integerp x))) (mbe :logic (if (uint-integerp x) x 0) :exec x))
Theorem:
(defthm uint-integerp-of-uint-integer-fix (b* ((fixed-x (uint-integer-fix x))) (uint-integerp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm uint-integer-fix-when-uint-integerp (implies (uint-integerp x) (equal (uint-integer-fix x) x)))