• 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-dynamic
          • Aleobft-arxiv
            • 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-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

    Certs-with-authors

    Retrieve, from a set of certificates, the subset of certificates with author in a given set.

    Signature
    (certs-with-authors authors certs) → certs-with-authors
    Arguments
    authors — Guard (address-setp authors).
    certs — Guard (certificate-setp certs).
    Returns
    certs-with-authors — Type (certificate-setp certs-with-authors).

    Definitions and Theorems

    Function: certs-with-authors

    (defun certs-with-authors (authors certs)
      (declare (xargs :guard (and (address-setp authors)
                                  (certificate-setp certs))))
      (let ((__function__ 'certs-with-authors))
        (declare (ignorable __function__))
        (b* (((when (emptyp certs)) nil)
             ((certificate cert) (head certs)))
          (if (in cert.author (address-set-fix authors))
              (insert (certificate-fix cert)
                      (certs-with-authors authors (tail certs)))
            (certs-with-authors authors (tail certs))))))

    Theorem: certificate-setp-of-certs-with-authors

    (defthm certificate-setp-of-certs-with-authors
      (b* ((certs-with-authors (certs-with-authors authors certs)))
        (certificate-setp certs-with-authors))
      :rule-classes :rewrite)

    Theorem: certs-with-authors-of-address-set-fix-authors

    (defthm certs-with-authors-of-address-set-fix-authors
      (equal (certs-with-authors (address-set-fix authors)
                                 certs)
             (certs-with-authors authors certs)))

    Theorem: certs-with-authors-address-set-equiv-congruence-on-authors

    (defthm certs-with-authors-address-set-equiv-congruence-on-authors
      (implies (address-set-equiv authors authors-equiv)
               (equal (certs-with-authors authors certs)
                      (certs-with-authors authors-equiv certs)))
      :rule-classes :congruence)

    Theorem: certs-with-authors-subset

    (defthm certs-with-authors-subset
     (implies
          (certificate-setp certs)
          (b* ((?certs-with-authors (certs-with-authors authors certs)))
            (subset certs-with-authors certs))))

    Theorem: certs-with-authors-of-nil

    (defthm certs-with-authors-of-nil
      (equal (certs-with-author authors nil)
             nil))

    Theorem: in-of-certs-with-authors

    (defthm in-of-certs-with-authors
      (implies (certificate-setp certs)
               (equal (in cert (certs-with-authors authors certs))
                      (and (in cert certs)
                           (in (certificate->author cert)
                               (address-set-fix authors))))))

    Theorem: cert-set->author-set-of-certs-with-authors

    (defthm cert-set->author-set-of-certs-with-authors
     (implies
        (certificate-setp certs)
        (equal (cert-set->author-set (certs-with-authors authors certs))
               (intersect (address-set-fix authors)
                          (cert-set->author-set certs)))))