<s>
The	O
concept	O
of	O
a	O
stable	B-Application
model	I-Application
,	O
or	O
answer	B-Application
set	I-Application
,	O
is	O
used	O
to	O
define	O
a	O
declarative	O
semantics	B-Application
for	O
logic	B-Language
programs	I-Language
with	O
negation	B-Application
as	I-Application
failure	I-Application
.	O
</s>
<s>
This	O
is	O
one	O
of	O
several	O
standard	O
approaches	O
to	O
the	O
meaning	O
of	O
negation	O
in	O
logic	B-Language
programming	I-Language
,	O
along	O
with	O
program	O
completion	O
and	O
the	O
well-founded	B-Application
semantics	I-Application
.	O
</s>
<s>
answer	B-Application
set	I-Application
programming	I-Application
.	O
</s>
<s>
Research	O
on	O
the	O
declarative	O
semantics	B-Application
of	O
negation	O
in	O
logic	B-Language
programming	I-Language
was	O
motivated	O
by	O
the	O
fact	O
that	O
the	O
behavior	O
of	O
SLDNF	O
resolution	O
—	O
the	O
generalization	O
of	O
SLD	B-Application
resolution	I-Application
used	O
by	O
Prolog	B-Language
in	O
the	O
presence	O
of	O
negation	O
in	O
the	O
bodies	O
of	O
rules	O
—	O
does	O
not	O
fully	O
match	O
the	O
truth	O
tables	O
familiar	O
from	O
classical	O
propositional	O
logic	O
.	O
</s>
<s>
An	O
answer	O
to	O
this	O
question	O
is	O
provided	O
by	O
the	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
.	O
</s>
<s>
The	O
meaning	O
of	O
negation	O
in	O
logic	B-Language
programs	I-Language
is	O
closely	O
related	O
to	O
two	O
theories	O
of	O
nonmonotonic	O
reasoning	O
—	O
autoepistemic	B-Application
logic	I-Application
and	O
default	B-Application
logic	I-Application
.	O
</s>
<s>
The	O
discovery	O
of	O
these	O
relationships	O
was	O
a	O
key	O
step	O
towards	O
the	O
invention	O
of	O
the	O
stable	B-Application
model	I-Application
semantics	I-Application
.	O
</s>
<s>
The	O
syntax	O
of	O
autoepistemic	B-Application
logic	I-Application
uses	O
a	O
modal	O
operator	O
that	O
allows	O
us	O
to	O
distinguish	O
between	O
what	O
is	O
true	O
and	O
what	O
is	O
believed	O
.	O
</s>
<s>
Michael	O
Gelfond	O
 [ 1987 ] 	O
