• 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
                • Transitions-receive-certificate
                • Transitions-create-certificate
                • Dags
                • Transitions-advance-round
                • Events-next
                • Events-possiblep
                • Event-next
                • Elections
                • Transitions-commit-anchors
                • Transitions-store-certificate
                • Event-possiblep
                  • Anchors
                  • Blockchains
                  • Transitions-timer-expires
                • States
                • 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
    • Transitions

    Event-possiblep

    Check if an event is possible.

    Signature
    (event-possiblep event systate) → yes/no
    Arguments
    event — Guard (eventp event).
    systate — Guard (system-statep systate).
    Returns
    yes/no — Type (booleanp yes/no).

    Based on the event, we use the appropriate predicate.

    Definitions and Theorems

    Function: event-possiblep

    (defun event-possiblep (event systate)
     (declare (xargs :guard (and (eventp event)
                                 (system-statep systate))))
     (let ((__function__ 'event-possiblep))
      (declare (ignorable __function__))
      (event-case
        event
        :create-certificate
        (create-certificate-possiblep event.certificate systate)
        :receive-certificate
        (receive-certificate-possiblep event.message systate)
        :store-certificate
        (store-certificate-possiblep event.validator
                                     event.certificate systate)
        :advance-round (advance-round-possiblep event.validator systate)
        :commit-anchors
        (commit-anchors-possiblep event.validator systate)
        :timer-expires
        (timer-expires-possiblep event.validator systate))))

    Theorem: booleanp-of-event-possiblep

    (defthm booleanp-of-event-possiblep
      (b* ((yes/no (event-possiblep event systate)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: event-possiblep-of-event-fix-event

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

    Theorem: event-possiblep-event-equiv-congruence-on-event

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

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

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

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

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