• 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
          • Aleobft-stake2
            • Correctness
            • Definition
              • Initialization
              • Transitions
              • States
                • Committees
                • System-states
                • Certificates
                  • Certificate-set-unequivocalp
                  • Certificate-sets-unequivocalp
                  • Cert-with-author+round
                  • Certificate
                  • Certs-with-authors+round
                  • Certs-with-author
                  • Certs-with-round
                  • Unequivocal-certs-with-authors+round
                  • Unequivocal-cert-with-author+round
                  • Cert-set->author-set
                  • Certificate-option
                  • Cert-set->round-set
                  • Certs-with-authors
                  • Certificates-ordered-even-p
                    • Certs-with-signer
                    • Certificate->signers
                    • Certificate-set
                    • Certificate-list
                  • Messages
                  • Transactions
                  • Validator-states
                  • Blocks
                  • Addresses
                • Events
                • Reachability
            • 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
    • Certificates

    Certificates-ordered-even-p

    Check if a list of certificates has even and strictly increasing (right to left) round numbers.

    Signature
    (certificates-ordered-even-p certs) → yes/no
    Arguments
    certs — Guard (certificate-listp certs).
    Returns
    yes/no — Type (booleanp yes/no).

    This is analogous to blocks-ordered-even-p, but for certificates instead of blocks. The reason for having this predicate on certificates is that blockchains are extended from sequences of anchors, which are lists of certificates; the reason why blocks have even and strictly increasing round numbers is that the collected lists of anchors also have strictly increasing, even round numbers.

    Definitions and Theorems

    Function: certificates-ordered-even-p

    (defun certificates-ordered-even-p (certs)
      (declare (xargs :guard (certificate-listp certs)))
      (let ((__function__ 'certificates-ordered-even-p))
        (declare (ignorable __function__))
        (b* (((when (endp certs)) t)
             (cert (car certs))
             (round (certificate->round cert))
             ((unless (evenp round)) nil)
             ((when (endp (cdr certs))) t)
             ((unless (> round
                         (certificate->round (cadr certs))))
              nil))
          (certificates-ordered-even-p (cdr certs)))))

    Theorem: booleanp-of-certificates-ordered-even-p

    (defthm booleanp-of-certificates-ordered-even-p
      (b* ((yes/no (certificates-ordered-even-p certs)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: certificates-ordered-even-p-of-certificate-list-fix-certs

    (defthm certificates-ordered-even-p-of-certificate-list-fix-certs
      (equal (certificates-ordered-even-p (certificate-list-fix certs))
             (certificates-ordered-even-p certs)))

    Theorem: certificates-ordered-even-p-certificate-list-equiv-congruence-on-certs

    (defthm
     certificates-ordered-even-p-certificate-list-equiv-congruence-on-certs
     (implies (certificate-list-equiv certs certs-equiv)
              (equal (certificates-ordered-even-p certs)
                     (certificates-ordered-even-p certs-equiv)))
     :rule-classes :congruence)