Quontroller
Interactive Querying with Answer Set Programming

Table of Contents

Overview

Quontroller is a python script based on oclingo that allows interactive querying of ASP encodings.

Installation

Install the oclingo source tree that includes the quontroller.py python scripts from

git clone https://github.com/grote/oclingo/tree/quontroller

or

:http://www.cs.uni-potsdam.de/wv/quontroller/quontroller.tar.bz2

If you have already the latest oclingo version installed, it suffices when you only copy the folder example/oclingo from the 'quontroller' branch.

quontroller.py is located at examples/oclingo/ within the source tree. Accompanying example encodings can be found at examples/oclingo/quontroller.

Dependencies

quontroller.py depends on

  • controller.py, which can be found at the same location as quontroller.py (i.e., in example/oclingo/ relative to the root of the source tree);
  • python 2.7.x. with x >= 3;
  • latest oclingo development version from git (instruction for how to retrieve and build it are available at :http://www.cs.uni-potsdam.de/wv/oclingo/#get).

Usage

The usage is demonstrated based on an edge-coloring encoding given in examples/oclingo/quontroller/encoding.lp. We assume that the current working directory is example/oclingo/ relative to the root of the oclingo source tree.

Invocation of quontroller

./quontroller.py -o quontroller/encoding.lp -c quontroller/setup.ini

The quontroller takes the problem encoding and the setup information as input. Afterwards it forks an oclingo process and tries to connect to it. The connection has been established, when the following prompt appears:

[Quontroller-Mode] Please enter your query.

Now queries can be entered on the command line. For instance, as follows:

#query.
#assert : e(1).
edge(1,2).
edge(1,3).
edge(2,3).
edge(2,4).
edge(3,4).
#endquery.


#query.
#assert.
mark(1,1).
#endquery.


#query.
#assert : e(2).
edge(1,4).
#endquery.

#query.
#retract : e(2).
#assert.
mark(1,1).
mark(2,2).
#endquery.


#query.
#retract : e(1).
#endquery.

#stop.

Literature

  • Martin Gebser, Philipp Obermeier and Torsten Schaub. A system for interactive query answering with answer set programming. In M. Fink and Y. Lierler. Proceedings of the Sixth Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP'13), 2013. PDF BibTeX