Fixing function for backref structures.
Function:
(defun backref-fix$inline (x) (declare (xargs :guard (backref-p x))) (let ((__function__ 'backref-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((loc (nfix (std::prod-car x))) (len (nfix (std::prod-cdr x)))) (std::prod-hons loc len)) :exec x)))
Theorem:
(defthm backref-p-of-backref-fix (b* ((new-x (backref-fix$inline x))) (backref-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm backref-fix-when-backref-p (implies (backref-p x) (equal (backref-fix x) x)))
Function:
(defun backref-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (backref-p acl2::x) (backref-p acl2::y)))) (equal (backref-fix acl2::x) (backref-fix acl2::y)))
Theorem:
(defthm backref-equiv-is-an-equivalence (and (booleanp (backref-equiv x y)) (backref-equiv x x) (implies (backref-equiv x y) (backref-equiv y x)) (implies (and (backref-equiv x y) (backref-equiv y z)) (backref-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm backref-equiv-implies-equal-backref-fix-1 (implies (backref-equiv acl2::x x-equiv) (equal (backref-fix acl2::x) (backref-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm backref-fix-under-backref-equiv (backref-equiv (backref-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-backref-fix-1-forward-to-backref-equiv (implies (equal (backref-fix acl2::x) acl2::y) (backref-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-backref-fix-2-forward-to-backref-equiv (implies (equal acl2::x (backref-fix acl2::y)) (backref-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm backref-equiv-of-backref-fix-1-forward (implies (backref-equiv (backref-fix acl2::x) acl2::y) (backref-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm backref-equiv-of-backref-fix-2-forward (implies (backref-equiv acl2::x (backref-fix acl2::y)) (backref-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)