• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
      • Axe
      • 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
      • 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)