Recognizer for a well-formed IRV ballot
(irv-ballot-p xs) → *
Function:
(defun irv-ballot-p (xs) (declare (xargs :guard t)) (let ((__function__ 'irv-ballot-p)) (declare (ignorable __function__)) (if (consp xs) (b* ((one (car xs)) (rest (cdr xs))) (and (nat-listp one) one (no-duplicatesp-equal one) (irv-ballot-p rest))) (equal xs nil))))
Theorem:
(defthm irv-ballot-p-implies-non-empty-true-list-listp (implies (irv-ballot-p xs) (non-empty-true-list-listp xs)) :rule-classes :forward-chaining)
Theorem:
(defthm irv-ballot-p-cdr (implies (irv-ballot-p xs) (irv-ballot-p (cdr xs))))