• 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
              • States
              • Events
                • Event
                  • Event-fix
                  • Event-case
                  • Eventp
                    • Event-equiv
                    • Event-propose
                    • Event-certify
                    • Event-endorse
                    • Event-augment
                    • Event-accept
                    • Event-commit
                    • Event-advance
                    • Event-kind
                  • Messages
                  • Event-list
                • 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
    • Event

    Eventp

    Recognizer for event structures.

    Signature
    (eventp x) → *

    Definitions and Theorems

    Function: eventp

    (defun eventp (x)
      (declare (xargs :guard t))
      (let ((__function__ 'eventp))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :propose))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((proposal (std::da-nth 0 (cdr x)))
                              (destinations (std::da-nth 1 (cdr x))))
                           (and (proposalp proposal)
                                (address-setp destinations)))))
                   ((eq (car x) :endorse)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((proposal (std::da-nth 0 (cdr x)))
                              (endorser (std::da-nth 1 (cdr x))))
                           (and (proposalp proposal)
                                (addressp endorser)))))
                   ((eq (car x) :augment)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((proposal (std::da-nth 0 (cdr x)))
                              (endorser (std::da-nth 1 (cdr x))))
                           (and (proposalp proposal)
                                (addressp endorser)))))
                   ((eq (car x) :certify)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((certificate (std::da-nth 0 (cdr x)))
                              (destinations (std::da-nth 1 (cdr x))))
                           (and (certificatep certificate)
                                (address-setp destinations)))))
                   ((eq (car x) :accept)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((validator (std::da-nth 0 (cdr x)))
                              (certificate (std::da-nth 1 (cdr x))))
                           (and (addressp validator)
                                (certificatep certificate)))))
                   ((eq (car x) :advance)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((validator (std::da-nth 0 (cdr x))))
                           (addressp validator))))
                   (t (and (eq (car x) :commit)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 1))
                           (b* ((validator (std::da-nth 0 (cdr x))))
                             (addressp validator))))))))

    Theorem: consp-when-eventp

    (defthm consp-when-eventp
      (implies (eventp x) (consp x))
      :rule-classes :compound-recognizer)