• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Aleobft
        • Aleobft-static
        • Aleobft-stake2
        • Aleobft-dynamic
        • Aleobft-stake
          • Correctness
          • Definition
            • Initialization
            • Transitions
            • States
              • Committees
              • System-states
              • Certificates
              • Messages
              • Validator-states
              • Transactions
                • Transaction
                  • Transaction-fix
                  • Transaction-case
                  • Transaction-equiv
                  • Transactionp
                    • Transaction-bond
                    • Transaction-unbond
                    • Transaction-other
                    • Transaction-kind
                  • Transaction-list
                • Blocks
                • Addresses
              • Events
          • Aleobft-proposals
          • Library-extensions
        • 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
        • Solidity
        • Leo
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Transaction

    Transactionp

    Recognizer for transaction structures.

    Signature
    (transactionp x) → *

    Definitions and Theorems

    Function: transactionp

    (defun transactionp (x)
      (declare (xargs :guard t))
      (let ((__function__ 'transactionp))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :bond))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 2)
                         (b* ((validator (std::da-nth 0 (cdr x)))
                              (stake (std::da-nth 1 (cdr x))))
                           (and (addressp validator)
                                (posp stake)))))
                   ((eq (car x) :unbond)
                    (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) :other)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 1))
                           (b* ((unwrap (std::da-nth 0 (cdr x))))
                             (any-p unwrap))))))))

    Theorem: consp-when-transactionp

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