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