• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
          • Mmp-trees
          • Semaphore
          • Database
          • Cryptography
          • Rlp
            • Rlp-tree
            • Rlp-decoding-executable
              • Rlp-error
                • Rlp-error-fix
                • Rlp-error-p
                  • Rlp-error-case
                  • Rlp-error-equiv
                  • Rlp-error-count
                  • Rlp-error-fewer-bytes-than-short-length
                  • Rlp-error-fewer-bytes-than-long-length
                  • Rlp-error-fewer-bytes-than-length-of-length
                  • Rlp-error-kind
                  • Rlp-error-subtree
                  • Rlp-error-non-optimal-short-length
                  • Rlp-error-non-optimal-long-length
                  • Rlp-error-leading-zeros-in-scalar
                  • Rlp-error-leading-zeros-in-long-length
                  • Rlp-error-extra-bytes
                  • Rlp-error-branch-tree
                  • Rlp-error-no-bytes
                • Rlp-parse-tree
                • Rlp-decodex-tree
                • Maybe-rlp-error
                • Rlp-decodex-bytes
                • Rlp-decodex-scalar
              • Rlp-decodability
              • Rlp-encoding
              • Rlp-decoding-declarative
              • Rlp-big-endian-representations
            • Transactions
            • Hex-prefix
            • Basics
            • Addresses
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Rlp-error

    Rlp-error-p

    Recognizer for rlp-error structures.

    Signature
    (rlp-error-p x) → *

    Definitions and Theorems

    Function: rlp-error-p

    (defun rlp-error-p (x)
      (declare (xargs :guard t))
      (let ((__function__ 'rlp-error-p))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :no-bytes))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x)
                        :fewer-bytes-than-short-length)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((fragment (std::da-nth 0 (cdr x)))
                              (required (std::da-nth 1 (cdr x)))
                              (available (std::da-nth 2 (cdr x))))
                           (and (byte-listp fragment)
                                (natp required)
                                (natp available)))))
                   ((eq (car x)
                        :fewer-bytes-than-length-of-length)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((fragment (std::da-nth 0 (cdr x)))
                              (required (std::da-nth 1 (cdr x)))
                              (available (std::da-nth 2 (cdr x))))
                           (and (byte-listp fragment)
                                (natp required)
                                (natp available)))))
                   ((eq (car x)
                        :fewer-bytes-than-long-length)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 3)
                         (b* ((fragment (std::da-nth 0 (cdr x)))
                              (required (std::da-nth 1 (cdr x)))
                              (available (std::da-nth 2 (cdr x))))
                           (and (byte-listp fragment)
                                (natp required)
                                (natp available)))))
                   ((eq (car x)
                        :leading-zeros-in-long-length)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((fragment (std::da-nth 0 (cdr x))))
                           (byte-listp fragment))))
                   ((eq (car x) :non-optimal-short-length)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((fragment (std::da-nth 0 (cdr x))))
                           (byte-listp fragment))))
                   ((eq (car x) :non-optimal-long-length)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((fragment (std::da-nth 0 (cdr x))))
                           (byte-listp fragment))))
                   ((eq (car x) :subtree)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((error (std::da-nth 0 (cdr x))))
                           (rlp-error-p error))))
                   ((eq (car x) :extra-bytes)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((bytes (std::da-nth 0 (cdr x))))
                           (byte-listp bytes))))
                   ((eq (car x) :branch-tree)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 1)
                         (b* ((fragment (std::da-nth 0 (cdr x))))
                           (byte-listp fragment))))
                   (t (and (eq (car x) :leading-zeros-in-scalar)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 1))
                           (b* ((bytes (std::da-nth 0 (cdr x))))
                             (byte-listp bytes))))))))

    Theorem: consp-when-rlp-error-p

    (defthm consp-when-rlp-error-p
      (implies (rlp-error-p x) (consp x))
      :rule-classes :compound-recognizer)