• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
          • Atj
            • Atj-implementation
              • Atj-types
              • Atj-java-primitive-array-model
              • Atj-java-abstract-syntax
              • Atj-input-processing
              • Atj-java-pretty-printer
              • Atj-code-generation
                • Atj-gen-test-method
                • Atj-shallow-code-generation
                • Atj-common-code-generation
                • Atj-shallow-quoted-constant-generation
                • Atj-pre-translation
                • Atj-gen-everything
                • Atj-name-translation
                • Atj-gen-test-cunit
                • Atj-gen-test-class
                • Atj-gen-main-file
                • Atj-post-translation
                  • Atj-post-translation-remove-array-write-calls
                    • Atj-remove-array-write-call-returns-in-jstatems+jblocks
                    • Atj-remove-array-write-call-in-asg
                    • Atj-remove-array-write-call-asgs-in-jstatems+jblocks
                    • Atj-remove-array-write-call-return
                    • Atj-remove-array-write-calls
                      • Atj-ensure-no-array-write-calls
                      • *atj-primarray-write-method-names*
                    • Atj-post-translation-cache-const-methods
                    • Atj-post-translation-tailrec-elimination
                    • Atj-post-translation-fold-returns
                    • Atj-post-translate-body
                    • Atj-post-translation-lift-loop-tests
                    • Atj-post-translation-simplify-conds
                    • Atj-post-translate-jcbody-elements
                    • Atj-post-translation-remove-continue
                  • Atj-deep-code-generation
                  • Atj-gen-test-methods
                  • Atj-gen-test-file
                  • Atj-gen-env-file
                  • Atj-gen-output-subdir
                • Atj-java-primitives
                • Atj-java-primitive-arrays
                • Atj-type-macros
                • Atj-java-syntax-operations
                • Atj-fn
                • Atj-library-extensions
                • Atj-java-input-types
                • Atj-test-structures
                • Aij-notions
                • Atj-macro-definition
              • Atj-tutorial
            • Aij
            • Language
          • 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
    • Atj-post-translation-remove-array-write-calls

    Atj-remove-array-write-calls

    Remove array write method calls from a block.

    Signature
    (atj-remove-array-write-calls block) → new-block
    Arguments
    block — Guard (jblockp block).
    Returns
    new-block — Type (jblockp new-block).

    This puts together the two transformations described in atj-post-translation-remove-array-write-calls.

    We also ensure that, after the transformations, no more array write method calls remain.

    Definitions and Theorems

    Function: atj-remove-array-write-calls

    (defun atj-remove-array-write-calls (block)
     (declare (xargs :guard (jblockp block)))
     (let ((__function__ 'atj-remove-array-write-calls))
      (declare (ignorable __function__))
      (b*
       ((block (atj-remove-array-write-call-asgs-in-jblock block))
        (block (atj-remove-array-write-call-returns-in-jblock block))
        ((unless (atj-ensure-no-array-write-calls block))
         (raise
          "Internal error: ~
                    the block ~x0 contains array write method calls."
          block)))
       block)))

    Theorem: jblockp-of-atj-remove-array-write-calls

    (defthm jblockp-of-atj-remove-array-write-calls
      (b* ((new-block (atj-remove-array-write-calls block)))
        (jblockp new-block))
      :rule-classes :rewrite)

    Theorem: atj-remove-array-write-calls-of-jblock-fix-block

    (defthm atj-remove-array-write-calls-of-jblock-fix-block
      (equal (atj-remove-array-write-calls (jblock-fix block))
             (atj-remove-array-write-calls block)))

    Theorem: atj-remove-array-write-calls-jblock-equiv-congruence-on-block

    (defthm
          atj-remove-array-write-calls-jblock-equiv-congruence-on-block
      (implies (jblock-equiv block block-equiv)
               (equal (atj-remove-array-write-calls block)
                      (atj-remove-array-write-calls block-equiv)))
      :rule-classes :congruence)