• 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
      • 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
            • Unequivocal-dags-def-and-init
            • Same-committees-def-and-implied
            • Dag-omni-paths
            • Signer-records
            • Unequivocal-dags-next
            • Quorum-intersection
            • Dag-previous-quorum-def-and-init-and-next
            • Unequivocal-signed-certificates
            • Signed-previous-quorum
            • Nonforking-anchors-def-and-init-and-next
            • Successor-predecessor-intersection
            • Fault-tolerance
            • Last-anchor-voters-def-and-init-and-next
            • Signer-quorum
            • Committed-redundant-def-and-init-and-next
            • Nonforking-blockchains-def-and-init
            • Blockchain-redundant-def-and-init-and-next
            • No-self-endorsed
            • Last-anchor-present
            • Anchors-extension
            • Nonforking-blockchains-next
            • Backward-closure
            • Last-blockchain-round
            • Dag-certificate-next
            • Omni-paths-def-and-implied
            • Ordered-blockchain
            • Simultaneous-induction
            • System-certificates
            • Last-anchor-def-and-init
            • Last-anchor-next
            • Dag-previous-quorum
            • Signed-certificates
            • Committed-anchor-sequences
              • Committed-anchors-of-next
              • Committed-anchors
                • Committed-anchors-of-commit-next-to-collect-all-anchors
                • Committed-anchors-when-init
              • Omni-paths
              • Last-anchor-voters
              • Unequivocal-dags
              • Nonforking-blockchains
              • Nonforking-anchors
              • Committed-redundant
              • Same-committees
              • Blockchain-redundant
            • Definition
            • 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
    • Committed-anchor-sequences

    Committed-anchors

    Sequence of anchors committed by a validator.

    Signature
    (committed-anchors vstate) → anchors
    Arguments
    vstate — Guard (validator-statep vstate).
    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 latest one is the car of the list).

    Definitions and Theorems

    Function: committed-anchors

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

    Theorem: certificate-listp-of-committed-anchors

    (defthm certificate-listp-of-committed-anchors
      (b* ((anchors (committed-anchors vstate)))
        (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) 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)))
      :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))
               (equal (car (committed-anchors vstate))
                      (last-anchor vstate))))

    Theorem: certificate-list-evenp-of-committed-anchors

    (defthm certificate-list-evenp-of-committed-anchors
      (implies (and (evenp (validator-state->last vstate))
                    (or (equal (validator-state->last vstate) 0)
                        (last-anchor vstate)))
               (b* ((?anchors (committed-anchors vstate)))
                 (certificate-list-evenp anchors))))

    Theorem: certificate-list-orderedp-of-committed-anchors

    (defthm certificate-list-orderedp-of-committed-anchors
      (implies (and (evenp (validator-state->last vstate))
                    (or (equal (validator-state->last vstate) 0)
                        (last-anchor vstate)))
               (b* ((?anchors (committed-anchors vstate)))
                 (certificate-list-orderedp anchors))))

    Theorem: certificates-dag-paths-p-of-committed-anchors

    (defthm certificates-dag-paths-p-of-committed-anchors
      (implies
           (or (equal (validator-state->last vstate) 0)
               (in (last-anchor vstate)
                   (validator-state->dag vstate)))
           (b* ((?anchors (committed-anchors vstate)))
             (certificates-dag-paths-p anchors
                                       (validator-state->dag vstate)))))

    Theorem: committed-anchors-of-validator-state-fix-vstate

    (defthm committed-anchors-of-validator-state-fix-vstate
      (equal (committed-anchors (validator-state-fix vstate))
             (committed-anchors vstate)))

    Theorem: committed-anchors-validator-state-equiv-congruence-on-vstate

    (defthm committed-anchors-validator-state-equiv-congruence-on-vstate
      (implies (validator-state-equiv vstate vstate-equiv)
               (equal (committed-anchors vstate)
                      (committed-anchors vstate-equiv)))
      :rule-classes :congruence)