quontroller is a python script based on oclingo that allows interactive querying of ASP encodings.
quontroller is part of github.com/grote/oclingo in the quontroller branch.
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
.
quontroller.py
depends on
controller.py
, which can be found at the same location as quontroller.py
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.
./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.