Sparse version.
Don't use this directly; use 4v-nsexpr-vars instead.
Function:
(defun 4v-nsexpr-vars-sparse (x) (declare (xargs :guard (4v-nsexpr-p x))) (if (atom x) (if x (sbitset-singleton x) nil) (4v-sexpr-vars-list-mask-sparse (cdr x))))
Function:
(defun 4v-sexpr-vars-list-mask-sparse (x) (declare (xargs :guard (4v-nsexpr-list-p x))) (if (atom x) nil (sbitset-union (4v-nsexpr-vars-sparse (car x)) (4v-sexpr-vars-list-mask-sparse (cdr x)))))
Theorem:
(defthm sbitsetp-of-4v-nsexpr-vars-sparse (sbitsetp (4v-nsexpr-vars-sparse x)))
Theorem:
(defthm bitset-members-4v-sexpr-vars-list-mask-sparse (sbitsetp (4v-sexpr-vars-list-mask-sparse x)))
Function:
(defun 4v-nsexpr-vars-sparse-memoize-condition (x) (declare (ignorable x) (xargs :guard (4v-nsexpr-p x))) (and (consp x) (consp (cdr x))))
Theorem:
(defthm sbitset-members-4v-nsexpr-vars-sparse (implies (4v-nsexpr-p x) (equal (sbitset-members (4v-nsexpr-vars-sparse x)) (4v-sexpr-vars x))))
Theorem:
(defthm sbitset-members-4v-sexpr-vars-list-mask-sparse (implies (4v-nsexpr-list-p x) (equal (sbitset-members (4v-sexpr-vars-list-mask-sparse x)) (4v-sexpr-vars-list x))))