• 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-kind

    Get the kind (tag) of a rlp-error structure.

    Signature
    (rlp-error-kind x) → kind
    Arguments
    x — Guard (rlp-error-p x).

    Definitions and Theorems

    Function: rlp-error-kind$inline

    (defun rlp-error-kind$inline (x)
      (declare (xargs :guard (rlp-error-p x)))
      (let ((__function__ 'rlp-error-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x) (eq (car x) :no-bytes))
                           :no-bytes)
                          ((eq (car x)
                               :fewer-bytes-than-short-length)
                           :fewer-bytes-than-short-length)
                          ((eq (car x)
                               :fewer-bytes-than-length-of-length)
                           :fewer-bytes-than-length-of-length)
                          ((eq (car x)
                               :fewer-bytes-than-long-length)
                           :fewer-bytes-than-long-length)
                          ((eq (car x)
                               :leading-zeros-in-long-length)
                           :leading-zeros-in-long-length)
                          ((eq (car x) :non-optimal-short-length)
                           :non-optimal-short-length)
                          ((eq (car x) :non-optimal-long-length)
                           :non-optimal-long-length)
                          ((eq (car x) :subtree) :subtree)
                          ((eq (car x) :extra-bytes) :extra-bytes)
                          ((eq (car x) :branch-tree) :branch-tree)
                          (t :leading-zeros-in-scalar))
             :exec (car x))))

    Theorem: rlp-error-kind-possibilities

    (defthm rlp-error-kind-possibilities
      (or (equal (rlp-error-kind x) :no-bytes)
          (equal (rlp-error-kind x)
                 :fewer-bytes-than-short-length)
          (equal (rlp-error-kind x)
                 :fewer-bytes-than-length-of-length)
          (equal (rlp-error-kind x)
                 :fewer-bytes-than-long-length)
          (equal (rlp-error-kind x)
                 :leading-zeros-in-long-length)
          (equal (rlp-error-kind x)
                 :non-optimal-short-length)
          (equal (rlp-error-kind x)
                 :non-optimal-long-length)
          (equal (rlp-error-kind x) :subtree)
          (equal (rlp-error-kind x) :extra-bytes)
          (equal (rlp-error-kind x) :branch-tree)
          (equal (rlp-error-kind x)
                 :leading-zeros-in-scalar))
      :rule-classes
      ((:forward-chaining :trigger-terms ((rlp-error-kind x)))))