• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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-tree-case
              • Rlp-tree-equiv
              • Rlp-treep
              • Rlp-tree-leaf
                • Rlp-tree-leaf->bytes
                  • Make-rlp-tree-leaf
                  • Change-rlp-tree-leaf
                • Rlp-tree-branch
                • Rlp-tree-kind
                • Rlp-tree-list
                • Rlp-tree-fix
                • Rlp-tree-count
              • Rlp-decoding-executable
              • 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-tree-leaf

    Rlp-tree-leaf->bytes

    Get the bytes field from a rlp-tree-leaf.

    Signature
    (rlp-tree-leaf->bytes x) → bytes
    Arguments
    x — Guard (rlp-treep x).
    Returns
    bytes — Type (byte-listp bytes).

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

    Definitions and Theorems

    Function: rlp-tree-leaf->bytes$inline

    (defun rlp-tree-leaf->bytes$inline (x)
      (declare (xargs :guard (rlp-treep x)))
      (declare (xargs :guard (equal (rlp-tree-kind x) :leaf)))
      (let ((__function__ 'rlp-tree-leaf->bytes))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((x (and (equal (rlp-tree-kind x) :leaf)
                          x)))
               (byte-list-fix (std::da-nth 0 (cdr x))))
             :exec (std::da-nth 0 (cdr x)))))

    Theorem: byte-listp-of-rlp-tree-leaf->bytes

    (defthm byte-listp-of-rlp-tree-leaf->bytes
      (b* ((bytes (rlp-tree-leaf->bytes$inline x)))
        (byte-listp bytes))
      :rule-classes :rewrite)

    Theorem: rlp-tree-leaf->bytes$inline-of-rlp-tree-fix-x

    (defthm rlp-tree-leaf->bytes$inline-of-rlp-tree-fix-x
      (equal (rlp-tree-leaf->bytes$inline (rlp-tree-fix x))
             (rlp-tree-leaf->bytes$inline x)))

    Theorem: rlp-tree-leaf->bytes$inline-rlp-tree-equiv-congruence-on-x

    (defthm rlp-tree-leaf->bytes$inline-rlp-tree-equiv-congruence-on-x
      (implies (rlp-tree-equiv x x-equiv)
               (equal (rlp-tree-leaf->bytes$inline x)
                      (rlp-tree-leaf->bytes$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: rlp-tree-leaf->bytes-when-wrong-kind

    (defthm rlp-tree-leaf->bytes-when-wrong-kind
      (implies (not (equal (rlp-tree-kind x) :leaf))
               (equal (rlp-tree-leaf->bytes x)
                      (byte-list-fix nil))))