Abstract: | Most implementations of the Warren Abstract Machine to convert Prolog to native code have been C and stack-based. A great deal of attention and complexity must go into prventing dangling pointers in a stack-based implementation. Java's pointer allocation and garbage collector means an engine in the JVM need not have this complexity. At present there does not seem to be an efficient, easily-extensible implementation of the WAM in Java. This paper first presents a tutorial of WAM behavior from a persepctive not tied to a stack-based implementation. Then a Java-based compiler is presented which converts SICStus Prolog-based WAM to Java. A Java engine, written so as to be efficient and extensible, is also presented and benchmarked against the existing Java-based engines.
|