• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
        • Mmp-trees
        • Semaphore
        • Database
        • Cryptography
        • Rlp
          • Rlp-tree
          • Rlp-decoding-executable
          • Rlp-decodability
            • Rlp-encode-trees-injectivity-proof
            • Rlp-encode-bytes-injectivity-proof
            • Rlp-encode-bytes-prefix-unambiguity-proof
            • Rlp-encode-tree-prefix-unambiguity-proof
              • Rlp-encode-scalar-injectivity-proof
              • Rlp-encode-scalar-prefix-unambiguity-proof
            • Rlp-encoding
            • Rlp-decoding-declarative
            • Rlp-big-endian-representations
          • Transactions
          • Hex-prefix
          • Basics
          • Addresses
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Rlp-decodability

    Rlp-encode-tree-prefix-unambiguity-proof

    Property that no valid RLP tree encoding is a strict prefix of another one.

    This is quite analogous to the proof for byte array encoding.

    We cannot, and do not need to, prove a similar property for encodings of lists of trees, because a list of encoded trees could be extended with another one. However, when we decode a list of trees, we know the total length of their super-tree, because at the top level we always start by decoding a tree, never a list of trees.

    Definitions and Theorems

    Theorem: rlp-encode-tree-umamb-prefix

    (defthm rlp-encode-tree-umamb-prefix
      (implies (and (not (mv-nth 0 (rlp-encode-tree x)))
                    (not (mv-nth 0 (rlp-encode-tree y))))
               (equal (prefixp (mv-nth 1 (rlp-encode-tree x))
                               (mv-nth 1 (rlp-encode-tree y)))
                      (equal (mv-nth 1 (rlp-encode-tree x))
                             (mv-nth 1 (rlp-encode-tree y))))))