| Wissensverarbeitung und Informationssysteme |
Kathrin Konczak and Thomas Linke and Torsten Schaub
Universität Potsdam, Institut für Informatik
The GCasp system is divided in several components which read a logic program out of a file, generate the rule dependence graph (RDG), which represents the logic program, and compute the admissible colorings , which corresponds to the answer sets of the logic program. The implementation is written for different Prolog systems like ECLiPSe, SICStus and SWI. Additionally, the well-founded semantics [4] for normal logic programs can be computed.
After parsing the normal logic program out of a file the rule dependence graph is constructed. For a better representation the RDG is compiled into temporary files. Now a sequence of operators [2,3] computes admissible colorings of the RDG which correspond to the answer sets of the logic program.
> gunzip gcasp-1.0.tar.gz > tar -xf gcasp-1.0.tarAfter unpacking you find the source files in the /GCasp/Source directory. The directory /GCasp/Examples contains some example files. If you want to use a tool for visualization of the RDG, you have to install the daVinci system.
We want to compute the answer sets of the following logic
program [3], stored in Examples/example.lp:
[eclipse 1]:
[eclipse 1]: [gcasp]. ..... !!!!! Which Prolog are you working with? !!!!! (enter number followed by ENTER) !!!!! (0) ECLIPSe (1) SWI (2) Sicstus (3) Exit !!!!! 0 Flag prolog(eclipse) set Flag output set ************************************** ECLiPSe version of the GCasp system ************************************** .....
[eclipse 2]: flags. output = on prolog(eclipse) = on prolog(swi) = off prolog(sicstus) = off daVinci = off
[eclipse 6]: set_flag(daVinci). Flag daVinci set
[eclipse 3]: cload(c2).
[eclipse 4]: gcasp('../Examples/example.lp', 0).
This call returns conclusion about the number of answer sets
and choice points
and the duration for computation.
Answer Set 1: { b, f, p }
Answer Set 2: { b, nf, p }
....
number of choice points : 1
number of solutions : 2 (for program ../Examples/example.lp)
duration : 0.01s
Furthermore, the file example.lp.daVinci is created, which is a
visualization of the RDG.
[eclipse 5]: wfm('../Examples/example.lp').
computing well-founded model ... ready
Positive part : [b, p]
Negative part : [m]
duration : 0.0s (for program ../Examples/examples.lp)
We have developed different operators for computing deterministic
consequences (
,
,
) and choices
(
,
). For more details see [2,3].
For computing admissible colorings, which corresponds to answer sets, we provide different operational characterizations [2,3].