I am a newbie to ASP (Answer Set Programming).
I tried the following program in clingo online version (reasoning mode = enumerate all)
% instance
member(dave).
% encoding
edu(X);rich(X) :- member(X).
It returns:
Answer: 1
member(dave) rich(dave)
Answer: 2
member(dave) edu(dave)
SATISFIABLE
But why there is no "Answer: 3" ? Something like:
Answer: 3
member(dave) edu(dave) rich(dave)
This answer also satisfies the rule edu(X);rich(X) :- member(X).
.
From the perspective of logic,
edu(X);rich(X) :- member(X).
means
member(X) -> edu(X) ∨ rich(X)
So there ought to be another answer that both edu(X)
and rich(X) are true.
BTW, if I add the two facts about charlie manually:
% instance
member(charlie).
rich(charlie).
edu(charlie).
% encoding
edu(X);rich(X) :- member(X).
Then it returns the correct answer as expected:
Answer: 1
member(charlie) edu(charlie) rich(charlie)
SATISFIABLE
Very thanks!
Some background information:
I have this question, because I am comparing traditional Logic Programming (e.g Prolog) vs Answer Set Programming (e.g. clingo), although they use different theoretical framework.
The disjunctive programs of the form in clingo:
a_1 ∨ a_2 ... ∨ a_n <- body
can not be represented in Prolog out of box.
A related question, see Using And clause in HEAD of a prolog statement