• 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
              • Print-exprs/decls/stmts
              • Print-expr
              • Pristate
              • Print-dec/oct/hex-const
              • Priopt
              • Print-fundef
              • Print-filepath-transunit-map
                • Print-s-char
                • Print-c-char
                • Print-q-char
                • Print-h-char
                • Print-fileset
                • Print-typequal/attribspec-list-list
                • Print-file
                • Print-hex-core-fconst
                • Print-dec-core-fconst
                • Print-ident-list
                • Print-fsuffix
                • Print-oct-digit-achar
                • Print-label-declaration-list
                • Print-hex-frac-const
                • Print-hex-digit-achar
                • Print-dec-frac-const
                • Print-dec-digit-achar
                • Print-asm-clobber-list
                • Print-stringlit-list
                • Print-inc/dec-op-list
                • Print-astring
                • Print-asm-name-spec
                • Print-univ-char-name
                • Print-struni-spec
                • Print-simple-escape
                • Print-label-declaration
                • Print-isuffix-option
                • Print-fsuffix-option
                • Print-extdecl-list
                • Print-eprefix-option
                • Print-dec-expo-option
                • Print-cprefix-option
                • Print-binop
                • Print-attrib-name
                • Print-type-qual
                • Print-s-char-list
                • Print-q-char-list
                • Print-indent
                • Print-ident
                • Print-h-char-list
                • Print-dec-expo-prefix
                • Print-char
                • Print-c-char-list
                • Print-bin-expo-prefix
                • Print-asm-qual-list
                • Print-stringlit
                • Print-stor-spec
                • Print-sign-option
                • Print-oct-escape
                • Print-header-name
                • Print-extdecl
                • Print-escape
                • Print-cconst
                • Print-asm-qual
                • Print-asm-clobber
                • Init-pristate
                • Dec-pristate-indent
                • Print-isuffix
                • Print-fun-spec
                • Print-fconst
                • Print-dec-expo
                • Print-bin-expo
                • Print-unop
                • Print-transunit
                • Print-new-line
                • Print-lsuffix
                • Print-inc/dec-op
                • Print-hex-quad
                • Print-eprefix
                • Print-cprefix
                • Print-usuffix
                • Print-iconst
                • Print-hprefix
                • Print-const
                • Print-comp-stmt
                • Print-hex-digit-achars
                • Print-sign
                • Print-oct-digit-achars
                • Print-dec-digit-achars
                • Print-chars
                • Inc-pristate-indent
                • Print-expr-list
                • Print-struct-declon-list
                • Print-stmt
                • Print-param-declor
                • Print-dirdeclor
                • Default-priopt
                • Print-struct-declor
                • Print-initer
                • Print-decl-inline
                • Print-struct-declon
                • Print-genassoc-list
                • Print-enum-spec
                • Print-absdeclor
                • Print-typequal/attribspec-list
                • Print-desiniter-list
                • Print-const-expr
                • Print-attrib
                • Print-tyname
                • Print-struct-declor-list
                • Print-spec/qual-list
                • Print-param-declon-list
                • Print-param-declon
                • Print-initdeclor-list
                • Print-designor-list
                • Print-decl-spec-list
                • Print-decl-list
                • Print-attrib-spec-list
                • Print-asm-output-list
                • Print-asm-input-list
                • Print-typequal/attribspec
                • Print-statassert
                • Print-spec/qual
                • Print-member-designor
                • Print-initdeclor
                • Print-enumer-list
                • Print-dirabsdeclor
                • Print-desiniter
                • Print-decl-spec
                • Print-decl
                • Print-block-item-list
                • Print-attrib-spec
                • Print-attrib-list
                • Print-asm-output
                • Print-align-spec
                • Print-type-spec
                • Print-label
                • Print-genassoc
                • Print-enumer
                • Print-designor
                • Print-declor
                • Print-block-item
                • Print-asm-stmt
                • Print-asm-input
              • Output-files
              • Abstract-syntax-operations
              • Implementation-environments
              • Abstract-syntax
              • Concrete-syntax
              • Disambiguation
              • Validation
              • Gcc-builtins
              • 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
    • Printer

    Print-filepath-transunit-map

    Print the files in a file set.

    Signature
    (print-filepath-transunit-map tunitmap options gcc) → filemap
    Arguments
    tunitmap — Guard (filepath-transunit-mapp tunitmap).
    options — Guard (prioptp options).
    gcc — Guard (booleanp gcc).
    Returns
    filemap — Type (filepath-filedata-mapp filemap).

    The input is a map from file paths to translation units, i.e. the core content of a translation unit ensemble. We also pass the printer options as additional input. We go through each translation unit in the map and print it, obtaining a file for each. We return a map from file paths to files that corresponds to the map from file paths to translation units. The two maps have the same keys.

    Definitions and Theorems

    Function: print-filepath-transunit-map

    (defun print-filepath-transunit-map (tunitmap options gcc)
     (declare (xargs :guard (and (filepath-transunit-mapp tunitmap)
                                 (prioptp options)
                                 (booleanp gcc))))
     (declare
       (xargs
            :guard (and (filepath-transunit-map-unambp tunitmap)
                        (filepath-transunit-map-aidentp tunitmap gcc))))
     (let ((__function__ 'print-filepath-transunit-map))
       (declare (ignorable __function__))
       (b* (((when (omap::emptyp tunitmap)) nil)
            ((mv filepath tunit)
             (omap::head tunitmap))
            (data (print-file tunit options gcc))
            (filemap (print-filepath-transunit-map (omap::tail tunitmap)
                                                   options gcc)))
         (omap::update (filepath-fix filepath)
                       (filedata data)
                       filemap))))

    Theorem: filepath-filedata-mapp-of-print-filepath-transunit-map

    (defthm filepath-filedata-mapp-of-print-filepath-transunit-map
     (b* ((filemap (print-filepath-transunit-map tunitmap options gcc)))
       (filepath-filedata-mapp filemap))
     :rule-classes :rewrite)

    Theorem: keys-of-print-filepath-transunit-map

    (defthm keys-of-print-filepath-transunit-map
     (implies
       (filepath-transunit-mapp tunitmap)
       (b*
        ((?filemap (print-filepath-transunit-map tunitmap options gcc)))
        (equal (omap::keys filemap)
               (omap::keys tunitmap)))))

    Theorem: print-filepath-transunit-map-of-priopt-fix-options

    (defthm print-filepath-transunit-map-of-priopt-fix-options
      (equal (print-filepath-transunit-map tunitmap (priopt-fix options)
                                           gcc)
             (print-filepath-transunit-map tunitmap options gcc)))

    Theorem: print-filepath-transunit-map-priopt-equiv-congruence-on-options

    (defthm
        print-filepath-transunit-map-priopt-equiv-congruence-on-options
     (implies
      (priopt-equiv options options-equiv)
      (equal (print-filepath-transunit-map tunitmap options gcc)
             (print-filepath-transunit-map tunitmap options-equiv gcc)))
     :rule-classes :congruence)

    Theorem: print-filepath-transunit-map-of-bool-fix-gcc

    (defthm print-filepath-transunit-map-of-bool-fix-gcc
     (equal
          (print-filepath-transunit-map tunitmap options (bool-fix gcc))
          (print-filepath-transunit-map tunitmap options gcc)))

    Theorem: print-filepath-transunit-map-iff-congruence-on-gcc

    (defthm print-filepath-transunit-map-iff-congruence-on-gcc
     (implies
      (iff gcc gcc-equiv)
      (equal (print-filepath-transunit-map tunitmap options gcc)
             (print-filepath-transunit-map tunitmap options gcc-equiv)))
     :rule-classes :congruence)