• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
        • Aleobft
          • Aleobft-static
            • Correctness
            • Definition
              • Transitions
              • Operations
              • States
                • Certificates
                • System-states
                  • Correct-addresses
                  • Update-validator-state
                  • Update-network-state
                  • Validators-state
                  • System-state
                  • System-state-option
                  • Get-validator-state
                  • Faulty-addresses
                  • Number-validators
                    • Number-faulty
                    • Get-network-state
                    • All-addresses
                    • Number-correct
                  • Messages
                  • Validator-states
                  • Transactions
                  • Addresses
                  • Blocks
                • Initialization
                • Events
            • Aleobft-stake2
            • Aleobft-dynamic
            • Aleobft-stake
            • Aleobft-proposals
            • Library-extensions
          • Leo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • System-states

    Number-validators

    Number of validators in the system.

    Signature
    (number-validators systate) → number
    Arguments
    systate — Guard (system-statep systate).
    Returns
    number — Type (natp number).

    This is the total number of validators in the system, often denoted n in the BFT literature.

    Definitions and Theorems

    Function: number-validators

    (defun number-validators (systate)
      (declare (xargs :guard (system-statep systate)))
      (let ((__function__ 'number-validators))
        (declare (ignorable __function__))
        (cardinality (all-addresses systate))))

    Theorem: natp-of-number-validators

    (defthm natp-of-number-validators
      (b* ((number (number-validators systate)))
        (natp number))
      :rule-classes :rewrite)

    Theorem: number-validators-alt-def

    (defthm number-validators-alt-def
      (equal (number-validators systate)
             (omap::size (system-state->validators systate))))

    Theorem: number-validator-gt-0-when-nonempty-all-addresses

    (defthm number-validator-gt-0-when-nonempty-all-addresses
      (implies (not (emptyp (all-addresses systate)))
               (> (number-validators systate) 0))
      :rule-classes :linear)

    Theorem: number-validators-of-system-state-fix-systate

    (defthm number-validators-of-system-state-fix-systate
      (equal (number-validators (system-state-fix systate))
             (number-validators systate)))

    Theorem: number-validators-system-state-equiv-congruence-on-systate

    (defthm number-validators-system-state-equiv-congruence-on-systate
      (implies (system-state-equiv systate systate-equiv)
               (equal (number-validators systate)
                      (number-validators systate-equiv)))
      :rule-classes :congruence)