• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • 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-deep-code-generation
                  • Atj-gen-deep-term-fns
                  • Atj-gen-deep-test-code
                  • Atj-gen-deep-fndef-method
                  • Atj-gen-deep-fnapp
                  • Atj-gen-deep-env-class
                  • Atj-gen-deep-env-cunit
                  • Atj-gen-deep-lambda
                  • Atj-gen-deep-qconst
                  • Atj-gen-deep-main-class
                    • Atj-gen-deep-term
                    • Atj-gen-deep-terms
                    • Atj-gen-deep-build-method
                    • Atj-gen-deep-call-method
                    • Atj-gen-deep-main-cunit
                    • Atj-gen-deep-fndef-method-name
                    • Atj-gen-deep-fndef-methods
                    • Atj-gen-deep-fndefs
                    • Atj-gen-deep-formals
                    • Atj-gen-deep-var
                  • 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-deep-code-generation

    Atj-gen-deep-main-class

    Generate the main (i.e. non-test) Java class declaration, in the deep embedding approach.

    Signature
    (atj-gen-deep-main-class java-class$ verbose$) → class
    Arguments
    java-class$ — Guard (stringp java-class$).
    verbose$ — Guard (booleanp verbose$).
    Returns
    class — Type (jclassp class).

    This is a public class. [JLS14:7.6] says that a Java implementation may require public classes to be in files with the same names (plus extension). The code that we generate satisfies this requirement.

    The class contains the initialization method, the static initializer, and the method to call ACL2 code from external code.

    Definitions and Theorems

    Function: atj-gen-deep-main-class

    (defun atj-gen-deep-main-class (java-class$ verbose$)
     (declare (xargs :guard (and (stringp java-class$)
                                 (booleanp verbose$))))
     (let ((__function__ 'atj-gen-deep-main-class))
      (declare (ignorable __function__))
      (b*
       (((run-when verbose$)
         (cw "~%Generate the main Java class.~%"))
        (static-init (atj-gen-static-initializer java-class$))
        (init-method (atj-gen-init-method))
        (call-method (atj-gen-deep-call-method))
        (body-class
         (append
          (list (jcbody-element-init static-init))
          (list (jcbody-element-member (jcmember-method init-method)))
          (list
               (jcbody-element-member (jcmember-method call-method))))))
       (make-jclass :access (jaccess-public)
                    :abstract? nil
                    :static? nil
                    :final? t
                    :strictfp? nil
                    :name java-class$
                    :superclass? nil
                    :superinterfaces nil
                    :body body-class))))

    Theorem: jclassp-of-atj-gen-deep-main-class

    (defthm jclassp-of-atj-gen-deep-main-class
      (b* ((class (atj-gen-deep-main-class java-class$ verbose$)))
        (jclassp class))
      :rule-classes :rewrite)