Fixer for maybe-stringp.
(maybe-string-fix x) → fixed-x
Function:
(defun maybe-string-fix (x) (declare (xargs :guard (maybe-stringp x))) (mbe :logic (if (maybe-stringp x) x nil) :exec x))
Theorem:
(defthm maybe-stringp-of-maybe-string-fix (b* ((fixed-x (maybe-string-fix x))) (maybe-stringp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm maybe-string-fix-when-maybe-stringp (implies (maybe-stringp x) (equal (maybe-string-fix x) x)))