Collect all of the variables from all the expressions in an svex-alist.
(svex-alist-vars x) → vars
This function is based on svex-vars; it is logically nice to reason about but probably is not what you want to execute. BOZO where is the collect- version of this; recommend an alternative.
We collect the variables from all of the expressions that are bound in the svex-alist. Note that this does not collect the keys of the alist, even though they are variables. It instead collects the variables from the expressions that the keys are bound to.
Function:
(defun svex-alist-vars (x) (declare (xargs :guard (svex-alist-p x))) (let ((__function__ 'svex-alist-vars)) (declare (ignorable __function__)) (if (atom x) nil (union (and (mbt (and (consp (car x)) (svar-p (caar x)))) (svex-vars (cdar x))) (svex-alist-vars (cdr x))))))
Theorem:
(defthm return-type-of-svex-alist-vars (b* ((vars (svex-alist-vars x))) (and (svarlist-p vars) (setp vars))) :rule-classes :rewrite)
Theorem:
(defthm svex-alist-vars-of-svex-alist-fix-x (equal (svex-alist-vars (svex-alist-fix x)) (svex-alist-vars x)))
Theorem:
(defthm svex-alist-vars-svex-alist-equiv-congruence-on-x (implies (svex-alist-equiv x x-equiv) (equal (svex-alist-vars x) (svex-alist-vars x-equiv))) :rule-classes :congruence)
Theorem:
(defthm svex-vars-of-svex-alist-lookup (subsetp-equal (svex-vars (svex-lookup k x)) (svex-alist-vars x)))
Theorem:
(defthm svex-vars-of-svex-acons (equal (svex-alist-vars (svex-acons k v x)) (union (svex-vars v) (svex-alist-vars x))))
Theorem:
(defthm svex-alist-vars-of-append (set-equiv (svex-alist-vars (append a b)) (append (svex-alist-vars a) (svex-alist-vars b))))
Theorem:
(defthm vars-of-svex-alist-lookup (implies (not (member v (svex-alist-vars x))) (not (member v (svex-vars (cdr (hons-assoc-equal k (svex-alist-fix x))))))))
Theorem:
(defthm vars-of-fast-alist-fork (implies (and (not (member v (svex-alist-vars x))) (not (member v (svex-alist-vars y)))) (not (member v (svex-alist-vars (fast-alist-fork x y))))))
Theorem:
(defthm svexlist-vars-of-svex-alist-vals (equal (svexlist-vars (svex-alist-vals x)) (svex-alist-vars x)))