This paper describes a code generator that translates ACL2 constructs to corresponding Java constructs, according to a shallow embedding of ACL2 in Java. Starting from purely functional ACL2 code, the generated Java code exhibits imperative and object-oriented features like destructive updates, loops, and overloading. The overall translation from ACL2 to Java is fairly elaborate, consisting of several ACL2-to-ACL2 pre-translation steps, an ACL2-to-Java proper translation step, and several Java-to-Java post-translation steps. Experiments suggest that the generated Java code is not much slower than the ACL2 code. The code generator can also recognize, and translate to Java, ACL2 representations of certain Java constructs, forerunning a code generation approach based on a shallow embedding of Java in ACL2 (i.e. going the other way). This code generator builds upon, and significantly extends, a simple Java code generator for ACL2 based on a deep embedding of ACL2 in Java.
翻译:本文描述根据爪哇ACL2的浅薄嵌入, 将ACL2构造转换为相应的 Java 构造的代码生成器。 从纯功能性的ACL2 代码开始, 生成的 Java 代码必须和以目标为导向的特性, 如破坏性更新、 循环和超载。 从ACL2 到 Java 的总体翻译相当精细, 包括一些ACL2- to- ACL2 翻译前步骤、 ACL2- 到 Java 正确翻译步骤以及 Java- Java 翻译后步骤。 实验显示, 生成的 Java 代码不会比 ACL2 代码慢得多 。 代码生成器还可以识别某些 Java 构建的ACL2 表达器, 并翻译给 Java, 某些 Java 的 ACL2 演示器, 预示着一种基于 ACL2 浅嵌入 的 ACL2 代码生成器( 以另一种方式) 。 该代码生成器以一个简单 Java 的 Java 代码生成器为基础,, 并大大扩展了 。