• 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
        • 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
        • 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
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)))))