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