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