• 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

    Event-next

    New state resulting from an event.

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

    Based on the event, we use the appropriate function.

    Definitions and Theorems

    Function: event-next

    (defun event-next (event systate)
     (declare (xargs :guard (and (eventp event)
                                 (system-statep systate))))
     (declare (xargs :guard (event-possiblep event systate)))
     (let ((__function__ 'event-next))
      (declare (ignorable __function__))
      (event-case
           event
           :propose (propose-next event.proposal
                                  event.destinations systate)
           :endorse (endorse-next event.proposal event.endorser systate)
           :augment (augment-next event.proposal event.endorser systate)
           :certify (certify-next event.certificate
                                  event.destinations systate)
           :accept (accept-next event.validator
                                event.certificate systate)
           :advance (advance-next event.validator systate)
           :commit (commit-next event.validator systate))))

    Theorem: system-statep-of-event-next

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

    Theorem: event-next-of-event-fix-event

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

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

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

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

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

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

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