• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
            • Parser
            • Validator
            • Printer
              • Print-exprs/decls/stmts
              • Print-expr
              • Pristate
              • Print-dec/oct/hex-const
              • Priopt
              • Print-fundef
              • Print-s-char
              • Print-c-char
              • Print-typequal/attribspec-list-list
              • Print-filepath-transunit-map
                • Print-fileset
                • Print-ident
                • Print-ident-list
                • Print-hex-core-fconst
                • Print-dec-core-fconst
                • Print-oct-digit-achar
                • Print-hex-frac-const
                • Print-hex-digit-achar
                • Print-dec-frac-const
                • Print-dec-digit-achar
                • Print-struni-spec
                • Print-file
                • Print-astring
                • Print-asm-name-spec
                • Print-asm-clobber-list
                • Print-stringlit-list
                • Print-inc/dec-op-list
                • Print-cprefix-option
                • Print-binop
                • Print-univ-char-name
                • Print-type-qual
                • Print-transunit
                • Print-simple-escape
                • Print-s-char-list
                • Print-isuffix-option
                • Print-indent
                • Print-fsuffix-option
                • Print-extdecl-list
                • Print-eprefix-option
                • Print-dec-expo-option
                • Print-char
                • Print-c-char-list
                • Print-attrib-name
                • Print-asm-qual-list
                • Print-stor-spec
                • Print-oct-escape
                • Print-escape
                • Print-dec-expo-prefix
                • Print-cconst
                • Print-bin-expo-prefix
                • Dec-pristate-indent
                • Print-stringlit
                • Print-sign-option
                • Print-isuffix
                • Print-fun-spec
                • Print-fconst
                • Print-extdecl
                • Print-dec-expo
                • Print-block
                • Print-bin-expo
                • Print-asm-qual
                • Print-asm-clobber
                • Print-new-line
                • Print-lsuffix
                • Print-inc/dec-op
                • Print-hex-quad
                • Print-fsuffix
                • Print-eprefix
                • Print-cprefix
                • Print-usuffix
                • Print-unop
                • Print-iconst
                • Print-hprefix
                • Print-const
                • Print-chars
                • Print-sign
                • Print-oct-digit-achars
                • Print-hex-digit-achars
                • Print-dec-digit-achars
                • Print-stmt
                • Print-expr-list
                • Init-pristate
                • Print-structdecl-list
                • Inc-pristate-indent
                • Print-param-declor
                • Print-dirdeclor
                • Default-priopt
                • Print-structdeclor
                • Print-initer
                • Print-decl-inline
                • Print-structdecl
                • Print-genassoc-list
                • Print-enumspec
                • Print-absdeclor
                • Print-typequal/attribspec-list
                • Print-desiniter-list
                • Print-const-expr
                • Print-attrib
                • Print-tyname
                • Print-structdeclor-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
              • Formalized-subset
              • Mapping-to-language-definition
              • Input-files
              • Defpred
              • Output-files
              • Abstract-syntax-operations
              • Validation-information
              • Implementation-environments
              • Concrete-syntax
              • Ascii-identifiers
              • Unambiguity
              • Preprocessing
              • Abstraction-mapping
              • Standard
              • Purity
            • Atc
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • 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) → filemap
    Arguments
    tunitmap — Guard (filepath-transunit-mapp tunitmap).
    options — Guard (prioptp options).
    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)
     (declare (xargs :guard (and (filepath-transunit-mapp tunitmap)
                                 (prioptp options))))
     (declare (xargs :guard (filepath-transunit-map-unambp tunitmap)))
     (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))
            (filemap (print-filepath-transunit-map (omap::tail tunitmap)
                                                   options)))
         (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)))
        (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)))
          (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))
            (print-filepath-transunit-map tunitmap options)))

    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)
                 (print-filepath-transunit-map tunitmap options-equiv)))
     :rule-classes :congruence)