Remove all candidates from
(eliminate-other-candidates cids xs) → new-xs
Theorem:
(defthm nat-listp-of-set-difference-equal (implies (nat-listp x) (nat-listp (set-difference-equal x y))))
Function:
(defun eliminate-other-candidates (cids xs) (declare (xargs :guard (and (nat-listp cids) (irv-ballot-p xs)))) (let ((__function__ 'eliminate-other-candidates)) (declare (ignorable __function__)) (b* ((candidates-to-remove (remove-all cids (candidate-ids xs)))) (eliminate-candidates candidates-to-remove xs))))
Theorem:
(defthm irv-ballot-p-of-eliminate-other-candidates (implies (irv-ballot-p xs) (b* ((new-xs (eliminate-other-candidates cids xs))) (irv-ballot-p new-xs))) :rule-classes :rewrite)
Theorem:
(defthm eliminate-other-candidates-returns-a-subset-of-cids (subsetp-equal (candidate-ids (eliminate-other-candidates cids xs)) cids))
Theorem:
(defthm cids-is-a-subset-of-eliminate-other-candidates (implies (subsetp-equal cids (candidate-ids xs)) (subsetp-equal cids (candidate-ids (eliminate-other-candidates cids xs)))))
Theorem:
(defthm eliminate-other-candidates-equal-to-cids-under-set-equiv (implies (subsetp-equal cids (candidate-ids xs)) (acl2::set-equiv (candidate-ids (eliminate-other-candidates cids xs)) cids)))
Theorem:
(defthm eliminate-other-candidates-does-not-modify-xs-when-cids=candidate-ids (implies (acl2::set-equiv cids (candidate-ids xs)) (equal (eliminate-other-candidates cids xs) xs)))