Alter-Java
Alter-Java is a language extension for Java implementing the alternation programming paradigm.
To get an intuition what an alternating progam is you might look at some
example programs.
Framework:
The Framework consists of a compiler for Alter-Java and a runtime to execute the programs. The Compiler generates Java-Code, so to get executable programs you further have to run an Java compiler.
You can use the Alternation-framework under the BSD-license. The details are given in the
license files in the archives.
Full - Framework:
This file contains the Alter-Java compiler, the runtime package and the example programs.
To run the compiler you need
ANTLR 3.1 or higher.
Runtime:
This is the runtime package you need to execute your compiled programs.
Alter-Java Grammar
GUI:
A Graphical User Interface to explore the computation tree of Alter-Java progams.
This package was developed by Stefan Weiser.
older versions
Alter-Java Programs:
The programs in this section hopefully give an intuition how Alter-Java can be used:
-
Acyclic Geographic Game:
Decides if there is a winning strategy in the acyclic geographic game
program
-
Alternating Turing Machine :
A program that simulates an Alternating Turing machine.
program
-
Cat and Mouse:
The Cat and Mouse Game is played on a directed graph. The two players, the cat and the mouse, alternating moving along edges in the graph. The mouse tries to reach the goal vertex (the mouse hole) and the cat tries to catch the mouse. The program checks if there is a winning strategy for the mouse.
naive program,
version with cycle detection,
version without tabled evaluation
-
Graph Game:
The two players alternating moving along edges in the graph trying to reach a winning vertex. The program checks if there is a winning strategy for the start player
program
-
Definite Horn minimal model:
This program checks if a atom is in the minimal model of a Horn clause.
naive program,
opimized version,
version without cycle detection
-
Lexicographical First Maximum Clique:
program
-
Monotone Circuit Value Problem:
Evalutes a given Boolean Circuit consisting of AND and OR gates.
program
-
Cellular Automata:
program
-
Pebble Game:
Computes if there is a winning strategy for player 1 in the given pebble game
naive program without cycle detection,
program,
-
Tic-Tac-Toe:
For a given board the program computes if there is a winning strategy for the cross-player.
program
-
more examples
how-to...
compile:
First get sure you have the Alter-Java and the ANTLR package in your classpath.
To compile Alter-Java program in the source directory simple run the atmCompile program (
at.ac.tuwien.dbai.alternation.compiler.atmcompile) with the path to the input file:
java at.ac.tuwien.dbai.alternation.compiler.atmcompile example.atm
generates a file example.java in the current directory.
There is a second argument in the atmCompile program to specify the output file:
java atmcompile /home/angus/example.atm /web/macgyver.java
generates a file macgyver.java in the web directory.
To get executable programs you have to compile the .java files with an Java compiler.
execute programs:
First get sure you have the Alter-Java frame work or the runtime in your classpath. To make Alter-Java progams executable you can either write an other Java class that calls the alternating program with some input our you add a main method to the generated .java file.
Publications:
Alternation as a programming paradigm
Wolfgang Dvořák, Georg Gottlob, Reinhard Pichler, Stefan Woltran
In Proceedings of the 11th ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (Coimbra, Portugal, September 07 - 09, 2009). PPDP '09. ACM, New York, NY, 61-72. DOI= http://doi.acm.org/10.1145/1599410.1599419
Alternation as a Programming Paradigm
Wolfgang Dvořák, Georg Gottlob, Reinhard Pichler, Stefan Woltran
Technical Report DBAI-TR-2009-64, Technische Universität Wien, Database and Artificial
Intelligence Group, 2009 [pdf]
Alternation as a programming paradigm
Master thesis
Wolfgang Dvořák; supervised by Reinhard Pichler and Stefan Woltran