Alternation as a programming paradigm

Alternation is a common tool in complexity theory, where it has been used to prove various complexity classifications. In this work, we show that it can also be used to enhance the expressive power of the imperative part of a programming language. In particular, we present Alter-Java -- an extension of Java by language constructs to express alternation, i.e., a sequence of "there exists" and "for all" statements. Moreover, we show that many practical problems have a very natural and succinct description in terms of alternation. In order to guarantee an efficient execution of such programs, we have introduced several optimizations. We also report on experiments with our implementation of Alter-Java. The results thus obtained illustrate that our alternation framework leads to competitive running times while the code to be written is significantly shorter than without this new language feature.

[1]  Walter L. Ruzzo,et al.  Tree-size bounded alternation(Extended Abstract) , 1979, J. Comput. Syst. Sci..

[2]  Martin Tompa,et al.  The complexity of short two-person games , 1990, Discret. Appl. Math..

[3]  Wolfgang Faber,et al.  The DLV system for knowledge representation and reasoning , 2002, TOCL.

[4]  Krzysztof R. Apt,et al.  Programming in Alma-0, or Imperative and Declarative Programming Reconciled , 2000, ArXiv.

[5]  David Harel,et al.  And/Or Programs: A New Approach to Structured Programming , 1980, TOPL.

[6]  Moshe Y. Vardi Alternating Automata and Program Verification , 1995, Computer Science Today.

[7]  Christos H. Papadimitriou,et al.  Computational complexity , 1993 .

[8]  Hans Tompits,et al.  Effective Integration of Declarative Rules with External Evaluations for Semantic-Web Reasoning , 2006, ESWC.

[9]  Georg Gottlob,et al.  Hypertree decompositions and tractable queries , 1998, J. Comput. Syst. Sci..

[10]  Hans Tompits,et al.  A Uniform Integration of Higher-Order Reasoning and External Evaluations in Answer-Set Programming , 2005, IJCAI.

[11]  John Michael Robson,et al.  The Complexity of Go , 1983, IFIP Congress.

[12]  Slim Abdennadher,et al.  JACK: A Java Constraint Kit , 1999, Electron. Notes Theor. Comput. Sci..

[13]  Peter J. Stuckey,et al.  Just enough tabling , 2004, PPDP '04.

[14]  Jean H. Gallier,et al.  Linear-Time Algorithms for Testing the Satisfiability of Propositional Horn Formulae , 1984, J. Log. Program..

[15]  R. Ladner The circuit value problem is log space complete for P , 1975, SIGA.

[16]  Ehud Y. Shapiro Alternation and the Computational Complexity of Logic Programs , 1984, J. Log. Program..

[17]  H. James Hoover,et al.  Limits to Parallel Computation: P-Completeness Theory , 1995 .

[18]  Krzysztof R. Apt,et al.  Search and imperative programming , 1997, POPL '97.

[19]  Aviezri S. Fraenkel,et al.  Computing a Perfect Strategy for n*n Chess Requires Time Exponential in N , 1981, ICALP.

[20]  K. A. Ross,et al.  Tabled Evaluation with Delaying for General Logic Programs , 1996 .

[21]  David E. Muller,et al.  Weak alternating automata give a simple explanation of why most temporal and dynamic logics are decidable in exponential time , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[22]  Satoru Miyano,et al.  A List of P-Complete Problems , 1989 .

[23]  Neil D. Jones,et al.  Complete problems for deterministic polynomial time , 1974, Symposium on the Theory of Computing.

[24]  Martin Grabmüller The Constraint Imperative Programming Language Turtle , 2003 .

[25]  Frank Pfenning,et al.  Types in Logic Programming , 1992, ICLP.

[26]  Kouji Yamauchi,et al.  DJ: A Java-based Constraint Language and System , 1998 .

[27]  Krzysztof R. Apt,et al.  The Alma Project, or How First-Order Logic Can Help Us in Imperative Programming , 1999, Correct System Design.

[28]  Atanas Radensky Toward integration of the imperative and logic programming paradigms: Horn-clause programming in the Pascal environment , 1990, SIGP.

[29]  Terence Parr The Definitive ANTLR Reference: Building Domain-Specific Languages , 2007 .

[30]  Jacques Cohen,et al.  Non-Deterministic Algorithms , 1979, CSUR.

[31]  Georg Gottlob,et al.  A Comparison of Structural CSP Decomposition Methods , 1999, IJCAI.

[32]  Stefan Reisch,et al.  Gobang ist PSPACE-vollständig , 2004, Acta Informatica.