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