Like alist-keys but with proper fty-discipline for svex-alists.
(svex-alist-keys x) → keys
Function:
(defun svex-alist-keys (x) (declare (xargs :guard (svex-alist-p x))) (let ((__function__ 'svex-alist-keys)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (if (mbt (and (consp (car x)) (svar-p (caar x)))) (cons (caar x) (svex-alist-keys (cdr x))) (svex-alist-keys (cdr x)))) :exec (strip-cars x))))
Theorem:
(defthm svarlist-p-of-svex-alist-keys (b* ((keys (svex-alist-keys x))) (svarlist-p keys)) :rule-classes :rewrite)
Theorem:
(defthm svex-alist-keys-of-svex-alist-fix-x (equal (svex-alist-keys (svex-alist-fix x)) (svex-alist-keys x)))
Theorem:
(defthm svex-alist-keys-svex-alist-equiv-congruence-on-x (implies (svex-alist-equiv x x-equiv) (equal (svex-alist-keys x) (svex-alist-keys x-equiv))) :rule-classes :congruence)
Theorem:
(defthm member-svex-alist-keys (iff (member k (svex-alist-keys x)) (and (svar-p k) (svex-lookup k x))))
Theorem:
(defthm svex-alist-keys-of-svex-acons (equal (svex-alist-keys (svex-acons k v x)) (cons (svar-fix k) (svex-alist-keys x))))
Theorem:
(defthm svex-alist-keys-of-pairlis$ (equal (svex-alist-keys (pairlis$ x y)) (svarlist-filter x)))