proposed	O
to	O
read	O
in	O
the	O
body	O
of	O
a	O
rule	O
as	O
"	O
is	O
not	O
believed	O
"	O
,	O
and	O
to	O
understand	O
a	O
rule	O
with	O
negation	O
as	O
the	O
corresponding	O
formula	O
of	O
autoepistemic	B-Application
logic	I-Application
.	O
</s>
<s>
The	O
stable	B-Application
model	I-Application
semantics	I-Application
,	O
in	O
its	O
basic	O
form	O
,	O
can	O
be	O
viewed	O
as	O
a	O
reformulation	O
of	O
this	O
idea	O
that	O
avoids	O
explicit	O
references	O
to	O
autoepistemic	B-Application
logic	I-Application
.	O
</s>
<s>
In	O
default	B-Application
logic	I-Application
,	O
a	O
default	O
is	O
similar	O
to	O
an	O
inference	O
rule	O
,	O
except	O
that	O
it	O
includes	O
,	O
besides	O
its	O
premises	O
and	O
conclusion	O
,	O
a	O
list	O
of	O
formulas	O
called	O
justifications	O
.	O
</s>
<s>
The	O
stable	B-Application
model	I-Application
semantics	I-Application
uses	O
the	O
same	O
idea	O
,	O
but	O
it	O
does	O
not	O
explicitly	O
refer	O
to	O
default	B-Application
logic	I-Application
.	O
</s>
<s>
The	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
below	O
,	O
reproduced	O
from	O
[	O
Gelfond	O
and	O
Lifschitz	O
,	O
1988 ]	O
,	O
uses	O
two	O
conventions	O
.	O
</s>
<s>
Second	O
,	O
a	O
logic	B-Language
program	I-Language
with	O
variables	O
is	O
viewed	O
as	O
shorthand	O
for	O
the	O
set	O
of	O
all	O
ground	O
instances	O
of	O
its	O
rules	O
,	O
that	O
is	O
,	O
for	O
the	O
result	O
of	O
substituting	O
variable-free	O
terms	O
for	O
variables	O
in	O
the	O
rules	O
of	O
the	O
program	O
in	O
all	O
possible	O
ways	O
.	O
</s>
<s>
If	O
does	O
not	O
contain	O
negation	O
(	O
in	O
every	O
rule	O
of	O
the	O
program	O
)	O
then	O
,	O
by	O
definition	O
,	O
the	O
only	O
stable	B-Application
model	I-Application
of	O
is	O
its	O
model	O
that	O
is	O
minimal	O
relative	O
to	O
set	O
inclusion	O
.	O
</s>
<s>
We	O
say	O
that	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
if	O
is	O
the	O
stable	B-Application
model	I-Application
of	O
the	O
reduct	O
of	O
relative	O
to	O
.	O
</s>
<s>
(	O
Since	O
the	O
reduct	O
does	O
not	O
contain	O
negation	O
,	O
its	O
stable	B-Application
model	I-Application
has	O
been	O
already	O
defined	O
.	O
)	O
</s>
<s>
As	O
the	O
term	O
"	O
stable	B-Application
model	I-Application
"	O
suggests	O
,	O
every	O
stable	B-Application
model	I-Application
of	O
is	O
a	O
model	O
of	O
.	O
</s>
<s>
(	O
Indeed	O
,	O
since	O
,	O
the	O
reduct	O
is	O
obtained	O
from	O
the	O
program	O
by	O
dropping	O
the	O
part	O
)	O
The	O
stable	B-Application
model	I-Application
of	O
the	O
reduct	O
is	O
.	O
</s>
<s>
Thus	O
after	O
computing	O
the	O
stable	B-Application
model	I-Application
of	O
the	O
reduct	O
we	O
arrived	O
at	O
the	O
same	O
set	O
that	O
we	O
started	O
with	O
.	O
</s>
<s>
Consequently	O
,	O
that	O
set	O
is	O
a	O
stable	B-Application
model	I-Application
.	O
</s>
<s>
Checking	O
in	O
the	O
same	O
way	O
the	O
other	O
15	O
sets	O
consisting	O
of	O
the	O
atoms	O
shows	O
that	O
this	O
program	O
has	O
no	O
other	O
stable	B-Application
models	I-Application
.	O
</s>
<s>
The	O
stable	B-Application
model	I-Application
of	O
the	O
reduct	O
is	O
,	O
which	O
is	O
different	O
from	O
the	O
set	O
that	O
we	O
started	O
with	O
.	O
</s>
<s>
A	O
program	O
with	O
negation	O
may	O
have	O
many	O
stable	B-Application
models	I-Application
or	O
no	O
stable	B-Application
models	I-Application
.	O
</s>
<s>
has	O
two	O
stable	B-Application
models	I-Application
,	O
.	O
</s>
<s>
has	O
no	O
stable	B-Application
models	I-Application
.	O
</s>
<s>
If	O
we	O
think	O
of	O
the	O
stable	B-Application
model	I-Application
semantics	I-Application
as	O
a	O
description	O
of	O
the	O
behavior	O
of	O
Prolog	B-Language
in	O
the	O
presence	O
of	O
negation	O
then	O
programs	O
without	O
a	O
unique	O
stable	B-Application
model	I-Application
can	O
be	O
judged	O
unsatisfactory	O
:	O
they	O
do	O
not	O
provide	O
an	O
unambiguous	O
specification	O
for	O
Prolog-style	O
query	O
answering	O
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
two	O
programs	O
above	O
are	O
not	O
reasonable	O
as	O
Prolog	B-Language
programs	O
—	O
SLDNF	O
resolution	O
does	O
not	O
terminate	O
on	O
them	O
.	O
</s>
<s>
But	O
the	O
use	O
of	O
stable	B-Application
models	I-Application
in	O
answer	B-Application
set	I-Application
programming	I-Application
provides	O
a	O
different	O
perspective	O
on	O
such	O
programs	O
.	O
</s>
<s>
In	O
that	O
programming	O
paradigm	O
,	O
a	O
given	O
search	O
problem	O
is	O
represented	O
by	O
a	O
logic	B-Language
program	I-Language
so	O
that	O
the	O
stable	B-Application
models	I-Application
of	O
the	O
program	O
correspond	O
to	O
solutions	O
.	O
</s>
<s>
Then	O
programs	O
with	O
many	O
stable	B-Application
models	I-Application
correspond	O
to	O
problems	O
with	O
many	O
solutions	O
,	O
and	O
programs	O
without	O
stable	B-Application
models	I-Application
correspond	O
to	O
unsolvable	O
problems	O
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
eight	O
queens	O
puzzle	O
has	O
92	O
solutions	O
;	O
to	O
solve	O
it	O
using	O
answer	B-Application
set	I-Application
programming	I-Application
,	O
we	O
encode	O
it	O
by	O
a	O
logic	B-Language
program	I-Language
with	O
92	O
stable	B-Application
models	I-Application
.	O
</s>
<s>
From	O
this	O
point	O
of	O
view	O
,	O
logic	B-Language
programs	I-Language
with	O
exactly	O
one	O
stable	B-Application
model	I-Application
are	O
rather	O
special	O
in	O
answer	B-Application
set	I-Application
programming	I-Application
,	O
like	O
polynomials	O
with	O
exactly	O
one	O
root	O
in	O
algebra	O
.	O
</s>
<s>
Head	O
atoms	O
If	O
an	O
atom	O
belongs	O
to	O
a	O
stable	B-Application
model	I-Application
of	O
a	O
logic	B-Language
program	I-Language
then	O
is	O
the	O
head	O
of	O
one	O
of	O
the	O
rules	O
of	O
.	O
</s>
<s>
Minimality	O
Any	O
stable	B-Application
model	I-Application
of	O
a	O
logic	B-Language
program	I-Language
is	O
minimal	O
among	O
the	O
models	O
of	O
relative	O
to	O
set	O
inclusion	O
.	O
</s>
<s>
The	O
antichain	O
property	O
If	O
and	O
are	O
stable	B-Application
models	I-Application
of	O
the	O
same	O
logic	B-Language
program	I-Language
then	O
is	O
not	O
a	O
proper	O
subset	O
of	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
set	O
of	O
stable	B-Application
models	I-Application
of	O
a	O
program	O
is	O
an	O
antichain	O
.	O
</s>
<s>
NP-completeness	O
Testing	O
whether	O
a	O
finite	O
ground	O
logic	B-Language
program	I-Language
has	O
a	O
stable	B-Application
model	I-Application
is	O
NP-complete	O
.	O
</s>
<s>
Any	O
stable	B-Application
model	I-Application
of	O
a	O
finite	O
ground	O
program	O
is	O
not	O
only	O
a	O
model	O
of	O
the	O
program	O
itself	O
,	O
but	O
also	O
a	O
model	O
of	O
its	O
completion	O
[	O
Marek	O
and	O
Subrahmanian	O
,	O
1989 ]	O
.	O
</s>
<s>
The	O
model	O
of	O
this	O
tautology	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
,	O
but	O
its	O
other	O
model	O
is	O
not	O
.	O
</s>
<s>
François	O
Fages	O
 [ 1994 ] 	O
