• 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
          • Aleobft-stake
            • Correctness
            • Definition
              • Initialization
              • Transitions
                • Transitions-create
                • Dags
                • Transitions-receive
                • Transitions-store
                • Transitions-advance
                • Elections
                • Event-next
                • Transitions-commit
                • Event-possiblep
                • Events-possiblep
                • Events-next
                  • Blockchains
                  • Transitions-timeout
                  • Anchors
                • States
                • Events
            • 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
    • Transitions

    Events-next

    New state resulting from a sequence of events.

    Signature
    (events-next events systate) → new-systate
    Arguments
    events — Guard (event-listp events).
    systate — Guard (system-statep systate).
    Returns
    new-systate — Type (system-statep new-systate).

    The sequence of events must be possible, as expressed by events-possiblep in the guard. If the sequence is empty, we return the input state. Otherwise, we execute the events from left to right.

    Definitions and Theorems

    Function: events-next

    (defun events-next (events systate)
      (declare (xargs :guard (and (event-listp events)
                                  (system-statep systate))))
      (declare (xargs :guard (events-possiblep events systate)))
      (let ((__function__ 'events-next))
        (declare (ignorable __function__))
        (b* (((when (endp events))
              (system-state-fix systate))
             (systate (event-next (car events) systate)))
          (events-next (cdr events) systate))))

    Theorem: system-statep-of-events-next

    (defthm system-statep-of-events-next
      (b* ((new-systate (events-next events systate)))
        (system-statep new-systate))
      :rule-classes :rewrite)

    Theorem: correct-addresses-of-events-next

    (defthm correct-addresses-of-events-next
      (implies (events-possiblep events systate)
               (b* ((?new-systate (events-next events systate)))
                 (equal (correct-addresses new-systate)
                        (correct-addresses systate)))))