• 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
              • Invariant-unequivocal-certificates
              • Invariant-same-certificates
              • Invariant-committed-redundant
              • Invariant-signers-have-author-round
              • Property-paths-to-voted-anchor
              • Properties-dags
              • Invariant-no-self-endorsed
              • Properties-certificate-retrieval
              • Invariant-last-anchor-voters
              • Invariant-blockchain-redundant
              • Invariant-previous-are-quorum
              • Invariant-no-self-buffer
              • Invariant-anchors-not-forking
              • Invariant-signers-are-validators
              • Invariant-previous-in-dag
              • Invariant-last-before-current
              • Invariant-last-anchor-present
              • Properties-anchors-extension
              • Invariant-unequivocal-dag
              • Property-paths-to-other-voted-anchor
              • Invariant-no-self-messages
              • Invariant-paths-to-other-last-anchor
              • Invariant-addresses
              • Invariant-last-is-even
              • Invariant-signers-are-quorum
              • Invariant-messages-to-correct
              • Properties-blockchain
              • Invariant-paths-to-last-anchor
              • Invariant-unequivocal-dags
              • Invariant-blockchain-not-forking
              • Operations-additional
                • Operations-certificates-for-validators
                • Operations-dags-additional
                • Operations-anchors
                  • Last-anchor
                    • Committed-anchors
                    • Collect-all-anchors
                    • Anchorp
                  • Operations-unequivocal-certificates
                  • Operations-fault-tolerance
                  • Operations-blockchain-additional
                • Invariant-quorum
                • Invariant-dag-previous-are-quorum
                • Properties-anchors
                • Property-committed-anchors-of-next-event
                • Invariant-max-faulty
                • Property-last-anchor-of-next-event
                • Invariant-certificate-retrieval
                • Invariant-fault-tolerance
                • Invariant-dag-authors-are-validators
                • Invariant-causal-histories
              • Definition
            • 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
    • Operations-anchors

    Last-anchor

    Last committed anchor in a validator state.

    Signature
    (last-anchor vstate vals) → anchor?
    Arguments
    vstate — Guard (validator-statep vstate).
    vals — Guard (address-setp vals).
    Returns
    anchor? — Type (certificate-optionp anchor?).

    A validator state includes a component with the latest committed round number (or 0 if no rounds have been committed yet). We return the certificate at that round authored by the leader of that round, if such a certificate is in the DAG; if the certificate is absent, we return nil. If no round has been committed yet, we also return nil.

    Definitions and Theorems

    Function: last-anchor

    (defun last-anchor (vstate vals)
      (declare (xargs :guard (and (validator-statep vstate)
                                  (address-setp vals))))
      (declare
           (xargs :guard (and (not (emptyp vals))
                              (evenp (validator-state->last vstate)))))
      (let ((__function__ 'last-anchor))
        (declare (ignorable __function__))
        (b* (((validator-state vstate) vstate)
             ((when (equal vstate.last 0)) nil)
             (leader (leader-at-round vstate.last vals)))
          (cert-with-author+round leader vstate.last vstate.dag))))

    Theorem: certificate-optionp-of-last-anchor

    (defthm certificate-optionp-of-last-anchor
      (b* ((anchor? (last-anchor vstate vals)))
        (certificate-optionp anchor?))
      :rule-classes :rewrite)

    Theorem: certificate->author-of-last-anchor

    (defthm certificate->author-of-last-anchor
      (implies (last-anchor vstate vals)
               (equal (certificate->author (last-anchor vstate vals))
                      (leader-at-round (validator-state->last vstate)
                                       vals))))

    Theorem: certificate->round-of-last-anchor

    (defthm certificate->round-of-last-anchor
      (implies (last-anchor vstate vals)
               (equal (certificate->round (last-anchor vstate vals))
                      (validator-state->last vstate))))

    Theorem: last-anchor-in-dag

    (defthm last-anchor-in-dag
      (implies (last-anchor vstate vals)
               (in (last-anchor vstate vals)
                   (validator-state->dag vstate))))