TCS / Software / CIRC2DLP / Examples
Helsinki University of Technology, 
     Laboratory for Theoretical Computer Science

Examples

1. Consider the following program P taken from [NNS, 1995; Example 6]. The program is also available in a separate file for download.

p(a) | q(a) | r(a).
r(b) :- r(a).
p(b) | q(b).
r(c) | p(c).
r(d) :- p(c).

The ⟨{p,q},{r},∅⟩-minimal models of P can be computed as follows (predicates p and q are subject to minimization while the interpretation of r may vary freely):

$ lparse --dlp example.lp > example.sm
$ circ2dlp example.sm -m "p* q*" -v "r*" | gnt 0
Answer set: 1
Stable Model: r(b) r(a) r(d) r(c) p(b)
Answer set: 2
Stable Model: r(b) r(a) r(d) r(c) q(b)
Answer set: 3
Stable Model: r(b) r(a) r(c) q(b)
Answer set: 4
Stable Model: r(b) r(a) r(c) p(b)
False
Number of isminimal calls: 43
Duration: 0.020

2. The models of the prioritized circumscription Circ(P,{p,r}>{q},∅,∅) can be computed as follows:

$ circ2dlp example.sm -m "p* r*: q*" | gnt 0
Answer set: 1
Stable Model: r(d) p(c) q(a) q(b)
Answer set: 2
Stable Model: q(a) r(c) q(b)
False
Number of isminimal calls: 17
Duration: 0.006
or it is possible to use command
$ circ2dlp example.sm -m "* : q*" | gnt 0
that is, all atoms are first given the highest priority for minimization and then for q this is overridden by giving it a lower priority.

3. The models for Circ(P,{p}>{q}>{r},∅,∅) are obtained similarly:

$ circ2dlp example.sm -m "p* : q* : r*" | gnt 0
Answer set: 1
Stable Model: r(b) r(a) r(c) q(b)
False
Number of isminimal calls: 15
Duration: 0.007
using a command line like "circ2dlp example.sm -m "* : q* : r*" | gnt 0".

4. Reiter-style minimal diagnoses [Reiter, 1987] for a digital circuit can be easily captured using parallel circumscription. We provide a set of such encodings whose ⟨{ab},{high},∅⟩-minimal models correspond to minimal diagnoses. The encodings are in the internal format of smodels and textual format can be produced using the program lplist with options --gnt or --dlv. These instances have been produced as follows.

  • A random tree is first generated using the inverse Pruefer algorithm.
  • The leaves of the tree, corresponding to the inputs of the digital circuit, are assigned random boolean values
  • The intermediate nodes are assigned random logical operations corresponding to the gates of the circuit.
  • The gate at root node of the tree produces the output of the circuit.
  • The value of the output is calculated and swapped in order to obtain faulty behaviour for the circuit.
The task is to find minimal sets of gates whose faulty behaviour explains the wrong output of the whole circuit.


[TCS main] [Contact Info] [Personnel] [Research] [Publications] [Software] [Studies] [News Archive] [Links]
Latest update: 06 February 2013. Emilia Oikarinen