• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
      • Apt
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Prime-field-constraint-systems
      • Proof-checker-array
      • Soft
      • Rp-rewriter
      • Farray
      • Instant-runoff-voting
        • Fairness-criteria
          • Eliminate-candidates
          • Sum-nats
          • Eliminate-other-candidates
          • Clone-p
          • Last-place
          • All-head-to-head-competition-loser-p
            • Head-to-head-competition-loser-p
          • Non-maj-ind-hint
          • Find-condorcet-loser
          • Last-place-elim-ind-hint
        • Candidate-with-least-nth-place-votes
        • Eliminate-candidate
        • First-choice-of-majority-p
        • Candidate-ids
        • Irv
        • Create-nth-choice-count-alist
        • Irv-alt
        • Irv-ballot-p
        • Majority
        • Number-of-candidates
        • List-elements-equal
        • Number-of-voters
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Bigmem
      • Regex
      • ACL2-programming-language
      • Java
      • C
      • Jfkr
      • X86isa
      • Equational
      • Cryptography
      • Where-do-i-place-my-book
      • Json
      • Built-ins
      • Execloader
      • Solidity
      • Paco
      • Concurrent-programs
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
  • Fairness-criteria

All-head-to-head-competition-loser-p

Check if l will lose in a head-to-head competition against every candidate in cids

Signature
(all-head-to-head-competition-loser-p l cids xs) → *
Arguments
l — Possible loser.
    Guard (natp l).
cids — All candidates in xs, except l.
    Guard (nat-listp cids).
xs — Guard (irv-ballot-p xs).

Definitions and Theorems

Function: all-head-to-head-competition-loser-p

(defun
 all-head-to-head-competition-loser-p
 (l cids xs)
 (declare (xargs :guard (and (natp l)
                             (nat-listp cids)
                             (irv-ballot-p xs))))
 (declare
      (xargs :guard (and (member-equal l (candidate-ids xs))
                         (not (member-equal l cids))
                         (subsetp-equal cids (candidate-ids xs)))))
 (let ((__function__ 'all-head-to-head-competition-loser-p))
      (declare (ignorable __function__))
      (if (endp cids)
          t
          (if (member-equal l cids)
              nil
              (if (head-to-head-competition-loser-p l (car cids)
                                                    xs)
                  (all-head-to-head-competition-loser-p l (cdr cids)
                                                        xs)
                  nil)))))

Subtopics

Head-to-head-competition-loser-p
Check if l will lose in a head-to-head competition against c