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