• 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
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • 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
              • Transitions-accept
              • Transitions-create
              • Dags
                • Path-to-author+round
                • Successors
                • Certificate-causal-history
                • Dag-in-committees-p
                • Paths-in-unequivocal-closed-dags
                • Predecessors
                • Unequivocal-previous-certificates
                • Certificate-previous-in-dag-p
                  • Certificates-dag-paths-p
                  • Causal-histories-in-unequivocal-closed-dags
                  • Dag-predecessor-quorum-p
                  • Path-to-previous
                  • Dag-has-committees-p
                  • Path-to-author+round-set-to-path-to-author+round
                  • Dag-closedp
                  • Path-to-author+round-transitive
                  • Path-to-author+round-to-cert-with-author+round
                  • In-of-certificate-causal-history
                  • Path-to-predecessor
                  • Path-from-successor
                  • Certificate-causal-history-subset-when-path
                  • Path-to-head-of-predecessors
                  • Dag-no-prodecessors-round-1-p
                • Events-possiblep
                • Elections
                • Events-next
                • Event-next
                • Transitions-commit
                • Event-possiblep
                • Transitions-advance
                • Blockchains
                • Anchors
              • States
              • 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
    • Dags

    Certificate-previous-in-dag-p

    Check if all the previous certificates referenced by a given certificate are in a given DAG.

    Signature
    (certificate-previous-in-dag-p cert dag) → yes/no
    Arguments
    cert — Guard (certificatep cert).
    dag — Guard (certificate-setp dag).
    Returns
    yes/no — Type (booleanp yes/no).

    The check succeeds immediately if the certificate's round number is 1. In that case, it is an invariant (proved elsewhere) that certificates in round 1 reference no previous certificates; therefore, the requirement is trivially satisfied.

    For the more common case in which the certificate's round number is not 1, we retrieve all the certificates from the DAG at the previous round, we obtain their set of authors, and we check that those are a superset of the set of previous certificate authors referenced by the certificate.

    For a given certificate, this predicate is preserved by extending the DAG, because extending the DAG cannot remove any referenced predecessor certificates. We prove this in certificate-previous-in-dag-p-when-subset.

    Definitions and Theorems

    Function: certificate-previous-in-dag-p

    (defun certificate-previous-in-dag-p (cert dag)
     (declare (xargs :guard (and (certificatep cert)
                                 (certificate-setp dag))))
     (let ((__function__ 'certificate-previous-in-dag-p))
      (declare (ignorable __function__))
      (b* (((certificate cert) cert))
       (or (= (certificate->round cert) 1)
           (subset (certificate->previous cert)
                   (cert-set->author-set
                        (certs-with-round (1- (certificate->round cert))
                                          dag)))))))

    Theorem: booleanp-of-certificate-previous-in-dag-p

    (defthm booleanp-of-certificate-previous-in-dag-p
      (b* ((yes/no (certificate-previous-in-dag-p cert dag)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: certificate-previous-in-dag-p-when-subset

    (defthm certificate-previous-in-dag-p-when-subset
      (implies (and (certificate-setp dag)
                    (certificate-setp dag1)
                    (subset dag dag1)
                    (certificate-previous-in-dag-p cert dag))
               (certificate-previous-in-dag-p cert dag1)))