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