Fixing function for string-option structures.
(string-option-fix x) → new-x
Function:
(defun string-option-fix$inline (x) (declare (xargs :guard (string-optionp x))) (let ((__function__ 'string-option-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((fty::val (str-fix x))) fty::val))) :exec x)))
Theorem:
(defthm string-optionp-of-string-option-fix (b* ((new-x (string-option-fix$inline x))) (string-optionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm string-option-fix-when-string-optionp (implies (string-optionp x) (equal (string-option-fix x) x)))
Function:
(defun string-option-equiv$inline (x y) (declare (xargs :guard (and (string-optionp x) (string-optionp y)))) (equal (string-option-fix x) (string-option-fix y)))
Theorem:
(defthm string-option-equiv-is-an-equivalence (and (booleanp (string-option-equiv x y)) (string-option-equiv x x) (implies (string-option-equiv x y) (string-option-equiv y x)) (implies (and (string-option-equiv x y) (string-option-equiv y z)) (string-option-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm string-option-equiv-implies-equal-string-option-fix-1 (implies (string-option-equiv x x-equiv) (equal (string-option-fix x) (string-option-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm string-option-fix-under-string-option-equiv (string-option-equiv (string-option-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-string-option-fix-1-forward-to-string-option-equiv (implies (equal (string-option-fix x) y) (string-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-string-option-fix-2-forward-to-string-option-equiv (implies (equal x (string-option-fix y)) (string-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm string-option-equiv-of-string-option-fix-1-forward (implies (string-option-equiv (string-option-fix x) y) (string-option-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm string-option-equiv-of-string-option-fix-2-forward (implies (string-option-equiv x (string-option-fix y)) (string-option-equiv x y)) :rule-classes :forward-chaining)