• 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
          • Aleobft-proposals
            • Correctness
            • Definition
              • Initialization
              • Transitions
                • Transitions-accept
                • Transitions-certify
                • Transitions-propose
                • Events-possiblep
                • Elections
                • Events-next
                  • Event-possiblep
                  • Event-next
                  • Transitions-commit
                  • Transitions-augment
                  • Dags
                  • Transitions-endorse
                  • Transitions-advance
                  • Blockchains
                  • Anchors
                • States
                • Events
                • Reachability
            • 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: events-next-of-event-list-fix-events

    (defthm events-next-of-event-list-fix-events
      (equal (events-next (event-list-fix events)
                          systate)
             (events-next events systate)))

    Theorem: events-next-event-list-equiv-congruence-on-events

    (defthm events-next-event-list-equiv-congruence-on-events
      (implies (event-list-equiv events events-equiv)
               (equal (events-next events systate)
                      (events-next events-equiv systate)))
      :rule-classes :congruence)

    Theorem: events-next-of-system-state-fix-systate

    (defthm events-next-of-system-state-fix-systate
      (equal (events-next events (system-state-fix systate))
             (events-next events systate)))

    Theorem: events-next-system-state-equiv-congruence-on-systate

    (defthm events-next-system-state-equiv-congruence-on-systate
      (implies (system-state-equiv systate systate-equiv)
               (equal (events-next events systate)
                      (events-next events systate-equiv)))
      :rule-classes :congruence)