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