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