Galliwasp 1.0.4 -- Goal-Directed Answer Set Programming http://www.utdallas.edu/~kbm072000/galliwasp/ OVERVIEW Galliwasp is a goal-directed answer set solving system for normal logic programs. The software consists of two parts: the compiler and the interpreter. A grounder capable of producing text-format grounded programs, such as lparse with the -t switch, is required but not included. The compiler is written in Prolog, while the interpreter is written in standard C. It has been successfully built under Linux and Mac OS X uxing gcc and Windows using MinGW. LICENSE Galliwasp is distributed under GNU Public Licence, see the file COPYING.TXT for details. PACKAGE CONTENTS CHANGES.TXT - Changelog COPYING.TXT - GNU Public Licence Makefile - The main Makefile for the project README.TXT - This file src/ - Source code directory for the interpreter plsrc/ - Source code directory for the compiler INSTALLATION Building Galliwasp requires the GNU Compiler Collection (GCC), SWI Prolog, and GNU make. It is also assumed that the commands 'gcc', 'swipl' and 'make', may be used to invoke the three, respectively. Building has been tested using GCC version 4.5.2, SWI-Prolog 64-bit version 5.11.25 and GNU make version 3.81. To build the compiler and interpreter, simply type 'make' from the project directory. This will create two executables, 'gwasp', the interpreter, and 'gwaspc', the compiler, which can then be moved as needed. USAGE To execute a program, it must first be compiled. The compiler accepts grounded normal logic programs in text format, such as those produced by the lparse grounder using the -t switch. Optionally, the programs may contain a 'compute' statement, indicating the number of solutions to compute and the query to execute if the interpreter is run in automatic mode, e.g. compute N { q1,...,qn }. where N is the number of solutions to compute and the list of literals in braces forms the query. The compiler reads problem instances from a given file and writes them to either stdout or a file specified with the -o switch: gwaspc inputfile gwaspc inputfile -o output file To see an overview of the compiler's commandline options, type gwaspc -? Once a program has been compiled, the compiled version can be read by the interpreter from stdin or a file, e.g. gwaspc inputfile | gwasp gwasp The compile can run in either automatic or interactive modes. Interactive mode can only be used if the compiled program is read from a file rather than stdin. To run in automatic mode, the program instance must contain a compute statement. When available, the interpreter will default to automatic mode. Otherwise, the interpreter will run in interactive mode. The '-i' switch can be used to force the interpreter to use interactive mode, ignoring the compute statement, if present, e.g. gwasp -i For an overview of the available commandline options, type gwasp -h or gwasp -? When run in automatic mode, the interpreter will simply execute the query given by the compute statement to find partial answer sets and print them, stopping when the specified number of sets has been computed or no more sets satisfying the query exist. In interactive mode, the user will be presented with a prompt to enter a query. For an overview of valid queries, enter 'help.' at the prompt. To exit the interpreter when finished, enter 'exit.' at the prompt. After each answer set has been printed, the user can enter '.' to accept the set and return to the query prompt. Alternatively, the user can enter ';' to reject the set and find the next one, if it exists. In this way,a user can find as many answer sets as desired. Finally, entering 'h' at the prompt will give an overview of both options.