Spurious answers sets if there are theory atoms with trivially false bodies
rkaminsk opened this issue · comments
If a program contains a theory atom with a trivially false body, then there are too many answer sets. I suspect that clasp treats it like a theory atom in a rule body in this case:
#theory bug {
t {};
&x/0: t,head
}.
{c}.
:- c.
&x { c } :- c.
Hiding the false body a bit produces the right results:
```prolog
#theory bug {
t {};
&x/0: t,head
}.
{c,d}.
:- c, d.
:- c, not d.
:- not c, d.
&x { c } :- c.
The aspif of the problematic version is:
asp 1 0 0
1 1 1 1 0 0
1 0 1 2 0 1 1
1 0 0 0 1 1
9 1 0 1 x
9 1 1 1 c
9 4 0 1 1 0
9 5 2 0 1 0
4 1 c 1 1
0
And the output of clasp is:
clasp version 3.3.6
Reading from stdin
Solving...
Answer: 1
Answer: 2
SATISFIABLE
Models : 2
Calls : 1
Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s)
CPU Time : 0.000s
@rkaminsk
Pushed a fix to dev.