(backref-alist-fix x) is an ACL2::fty alist fixing function that follows the drop-keys strategy.
(backref-alist-fix x) → fty::newx
Note that in the execution this is just an inline identity function.
Function:
(defun backref-alist-fix$inline (x) (declare (xargs :guard (backref-alist-p x))) (let ((__function__ 'backref-alist-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (if (consp (car x)) (cons (cons (caar x) (backref-fix (cdar x))) (backref-alist-fix (cdr x))) (backref-alist-fix (cdr x)))) :exec x)))
Theorem:
(defthm backref-alist-p-of-backref-alist-fix (b* ((fty::newx (backref-alist-fix$inline x))) (backref-alist-p fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm backref-alist-fix-when-backref-alist-p (implies (backref-alist-p x) (equal (backref-alist-fix x) x)))
Function:
(defun backref-alist-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (backref-alist-p acl2::x) (backref-alist-p acl2::y)))) (equal (backref-alist-fix acl2::x) (backref-alist-fix acl2::y)))
Theorem:
(defthm backref-alist-equiv-is-an-equivalence (and (booleanp (backref-alist-equiv x y)) (backref-alist-equiv x x) (implies (backref-alist-equiv x y) (backref-alist-equiv y x)) (implies (and (backref-alist-equiv x y) (backref-alist-equiv y z)) (backref-alist-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm backref-alist-equiv-implies-equal-backref-alist-fix-1 (implies (backref-alist-equiv acl2::x x-equiv) (equal (backref-alist-fix acl2::x) (backref-alist-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm backref-alist-fix-under-backref-alist-equiv (backref-alist-equiv (backref-alist-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-backref-alist-fix-1-forward-to-backref-alist-equiv (implies (equal (backref-alist-fix acl2::x) acl2::y) (backref-alist-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-backref-alist-fix-2-forward-to-backref-alist-equiv (implies (equal acl2::x (backref-alist-fix acl2::y)) (backref-alist-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm backref-alist-equiv-of-backref-alist-fix-1-forward (implies (backref-alist-equiv (backref-alist-fix acl2::x) acl2::y) (backref-alist-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm backref-alist-equiv-of-backref-alist-fix-2-forward (implies (backref-alist-equiv acl2::x (backref-alist-fix acl2::y)) (backref-alist-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm cons-of-backref-fix-v-under-backref-alist-equiv (backref-alist-equiv (cons (cons acl2::k (backref-fix acl2::v)) acl2::x) (cons (cons acl2::k acl2::v) acl2::x)))
Theorem:
(defthm cons-backref-equiv-congruence-on-v-under-backref-alist-equiv (implies (backref-equiv acl2::v v-equiv) (backref-alist-equiv (cons (cons acl2::k acl2::v) acl2::x) (cons (cons acl2::k v-equiv) acl2::x))) :rule-classes :congruence)
Theorem:
(defthm cons-of-backref-alist-fix-y-under-backref-alist-equiv (backref-alist-equiv (cons acl2::x (backref-alist-fix acl2::y)) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-backref-alist-equiv-congruence-on-y-under-backref-alist-equiv (implies (backref-alist-equiv acl2::y y-equiv) (backref-alist-equiv (cons acl2::x acl2::y) (cons acl2::x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm backref-alist-fix-of-acons (equal (backref-alist-fix (cons (cons acl2::a acl2::b) x)) (cons (cons acl2::a (backref-fix acl2::b)) (backref-alist-fix x))))
Theorem:
(defthm hons-assoc-equal-of-backref-alist-fix (equal (hons-assoc-equal acl2::k (backref-alist-fix acl2::x)) (let ((fty::pair (hons-assoc-equal acl2::k acl2::x))) (and fty::pair (cons acl2::k (backref-fix (cdr fty::pair)))))))
Theorem:
(defthm backref-alist-fix-of-append (equal (backref-alist-fix (append std::a std::b)) (append (backref-alist-fix std::a) (backref-alist-fix std::b))))
Theorem:
(defthm consp-car-of-backref-alist-fix (equal (consp (car (backref-alist-fix x))) (consp (backref-alist-fix x))))