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