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