Check that all the variables in a list are unique.
(var-list-unique-vars vars allvars) → new-allvars
This lifts var-unique-vars to lists.
This is very similar to add-vars, but it has a different purpose.
Function:
(defun var-list-unique-vars (vars allvars) (declare (xargs :guard (and (identifier-listp vars) (identifier-setp allvars)))) (let ((__function__ 'var-list-unique-vars)) (declare (ignorable __function__)) (b* (((when (endp vars)) (identifier-set-fix allvars)) ((okf allvars) (var-unique-vars (car vars) allvars))) (var-list-unique-vars (cdr vars) allvars))))
Theorem:
(defthm identifier-set-resultp-of-var-list-unique-vars (b* ((new-allvars (var-list-unique-vars vars allvars))) (identifier-set-resultp new-allvars)) :rule-classes :rewrite)
Theorem:
(defthm var-list-unique-vars-to-set-list-insert (b* ((allvars1 (var-list-unique-vars vars allvars))) (implies (not (reserrp allvars1)) (equal allvars1 (set::list-insert (identifier-list-fix vars) (identifier-set-fix allvars))))))
Theorem:
(defthm var-list-unique-vars-of-identifier-list-fix-vars (equal (var-list-unique-vars (identifier-list-fix vars) allvars) (var-list-unique-vars vars allvars)))
Theorem:
(defthm var-list-unique-vars-identifier-list-equiv-congruence-on-vars (implies (identifier-list-equiv vars vars-equiv) (equal (var-list-unique-vars vars allvars) (var-list-unique-vars vars-equiv allvars))) :rule-classes :congruence)
Theorem:
(defthm var-list-unique-vars-of-identifier-set-fix-allvars (equal (var-list-unique-vars vars (identifier-set-fix allvars)) (var-list-unique-vars vars allvars)))
Theorem:
(defthm var-list-unique-vars-identifier-set-equiv-congruence-on-allvars (implies (identifier-set-equiv allvars allvars-equiv) (equal (var-list-unique-vars vars allvars) (var-list-unique-vars vars allvars-equiv))) :rule-classes :congruence)