Generate the main (i.e. non-test) Java class declaration, in the deep embedding approach.
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.
Function:
(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:
(defthm jclassp-of-atj-gen-deep-main-class (b* ((class (atj-gen-deep-main-class java-class$ verbose$))) (jclassp class)) :rule-classes :rewrite)