• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Riscv
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • 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
      • Aleo
        • Aleobft
          • Correctness
          • Definition
            • Initialization
            • Transitions
            • States
              • Committees
              • System-states
              • Certificates
                • Certificate-set-unequivocalp
                • Certificate-sets-unequivocalp
                • Cert-with-author+round
                • Certs-with-authors+round
                • Certs-with-author
                • Certs-with-round
                • Unequivocal-certs-with-authors+round
                • Unequivocal-cert-with-author+round
                • Certificate
                • Cert-set->author-set
                • Certificate-option
                • Cert-set->round-set
                • Certs-with-authors
                • Certificate-list-orderedp
                • Certs-with-signer
                  • Certificate->signers
                  • Certificate-list-evenp
                  • Certificate->transactions
                  • Certificate->previous
                  • Certificate->author
                  • Certificate->round
                  • Certificate-set
                  • Certificate-list
                • Messages
                • Transactions
                • Proposals
                • Validator-states
                • Blocks
                • Addresses
              • Events
              • Reachability
            • Library-extensions
          • Aleovm
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Certificates

    Certs-with-signer

    Retrieve, from a set of certificates, the subset of certificates whose signers include a given address.

    Signature
    (certs-with-signer signer certs) → certs-with-signer
    Arguments
    signer — Guard (addressp signer).
    certs — Guard (certificate-setp certs).
    Returns
    certs-with-signer — Type (certificate-setp certs-with-signer).

    Definitions and Theorems

    Function: certs-with-signer

    (defun certs-with-signer (signer certs)
      (declare (xargs :guard (and (addressp signer)
                                  (certificate-setp certs))))
      (let ((__function__ 'certs-with-signer))
        (declare (ignorable __function__))
        (b* (((when (emptyp certs)) nil)
             (cert (head certs)))
          (if (in (address-fix signer)
                  (certificate->signers cert))
              (insert (certificate-fix cert)
                      (certs-with-signer signer (tail certs)))
            (certs-with-signer signer (tail certs))))))

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

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

    Theorem: certs-with-signer-of-address-fix-signer

    (defthm certs-with-signer-of-address-fix-signer
      (equal (certs-with-signer (address-fix signer)
                                certs)
             (certs-with-signer signer certs)))

    Theorem: certs-with-signer-address-equiv-congruence-on-signer

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

    Theorem: in-of-certs-with-signer

    (defthm in-of-certs-with-signer
      (implies (certificate-setp certs)
               (equal (in cert (certs-with-signer signer certs))
                      (and (in cert certs)
                           (in (address-fix signer)
                               (certificate->signers cert))))))

    Theorem: certs-with-signer-of-nil

    (defthm certs-with-signer-of-nil
      (equal (certs-with-signer signer nil)
             nil))

    Theorem: certs-with-signer-of-insert

    (defthm certs-with-signer-of-insert
      (implies (and (certificatep cert)
                    (certificate-setp certs))
               (equal (certs-with-signer signer (insert cert certs))
                      (if (in (address-fix signer)
                              (certificate->signers cert))
                          (insert cert (certs-with-signer signer certs))
                        (certs-with-signer signer certs)))))