• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • Riscv
        • 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-subtree->error
                    • Make-rlp-error-subtree
                    • Change-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-subtree

    Rlp-error-subtree->error

    Get the error field from a rlp-error-subtree.

    Signature
    (rlp-error-subtree->error x) → error
    Arguments
    x — Guard (rlp-error-p x).
    Returns
    error — Type (rlp-error-p error).

    This is an ordinary field accessor created by fty::defprod.

    Definitions and Theorems

    Function: rlp-error-subtree->error$inline

    (defun rlp-error-subtree->error$inline (x)
      (declare (xargs :guard (rlp-error-p x)))
      (declare (xargs :guard (equal (rlp-error-kind x) :subtree)))
      (let ((__function__ 'rlp-error-subtree->error))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((x (and (equal (rlp-error-kind x) :subtree)
                          x)))
               (rlp-error-fix (std::da-nth 0 (cdr x))))
             :exec (std::da-nth 0 (cdr x)))))

    Theorem: rlp-error-p-of-rlp-error-subtree->error

    (defthm rlp-error-p-of-rlp-error-subtree->error
      (b* ((error (rlp-error-subtree->error$inline x)))
        (rlp-error-p error))
      :rule-classes :rewrite)

    Theorem: rlp-error-subtree->error$inline-of-rlp-error-fix-x

    (defthm rlp-error-subtree->error$inline-of-rlp-error-fix-x
      (equal (rlp-error-subtree->error$inline (rlp-error-fix x))
             (rlp-error-subtree->error$inline x)))

    Theorem: rlp-error-subtree->error$inline-rlp-error-equiv-congruence-on-x

    (defthm
        rlp-error-subtree->error$inline-rlp-error-equiv-congruence-on-x
      (implies (rlp-error-equiv x x-equiv)
               (equal (rlp-error-subtree->error$inline x)
                      (rlp-error-subtree->error$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: rlp-error-subtree->error-when-wrong-kind

    (defthm rlp-error-subtree->error-when-wrong-kind
      (implies (not (equal (rlp-error-kind x) :subtree))
               (equal (rlp-error-subtree->error x)
                      (rlp-error-fix nil))))