• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
          • Dynamic-instrumentation
          • Initialize-x86-state
          • Binary-file-load-fn
          • Read-channel-into-memory
          • Setting-up-page-tables
          • Read-channel-into-byte-list
          • Init-zero-page
          • Linux-load
          • Read-file-into-memory
          • Read-file-into-byte-list
          • Init-sys-view
          • Load-elf-sections
          • Chars-to-c-str
            • String-to-c-str
            • Pack-u64
            • Pack-u32
            • Concrete-simulation-examples
            • Gdt-entry
          • Sdm-instruction-set-summary
          • Tlb
          • Running-linux
          • Introduction
          • Asmtest
          • X86isa-build-instructions
          • Publications
          • Contributors
          • Machine
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Program-execution

    Chars-to-c-str

    Signature
    (chars-to-c-str char-lst) → c-str
    Arguments
    char-lst — Guard (character-listp char-lst).
    Returns
    c-str — Type (byte-listp c-str).

    Definitions and Theorems

    Function: chars-to-c-str

    (defun chars-to-c-str (char-lst)
      (declare (xargs :guard (character-listp char-lst)))
      (let ((__function__ 'chars-to-c-str))
        (declare (ignorable __function__))
        (if (mbt (character-listp char-lst))
            (if (not char-lst)
                '(0)
              (cons (char-code (car char-lst))
                    (chars-to-c-str (cdr char-lst))))
          nil)))

    Theorem: byte-listp-of-chars-to-c-str

    (defthm byte-listp-of-chars-to-c-str
      (b* ((c-str (chars-to-c-str char-lst)))
        (byte-listp c-str))
      :rule-classes :rewrite)