Fixer for bin-digit.
(bin-digit-fix x) → fixed-x
Function:
(defun bin-digit-fix (x) (declare (xargs :guard (bin-digitp x))) (mbe :logic (if (bin-digitp x) x (char-code #\0)) :exec x))
Theorem:
(defthm bin-digitp-of-bin-digit-fix (b* ((fixed-x (bin-digit-fix x))) (bin-digitp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm bin-digit-fix-when-bin-digitp (implies (bin-digitp x) (equal (bin-digit-fix x) x)))