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