• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • 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-transunit
                  • Simpadd0-ext-declon-list
                  • Simpadd0-transunit-ensemble
                  • 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
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Simpadd0-event-generation

    Simpadd0-transunit

    Transform a translation unit.

    Signature
    (simpadd0-transunit tunit gin) → (mv new-tunit gout)
    Arguments
    tunit — Guard (transunitp tunit).
    gin — Guard (ginp gin).
    Returns
    new-tunit — Type (transunitp new-tunit).
    gout — Type (goutp gout).

    The gin passed as input has vartys set to nil (see simpadd0-filepath-transunit-map), but the theorem index and the list of events may be the result of transforming previous translation units.

    We generate a comment at the beginning of the translation unit that says that the file was generated by this transformation.

    Definitions and Theorems

    Function: simpadd0-transunit

    (defun simpadd0-transunit (tunit gin)
     (declare (xargs :guard (and (transunitp tunit) (ginp gin))))
     (declare (xargs :guard (and (transunit-unambp tunit)
                                 (transunit-annop tunit))))
     (let ((__function__ 'simpadd0-transunit))
      (declare (ignorable __function__))
      (b*
       (((gin gin) gin)
        ((transunit tunit) tunit)
        ((mv new-declons (gout gout-decls))
         (simpadd0-ext-declon-list tunit.declons gin))
        (gin (gin-update gin gout-decls))
        (comment
          (acl2::string=>nats "This file is generated by 'simpadd0'.")))
       (mv (make-transunit :comment comment
                           :declons new-declons
                           :info tunit.info)
           (gout-no-thm gin)))))

    Theorem: transunitp-of-simpadd0-transunit.new-tunit

    (defthm transunitp-of-simpadd0-transunit.new-tunit
      (b* (((mv ?new-tunit ?gout)
            (simpadd0-transunit tunit gin)))
        (transunitp new-tunit))
      :rule-classes :rewrite)

    Theorem: goutp-of-simpadd0-transunit.gout

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

    Theorem: transunit-unambp-of-simpadd0-transunit

    (defthm transunit-unambp-of-simpadd0-transunit
      (b* (((mv ?new-tunit ?gout)
            (simpadd0-transunit tunit gin)))
        (transunit-unambp new-tunit)))

    Theorem: transunit-annop-of-simpadd0-transunit

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

    Theorem: transunit-aidentp-of-simpadd0-transunit

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

    Theorem: simpadd0-transunit-of-transunit-fix-tunit

    (defthm simpadd0-transunit-of-transunit-fix-tunit
      (equal (simpadd0-transunit (c$::transunit-fix tunit)
                                 gin)
             (simpadd0-transunit tunit gin)))

    Theorem: simpadd0-transunit-transunit-equiv-congruence-on-tunit

    (defthm simpadd0-transunit-transunit-equiv-congruence-on-tunit
      (implies (c$::transunit-equiv tunit tunit-equiv)
               (equal (simpadd0-transunit tunit gin)
                      (simpadd0-transunit tunit-equiv gin)))
      :rule-classes :congruence)

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

    (defthm simpadd0-transunit-of-gin-fix-gin
      (equal (simpadd0-transunit tunit (gin-fix gin))
             (simpadd0-transunit tunit gin)))

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

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