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