• 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
      • 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
        • Elf-reader
        • Mach-o-reader
        • Merge-first-split-bytes
        • Split-bytes
        • Take-till-zero
        • Charlist->bytes
        • Merge-bytes
        • Bytes->charlist
        • String->bytes
          • Bytes->string
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Execloader

    String->bytes

    Convert a string to a list of bytes.

    Signature
    (string->bytes str) → bl
    Arguments
    str — Guard (stringp str).
    Returns
    bl — Type (byte-listp bl), given the guard.

    Definitions and Theorems

    Function: string->bytes

    (defun string->bytes (str)
      (declare (xargs :guard (stringp str)))
      (let ((__function__ 'string->bytes))
        (declare (ignorable __function__))
        (charlist->bytes (coerce str 'list))))

    Theorem: byte-listp-of-string->bytes

    (defthm byte-listp-of-string->bytes
      (implies (and (stringp str))
               (b* ((bl (string->bytes str)))
                 (byte-listp bl)))
      :rule-classes :rewrite)