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