found	O
a	O
syntactic	O
condition	O
on	O
logic	B-Language
programs	I-Language
that	O
eliminates	O
such	O
counterexamples	O
and	O
guarantees	O
the	O
stability	O
of	O
every	O
model	O
of	O
the	O
program	O
's	O
completion	O
.	O
</s>
<s>
The	O
well-founded	B-Application
model	I-Application
of	O
a	O
logic	B-Language
program	I-Language
partitions	O
all	O
ground	O
atoms	O
into	O
three	O
sets	O
:	O
true	O
,	O
false	O
and	O
unknown	O
.	O
</s>
<s>
If	O
an	O
atom	O
is	O
true	O
in	O
the	O
well-founded	B-Application
model	I-Application
of	O
then	O
it	O
belongs	O
to	O
every	O
stable	B-Application
model	I-Application
of	O
.	O
</s>
<s>
has	O
two	O
stable	B-Application
models	I-Application
,	O
and	O
.	O
</s>
<s>
Even	O
though	O
belongs	O
to	O
both	O
of	O
them	O
,	O
its	O
value	O
in	O
the	O
well-founded	B-Application
model	I-Application
is	O
unknown	O
.	O
</s>
<s>
Furthermore	O
,	O
if	O
an	O
atom	O
is	O
false	O
in	O
the	O
well-founded	B-Application
model	I-Application
of	O
a	O
program	O
then	O
it	O
does	O
not	O
belong	O
to	O
any	O
of	O
its	O
stable	B-Application
models	I-Application
.	O
</s>
<s>
Thus	O
the	O
well-founded	B-Application
model	I-Application
of	O
a	O
logic	B-Language
program	I-Language
provides	O
a	O
lower	O
bound	O
on	O
the	O
intersection	O
of	O
its	O
stable	B-Application
models	I-Application
and	O
an	O
upper	O
bound	O
on	O
their	O
union	O
.	O
</s>
<s>
In	O
the	O
context	O
of	O
logic	B-Language
programming	I-Language
,	O
this	O
idea	O
leads	O
to	O
the	O
need	O
to	O
distinguish	O
between	O
two	O
kinds	O
of	O
negation	O
—	O
negation	B-Application
as	I-Application
failure	I-Application
,	O
discussed	O
above	O
,	O
and	O
strong	O
negation	O
,	O
which	O
is	O
denoted	O
here	O
by	O
.	O
</s>
<s>
Instead	O
of	O
stable	B-Application
models	I-Application
,	O
this	O
generalization	O
uses	O
answer	B-Application
sets	I-Application
,	O
which	O
may	O
include	O
both	O
atoms	O
and	O
atoms	O
prefixed	O
with	O
strong	O
negation	O
.	O
</s>
<s>
An	O
alternative	O
approach	O
[	O
Ferraris	O
and	O
Lifschitz	O
,	O
2005 ]	O
treats	O
strong	O
negation	O
as	O
a	O
part	O
of	O
an	O
atom	O
,	O
and	O
it	O
does	O
not	O
require	O
any	O
changes	O
in	O
the	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
.	O
</s>
<s>
Coherent	O
stable	B-Application
models	I-Application
of	O
a	O
program	O
are	O
identical	O
to	O
its	O
consistent	O
answer	B-Application
sets	I-Application
in	O
the	O
sense	O
of	O
[	O
Gelfond	O
and	O
Lifschitz	O
,	O
1991 ]	O
.	O
</s>
<s>
has	O
two	O
stable	B-Application
models	I-Application
,	O
and	O
.	O
</s>
<s>
A	O
logic	B-Language
program	I-Language
with	O
strong	O
negation	O
can	O
include	O
the	O
closed	B-Application
world	I-Application
assumption	I-Application
rules	O
for	O
some	O
of	O
its	O
predicates	O
and	O
leave	O
the	O
other	O
predicates	O
in	O
the	O
realm	O
of	O
the	O
open	B-Application
world	I-Application
assumption	I-Application
.	O
</s>
<s>
We	O
can	O
now	O
extend	O
the	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
to	O
programs	O
with	O
constraints	O
.	O
</s>
<s>
Such	O
a	O
program	O
may	O
be	O
inconsistent	O
;	O
then	O
we	O
say	O
that	O
it	O
has	O
no	O
stable	B-Application
models	I-Application
.	O
</s>
<s>
If	O
such	O
a	O
program	O
is	O
consistent	O
then	O
has	O
a	O
unique	O
minimal	O
model	O
,	O
and	O
that	O
model	O
is	O
considered	O
the	O
only	O
stable	B-Application
model	I-Application
of	O
.	O
</s>
<s>
Next	O
,	O
stable	B-Application
models	I-Application
of	O
arbitrary	O
programs	O
with	O
constraints	O
are	O
defined	O
using	O
reducts	O
,	O
formed	O
in	O
the	O
same	O
way	O
as	O
in	O
the	O
case	O
of	O
traditional	O
programs	O
(	O
see	O
the	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
above	O
)	O
.	O
</s>
<s>
A	O
set	O
of	O
atoms	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
a	O
program	O
with	O
constraints	O
if	O
the	O
reduct	O
of	O
relative	O
to	O
has	O
a	O
stable	B-Application
model	I-Application
,	O
and	O
that	O
stable	B-Application
model	I-Application
equals	O
.	O
</s>
<s>
The	O
properties	O
of	O
the	O
stable	B-Application
model	I-Application
semantics	I-Application
stated	O
above	O
for	O
traditional	O
programs	O
hold	O
in	O
the	O
presence	O
of	O
constraints	O
as	O
well	O
.	O
</s>
<s>
Constraints	O
play	O
an	O
important	O
role	O
in	O
answer	B-Application
set	I-Application
programming	I-Application
because	O
adding	O
a	O
constraint	O
to	O
a	O
logic	B-Language
program	I-Language
affects	O
the	O
collection	O
of	O
stable	B-Application
models	I-Application
of	O
in	O
a	O
very	O
simple	O
way	O
:	O
it	O
eliminates	O
the	O
stable	B-Application
models	I-Application
that	O
violate	O
the	O
constraint	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
for	O
any	O
program	O
with	O
constraints	O
and	O
any	O
constraint	O
,	O
the	O
stable	B-Application
models	I-Application
of	O
can	O
be	O
characterized	O
as	O
the	O
stable	B-Application
models	I-Application
of	O
that	O
satisfy	O
.	O
</s>
<s>
To	O
extend	O
the	O
stable	B-Application
model	I-Application
semantics	I-Application
to	O
disjunctive	O
programs	O
[	O
Gelfond	O
and	O
Lifschitz	O
,	O
1991 ]	O
,	O
we	O
first	O
define	O
that	O
in	O
the	O
absence	O
of	O
negation	O
(	O
in	O
each	O
rule	O
)	O
the	O
stable	B-Application
models	I-Application
of	O
a	O
program	O
are	O
its	O
minimal	O
models	O
.	O
</s>
<s>
A	O
set	O
of	O
atoms	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
if	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
the	O
reduct	O
of	O
relative	O
to	O
.	O
</s>
<s>
The	O
program	O
above	O
has	O
one	O
more	O
stable	B-Application
model	I-Application
,	O
.	O
</s>
<s>
As	O
in	O
the	O
case	O
of	O
traditional	O
programs	O
,	O
each	O
element	O
of	O
any	O
stable	B-Application
model	I-Application
of	O
a	O
disjunctive	O
program	O
is	O
a	O
head	O
atom	O
of	O
,	O
in	O
the	O
sense	O
that	O
it	O
occurs	O
in	O
the	O
head	O
of	O
one	O
of	O
the	O
rules	O
of	O
.	O
</s>
<s>
As	O
in	O
the	O
traditional	O
case	O
,	O
the	O
stable	B-Application
models	I-Application
of	O
a	O
disjunctive	O
program	O
are	O
minimal	O
and	O
form	O
an	O
antichain	O
.	O
</s>
<s>
Testing	O
whether	O
a	O
finite	O
disjunctive	O
program	O
has	O
a	O
stable	B-Application
model	I-Application
is	O
-complete	O
[	O
and	O
Gottlob	O
,	O
1993 ]	O
.	O
</s>
<s>
David	O
Pearce	O
 [ 1997 ] 	O
