• 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
          • Mmp-encode-n/c
          • Mmp-encode-c-max
          • Mmp-encode
          • Mmp-write
          • Mmp-decode
          • Mmp-encode-u-map
          • Nibblelist-bytelist-map-sup-len-key
          • Mmp-encode-c-forall
          • Mmp-read
          • Mmp-encoding-p
          • Bytelist-to-nibblelist-keys
            • Bytelist-to-nibblelist-keys-aux
            • Mmp-encode-c-exists
            • Bytelist-bytelist-map
            • Nibblelist-bytelist-map
          • Semaphore
          • Database
          • Cryptography
          • Rlp
          • 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
    • Bytelist-to-nibblelist-keys

    Bytelist-to-nibblelist-keys-aux

    Turn a sequence of bytes into a sequence of nibbles.

    Signature
    (bytelist-to-nibblelist-keys-aux bytes) → nibbles
    Arguments
    bytes — Guard (byte-listp bytes).
    Returns
    nibbles — Type (nibble-listp nibbles).

    This corresponds to [YP:(191)], but here the conversion is expressed via recursion instead of indexing.

    Definitions and Theorems

    Function: bytelist-to-nibblelist-keys-aux

    (defun bytelist-to-nibblelist-keys-aux (bytes)
      (declare (xargs :guard (byte-listp bytes)))
      (b* (((when (endp bytes)) nil)
           (byte (byte-fix (car bytes)))
           (nibble-hi (floor byte 16))
           (nibble-lo (mod byte 16))
           (nibbles (bytelist-to-nibblelist-keys-aux (cdr bytes))))
        (list* nibble-hi nibble-lo nibbles)))

    Theorem: nibble-listp-of-bytelist-to-nibblelist-keys-aux

    (defthm nibble-listp-of-bytelist-to-nibblelist-keys-aux
      (b* ((nibbles (bytelist-to-nibblelist-keys-aux bytes)))
        (nibble-listp nibbles))
      :rule-classes :rewrite)

    Theorem: bytelist-to-nibblelist-keys-aux-of-byte-list-fix-bytes

    (defthm bytelist-to-nibblelist-keys-aux-of-byte-list-fix-bytes
      (equal (bytelist-to-nibblelist-keys-aux (byte-list-fix bytes))
             (bytelist-to-nibblelist-keys-aux bytes)))

    Theorem: bytelist-to-nibblelist-keys-aux-byte-list-equiv-congruence-on-bytes

    (defthm
     bytelist-to-nibblelist-keys-aux-byte-list-equiv-congruence-on-bytes
     (implies (byte-list-equiv bytes bytes-equiv)
              (equal (bytelist-to-nibblelist-keys-aux bytes)
                     (bytelist-to-nibblelist-keys-aux bytes-equiv)))
     :rule-classes :congruence)