• 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
          • Atc
          • Transformation-tools
            • Simpadd0
              • Simpadd0-dirdeclor
              • Simpadd0-implementation
                • Simpadd0-event-generation
                  • Simpadd0-exprs/decls/stmts
                  • Simpadd0-expr-binary
                  • Simpadd0-fundef
                  • Simpadd0-filepath-transunit-map
                    • Simpadd0-ext-declon-list
                    • Simpadd0-transunit-ensemble
                    • Simpadd0-transunit
                    • Simpadd0-ext-declon
                    • Simpadd0-code-ensemble
                    • Simpadd0-gen-everything
                  • Simpadd0-process-inputs-and-gen-everything
                  • Simpadd0-fn
                  • Simpadd0-input-processing
                  • Simpadd0-macro-definition
                • Simpadd0-declor
                • Simpadd0-init-declor
                • Simpadd0-init-declor-list
                • Simpadd0-declon
                • Simpadd0-comp-stmt
                • Simpadd0-param-declor
                • Simpadd0-param-declon-list
                • Simpadd0-param-declon
                • Simpadd0-expr-option
                • Simpadd0-struct-declor-list
                • Simpadd0-struct-declon-list
                • Simpadd0-dirabsdeclor-option
                • Simpadd0-desiniter-list
                • Simpadd0-struni-spec
                • Simpadd0-struct-declor
                • Simpadd0-struct-declon
                • Simpadd0-statassert
                • Simpadd0-spec/qual-list
                • Simpadd0-spec/qual
                • Simpadd0-genassoc-list
                • Simpadd0-dirabsdeclor
                • Simpadd0-desiniter
                • Simpadd0-designor-list
                • Simpadd0-decl-spec-list
                • Simpadd0-const-expr-option
                • Simpadd0-align-spec
                • Simpadd0-absdeclor-option
                • Simpadd0-type-spec
                • Simpadd0-tyname
                • Simpadd0-member-designor
                • Simpadd0-initer-option
                • Simpadd0-initer
                • Simpadd0-genassoc
                • Simpadd0-expr-list
                • Simpadd0-enumer-list
                • Simpadd0-enumer
                • Simpadd0-enum-spec
                • Simpadd0-designor
                • Simpadd0-declor-option
                • Simpadd0-declon-list
                • Simpadd0-decl-spec
                • Simpadd0-const-expr
                • Simpadd0-block-item-list
                • Simpadd0-block-item
                • Simpadd0-absdeclor
                • Simpadd0-stmt
                • Simpadd0-label
                • Simpadd0-expr
              • Proof-generation
              • Split-gso
              • Wrap-fn
              • Constant-propagation
              • Specialize
              • Split-fn
              • Split-fn-when
              • Split-all-gso
              • Copy-fn
              • Variables-in-computation-states
              • Rename
              • Utilities
              • Proof-generation-theorems
              • Input-processing
            • 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
    • Simpadd0-event-generation

    Simpadd0-filepath-transunit-map

    Transform a map from file paths to translation units.

    Signature
    (simpadd0-filepath-transunit-map map gin) → (mv new-map gout)
    Arguments
    map — Guard (filepath-transunit-mapp map).
    gin — Guard (ginp gin).
    Returns
    new-map — Type (filepath-transunit-mapp new-map), given (filepath-transunit-mapp map).
    gout — Type (goutp gout).

    We transform both the file paths and the translation units.

    After each translation unit, we reset the vartys component of gin to nil, because each translation unit starts with no variables in scope. This component is initialized to nil in simpadd0-code-ensemble, so the first translation unit also has the right vartys.

    Definitions and Theorems

    Function: simpadd0-filepath-transunit-map

    (defun simpadd0-filepath-transunit-map (map gin)
      (declare (xargs :guard (and (filepath-transunit-mapp map)
                                  (ginp gin))))
      (declare (xargs :guard (and (filepath-transunit-map-unambp map)
                                  (filepath-transunit-map-annop map))))
      (let ((__function__ 'simpadd0-filepath-transunit-map))
        (declare (ignorable __function__))
        (b* (((gin gin) gin)
             ((when (omap::emptyp map))
              (mv nil (gout-no-thm gin)))
             ((mv path tunit) (omap::head map))
             ((mv new-tunit (gout gout-tunit))
              (simpadd0-transunit tunit gin))
             (gin (gin-update gin gout-tunit))
             (gin (change-gin gin :vartys nil))
             ((mv new-map (gout gout-map))
              (simpadd0-filepath-transunit-map (omap::tail map)
                                               gin))
             (gin (gin-update gin gout-map)))
          (mv (omap::update path new-tunit new-map)
              (gout-no-thm gin)))))

    Theorem: filepath-transunit-mapp-of-simpadd0-filepath-transunit-map.new-map

    (defthm
     filepath-transunit-mapp-of-simpadd0-filepath-transunit-map.new-map
     (implies (filepath-transunit-mapp map)
              (b* (((mv ?new-map ?gout)
                    (simpadd0-filepath-transunit-map map gin)))
                (filepath-transunit-mapp new-map)))
     :rule-classes :rewrite)

    Theorem: goutp-of-simpadd0-filepath-transunit-map.gout

    (defthm goutp-of-simpadd0-filepath-transunit-map.gout
      (b* (((mv ?new-map ?gout)
            (simpadd0-filepath-transunit-map map gin)))
        (goutp gout))
      :rule-classes :rewrite)

    Theorem: simpadd0-filepath-transunit-map-of-gin-fix-gin

    (defthm simpadd0-filepath-transunit-map-of-gin-fix-gin
      (equal (simpadd0-filepath-transunit-map map (gin-fix gin))
             (simpadd0-filepath-transunit-map map gin)))

    Theorem: simpadd0-filepath-transunit-map-gin-equiv-congruence-on-gin

    (defthm simpadd0-filepath-transunit-map-gin-equiv-congruence-on-gin
      (implies (gin-equiv gin gin-equiv)
               (equal (simpadd0-filepath-transunit-map map gin)
                      (simpadd0-filepath-transunit-map map gin-equiv)))
      :rule-classes :congruence)

    Theorem: filepath-transunit-map-unambp-of-simpadd0-filepath-transunit-map

    (defthm
       filepath-transunit-map-unambp-of-simpadd0-filepath-transunit-map
      (implies (filepath-transunit-mapp map)
               (b* (((mv ?new-map ?gout)
                     (simpadd0-filepath-transunit-map map gin)))
                 (filepath-transunit-map-unambp new-map))))

    Theorem: filepath-transunit-map-annop-of-simpadd0-filepath-transunit-map

    (defthm
        filepath-transunit-map-annop-of-simpadd0-filepath-transunit-map
      (implies (and (filepath-transunit-mapp map)
                    (filepath-transunit-map-unambp map)
                    (filepath-transunit-map-annop map))
               (b* (((mv ?new-map ?gout)
                     (simpadd0-filepath-transunit-map map gin)))
                 (filepath-transunit-map-annop new-map))))

    Theorem: filepath-transunit-map-aidentp-of-simpadd0-filepath-transunit-map

    (defthm
      filepath-transunit-map-aidentp-of-simpadd0-filepath-transunit-map
      (implies (and (filepath-transunit-mapp map)
                    (filepath-transunit-map-unambp map)
                    (filepath-transunit-map-aidentp map gcc))
               (b* (((mv ?new-map ?gout)
                     (simpadd0-filepath-transunit-map map gin)))
                 (filepath-transunit-map-aidentp new-map gcc))))