• 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
          • Aleobft-stake2
          • Aleobft-dynamic
            • Correctness
            • Definition
              • Initialization
              • Transitions
              • States
                • Committees
                • System-states
                • Certificates
                • Messages
                • Validator-states
                  • Validator-state
                    • Validator-state-fix
                    • Validator-statep
                    • Make-validator-state
                      • Validator-state-equiv
                      • Validator-state->committed
                      • Change-validator-state
                      • Validator-state->endorsed
                      • Validator-state->buffer
                      • Validator-state->blockchain
                      • Validator-state->timer
                      • Validator-state->round
                      • Validator-state->last
                      • Validator-state->dag
                    • Get-address+pos-pairs-with-address
                    • Validator-state-option
                    • Timer
                    • Address+pos
                    • Address+pos-set
                  • Transactions
                  • Blocks
                  • Addresses
                • Events
            • 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
    • Validator-state

    Make-validator-state

    Basic constructor macro for validator-state structures.

    Syntax
    (make-validator-state [:round <round>] 
                          [:dag <dag>] 
                          [:buffer <buffer>] 
                          [:endorsed <endorsed>] 
                          [:last <last>] 
                          [:blockchain <blockchain>] 
                          [:committed <committed>] 
                          [:timer <timer>]) 
    

    This is the usual way to construct validator-state structures. It simply conses together a structure with the specified fields.

    This macro generates a new validator-state structure from scratch. See also change-validator-state, which can "change" an existing structure, instead.

    Definition

    This is an ordinary make- macro introduced by fty::defprod.

    Macro: make-validator-state

    (defmacro make-validator-state (&rest args)
      (std::make-aggregate 'validator-state
                           args
                           '((:round)
                             (:dag)
                             (:buffer)
                             (:endorsed)
                             (:last)
                             (:blockchain)
                             (:committed)
                             (:timer))
                           'make-validator-state
                           nil))

    Function: validator-state

    (defun validator-state (round dag buffer endorsed
                                  last blockchain committed timer)
      (declare (xargs :guard (and (posp round)
                                  (certificate-setp dag)
                                  (certificate-setp buffer)
                                  (address+pos-setp endorsed)
                                  (natp last)
                                  (block-listp blockchain)
                                  (certificate-setp committed)
                                  (timerp timer))))
      (declare (xargs :guard t))
      (let ((__function__ 'validator-state))
        (declare (ignorable __function__))
        (b* ((round (mbe :logic (pos-fix round)
                         :exec round))
             (dag (mbe :logic (certificate-set-fix dag)
                       :exec dag))
             (buffer (mbe :logic (certificate-set-fix buffer)
                          :exec buffer))
             (endorsed (mbe :logic (address+pos-set-fix endorsed)
                            :exec endorsed))
             (last (mbe :logic (nfix last) :exec last))
             (blockchain (mbe :logic (block-list-fix blockchain)
                              :exec blockchain))
             (committed (mbe :logic (certificate-set-fix committed)
                             :exec committed))
             (timer (mbe :logic (timer-fix timer)
                         :exec timer)))
          (list (cons 'round round)
                (cons 'dag dag)
                (cons 'buffer buffer)
                (cons 'endorsed endorsed)
                (cons 'last last)
                (cons 'blockchain blockchain)
                (cons 'committed committed)
                (cons 'timer timer)))))