• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
            • Gcc-builtins
            • Preprocessing
              • Preprocessor
                • Preprocessor-states
                • Pread-token/newline
                • Pread-token
                • Preprocessor-lexer
                • Pproc-files
                • Preprocessor-printer
                  • Pprint-lexeme
                  • Plexemes-to-bytes
                    • Pprint-lexeme-list
                  • Pproc-file
                  • Filepath-plexeme-list-alist-to-filepath-filedata-map
                  • Filepath-plexeme-list-alist
                  • Preprocessor-reader
                  • Preprocessor-messages
                • External-preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Preprocessor-printer

    Plexemes-to-bytes

    Turn a list of preprocessor lexemes into a list of bytes.

    Signature
    (plexemes-to-bytes lexemes) → bytes
    Arguments
    lexemes — Guard (plexeme-listp lexemes).
    Returns
    bytes — Type (byte-listp bytes).

    This is the top-level function of our printer. The reversed list of bytes is initialized to empty, and we call the top-level printing function, reversing the final byte list.

    Definitions and Theorems

    Function: plexemes-to-bytes

    (defun plexemes-to-bytes (lexemes)
      (declare (xargs :guard (plexeme-listp lexemes)))
      (rev (pprint-lexeme-list lexemes nil)))

    Theorem: byte-listp-of-plexemes-to-bytes

    (defthm byte-listp-of-plexemes-to-bytes
      (b* ((bytes (plexemes-to-bytes lexemes)))
        (byte-listp bytes))
      :rule-classes :rewrite)