• 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

    Committed-anchors

    Sequence of anchors committed by a validator.

    Signature
    (committed-anchors vstate vals) → anchors
    Arguments
    vstate — Guard (validator-statep vstate).
    vals — Guard (address-setp vals).
    Returns
    anchors — Type (certificate-listp anchors).

    If the last committed round is 0 (i.e. there is no last committed round), no anchors have been committed, and we return nil. Otherwise, we obtain the last committed anchor, and we use collect-all-anchors starting from that one. Thus, this function gives us the list of all anchors committed so far, in reverse chronological order (i.e. the last one come first in the list).

    Definitions and Theorems

    Function: committed-anchors

    (defun committed-anchors (vstate vals)
     (declare (xargs :guard (and (validator-statep vstate)
                                 (address-setp vals))))
     (declare
         (xargs :guard (and (not (emptyp vals))
                            (evenp (validator-state->last vstate))
                            (or (equal (validator-state->last vstate) 0)
                                (last-anchor vstate vals)))))
     (let ((__function__ 'committed-anchors))
       (declare (ignorable __function__))
       (b* (((validator-state vstate) vstate)
            ((when (equal vstate.last 0)) nil)
            (last-anchor (last-anchor vstate vals)))
         (collect-all-anchors last-anchor vstate.dag vals))))

    Theorem: certificate-listp-of-committed-anchors

    (defthm certificate-listp-of-committed-anchors
      (b* ((anchors (committed-anchors vstate vals)))
        (certificate-listp anchors))
      :rule-classes :rewrite)

    Theorem: committed-anchors-when-last-is-0

    (defthm committed-anchors-when-last-is-0
      (implies (equal (validator-state->last vstate) 0)
               (equal (committed-anchors vstate vals)
                      nil)))

    Theorem: consp-of-committed-anchors-when-last-not-0

    (defthm consp-of-committed-anchors-when-last-not-0
      (implies (not (equal (validator-state->last vstate)
                           0))
               (consp (committed-anchors vstate vals)))
      :rule-classes :type-prescription)

    Theorem: car-of-committed-anchors

    (defthm car-of-committed-anchors
      (implies (and (not (equal (validator-state->last vstate)
                                0))
                    (last-anchor vstate vals))
               (equal (car (committed-anchors vstate vals))
                      (last-anchor vstate vals))))