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