Rewrites the alist, but only if do-rewrite is non-nil.
(svex-alist-maybe-rewrite-fixpoint x do-rewrite &key (count '4) (verbosep 'nil)) → xx
Function:
(defun svex-alist-maybe-rewrite-fixpoint-fn (x do-rewrite count verbosep) (declare (xargs :guard (and (svex-alist-p x) (natp count)))) (let ((__function__ 'svex-alist-maybe-rewrite-fixpoint)) (declare (ignorable __function__)) (if do-rewrite (svex-alist-rewrite-fixpoint x :count count :verbosep verbosep) (svex-alist-fix x))))
Theorem:
(defthm svex-alist-p-of-svex-alist-maybe-rewrite-fixpoint (b* ((xx (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep))) (svex-alist-p xx)) :rule-classes :rewrite)
Theorem:
(defthm svex-alist-maybe-rewrite-fixpoint-fn-of-svex-alist-fix-x (equal (svex-alist-maybe-rewrite-fixpoint-fn (svex-alist-fix x) do-rewrite count verbosep) (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep)))
Theorem:
(defthm svex-alist-maybe-rewrite-fixpoint-fn-svex-alist-equiv-congruence-on-x (implies (svex-alist-equiv x x-equiv) (equal (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep) (svex-alist-maybe-rewrite-fixpoint-fn x-equiv do-rewrite count verbosep))) :rule-classes :congruence)
Theorem:
(defthm svex-alist-maybe-rewrite-fixpoint-fn-of-nfix-count (equal (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite (nfix count) verbosep) (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep)))
Theorem:
(defthm svex-alist-maybe-rewrite-fixpoint-fn-nat-equiv-congruence-on-count (implies (nat-equiv count count-equiv) (equal (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep) (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count-equiv verbosep))) :rule-classes :congruence)
Theorem:
(defthm svex-alist-maybe-rewrite-fixpoint-correct (b* ((?xx (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep))) (equal (svex-alist-eval xx env) (svex-alist-eval x env))))
Theorem:
(defthm len-of-svex-alist-maybe-rewrite-fixpoint (b* ((?xx (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep))) (equal (len xx) (len (svex-alist-fix x)))))
Theorem:
(defthm vars-of-svex-alist-maybe-rewrite-fixpoint (b* ((?xx (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep))) (implies (not (member v (svex-alist-vars x))) (not (member v (svex-alist-vars xx))))))
Theorem:
(defthm keys-of-svex-alist-maybe-rewrite-fixpoint (b* ((?xx (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep))) (iff (svex-lookup v xx) (svex-lookup v x))))
Theorem:
(defthm svex-alist-keys-of-svex-alist-maybe-rewrite-fixpoint (b* ((?xx (svex-alist-maybe-rewrite-fixpoint-fn x do-rewrite count verbosep))) (equal (svex-alist-keys xx) (svex-alist-keys x))))