and	O
Paolo	O
Ferraris	O
 [ 2005 ] 	O
showed	O
how	O
to	O
extend	O
the	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
to	O
sets	O
of	O
arbitrary	O
propositional	O
formulas	O
.	O
</s>
<s>
This	O
generalization	O
has	O
applications	O
to	O
answer	B-Application
set	I-Application
programming	I-Application
.	O
</s>
<s>
Pearce	O
's	O
formulation	O
looks	O
very	O
different	O
from	O
the	O
original	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
.	O
</s>
<s>
The	O
two	O
approaches	O
to	O
defining	O
stable	B-Application
models	I-Application
for	O
sets	O
of	O
propositional	O
formulas	O
are	O
equivalent	O
to	O
each	O
other	O
.	O
</s>
<s>
As	O
in	O
the	O
case	O
of	O
disjunctive	O
programs	O
,	O
we	O
say	O
that	O
a	O
set	O
of	O
atoms	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
if	O
is	O
minimal	O
(	O
with	O
respect	O
to	O
set	O
inclusion	O
)	O
among	O
the	O
models	O
of	O
the	O
reduct	O
of	O
relative	O
to	O
.	O
</s>
<s>
Since	O
is	O
a	O
model	O
of	O
the	O
reduct	O
,	O
and	O
the	O
proper	O
subsets	O
of	O
that	O
set	O
are	O
not	O
models	O
of	O
the	O
reduct	O
,	O
is	O
a	O
stable	B-Application
model	I-Application
of	O
the	O
given	O
set	O
of	O
formulas	O
.	O
</s>
<s>
We	O
have	O
seen	O
that	O
is	O
also	O
a	O
stable	B-Application
model	I-Application
of	O
the	O
same	O
formula	O
,	O
written	O
in	O
logic	B-Language
programming	I-Language
notation	O
,	O
in	O
the	O
sense	O
of	O
the	O
original	O
definition	O
.	O
</s>
<s>
This	O
is	O
an	O
instance	O
of	O
a	O
general	O
fact	O
:	O
in	O
application	O
to	O
a	O
set	O
of	O
(	O
formulas	O
corresponding	O
to	O
)	O
traditional	O
rules	O
,	O
the	O
definition	O
of	O
a	O
stable	B-Application
model	I-Application
according	O
to	O
Ferraris	O
is	O
equivalent	O
to	O
the	O
original	O
definition	O
.	O
</s>
<s>
The	O
theorem	O
asserting	O
that	O
all	O
elements	O
of	O
any	O
stable	B-Application
model	I-Application
of	O
a	O
program	O
are	O
head	O
atoms	O
of	O
can	O
be	O
extended	O
to	O
sets	O
of	O
propositional	O
formulas	O
,	O
if	O
we	O
define	O
head	O
atoms	O
as	O
follows	O
.	O
</s>
<s>
The	O
minimality	O
and	O
the	O
antichain	O
property	O
of	O
stable	B-Application
models	I-Application
of	O
a	O
traditional	O
program	O
do	O
not	O
hold	O
in	O
the	O
general	O
case	O
.	O
</s>
<s>
has	O
two	O
stable	B-Application
models	I-Application
,	O
and	O
.	O
</s>
<s>
Testing	O
whether	O
a	O
finite	O
set	O
of	O
propositional	O
formulas	O
has	O
a	O
stable	B-Application
model	I-Application
is	O
-complete	O
,	O
as	O
in	O
the	O
case	O
of	O
disjunctive	O
programs	O
.	O
</s>
