Fixtype of optional strings.
The recognizer is maybe-stringp and the fixer is maybe-string-fix.
Function:
(defun maybe-string-equiv$inline (x y) (declare (xargs :guard (and (maybe-stringp x) (maybe-stringp y)))) (equal (maybe-string-fix x) (maybe-string-fix y)))
Theorem:
(defthm maybe-string-equiv-is-an-equivalence (and (booleanp (maybe-string-equiv x y)) (maybe-string-equiv x x) (implies (maybe-string-equiv x y) (maybe-string-equiv y x)) (implies (and (maybe-string-equiv x y) (maybe-string-equiv y z)) (maybe-string-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm maybe-string-equiv-implies-equal-maybe-string-fix-1 (implies (maybe-string-equiv x x-equiv) (equal (maybe-string-fix x) (maybe-string-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-string-fix-under-maybe-string-equiv (maybe-string-equiv (maybe-string-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-maybe-string-fix-1-forward-to-maybe-string-equiv (implies (equal (maybe-string-fix x) y) (maybe-string-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-maybe-string-fix-2-forward-to-maybe-string-equiv (implies (equal x (maybe-string-fix y)) (maybe-string-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-string-equiv-of-maybe-string-fix-1-forward (implies (maybe-string-equiv (maybe-string-fix x) y) (maybe-string-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-string-equiv-of-maybe-string-fix-2-forward (implies (maybe-string-equiv x (maybe-string-fix y)) (maybe-string-equiv x y)) :rule-classes :forward-chaining)