<s>
In	O
mathematical	O
logic	O
and	O
logic	B-Language
programming	I-Language
,	O
a	O
Horn	B-Application
clause	I-Application
is	O
a	O
logical	O
formula	O
of	O
a	O
particular	O
rule-like	O
form	O
which	O
gives	O
it	O
useful	O
properties	O
for	O
use	O
in	O
logic	B-Language
programming	I-Language
,	O
formal	B-Application
specification	I-Application
,	O
and	O
model	O
theory	O
.	O
</s>
<s>
Horn	B-Application
clauses	I-Application
are	O
named	O
for	O
the	O
logician	O
Alfred	O
Horn	O
,	O
who	O
first	O
pointed	O
out	O
their	O
significance	O
in	O
1951	O
.	O
</s>
<s>
A	O
Horn	B-Application
clause	I-Application
is	O
a	O
clause	B-Application
(	O
a	O
disjunction	O
of	O
literals	O
)	O
with	O
at	O
most	O
one	O
positive	O
,	O
i.e.	O
</s>
<s>
Conversely	O
,	O
a	O
disjunction	O
of	O
literals	O
with	O
at	O
most	O
one	O
negated	O
literal	O
is	O
called	O
a	O
dual-Horn	B-Application
clause	I-Application
.	O
</s>
<s>
A	O
Horn	B-Application
clause	I-Application
with	O
exactly	O
one	O
positive	O
literal	O
is	O
a	O
definite	B-Application
clause	I-Application
or	O
a	O
strict	O
Horn	B-Application
clause	I-Application
;	O
a	O
definite	B-Application
clause	I-Application
with	O
no	O
negative	O
literals	O
is	O
a	O
unit	O
clause	B-Application
,	O
and	O
a	O
unit	O
clause	B-Application
without	O
variables	O
is	O
a	O
fact	O
;	O
.	O
</s>
<s>
A	O
Horn	B-Application
clause	I-Application
without	O
a	O
positive	O
literal	O
is	O
a	O
goal	O
clause	B-Application
.	O
</s>
<s>
Note	O
that	O
the	O
empty	O
clause	B-Application
,	O
consisting	O
of	O
no	O
literals	O
(	O
which	O
is	O
equivalent	O
to	O
false	O
)	O
is	O
a	O
goal	O
clause	B-Application
.	O
</s>
<s>
These	O
three	O
kinds	O
of	O
Horn	B-Application
clauses	I-Application
are	O
illustrated	O
in	O
the	O
following	O
propositional	O
example	O
:	O
</s>
<s>
Type	O
of	O
Horn	O
clauseDisjunction	O
formImplication	O
formRead	O
intuitively	O
asDefinite	O
clause¬p	O
∨	O
¬q	O
∨	O
...	O
∨	O
¬t	O
∨	O
u	O
u	O
←	O
p	O
∧	O
q	O
∧	O
...	O
∧	O
t	O
assume	O
that	O
,	O
if	O
p	O
and	O
q	O
and	O
...	O
and	O
t	O
all	O
hold	O
,	O
then	O
also	O
u	O
holdsFactu	O
u	O
←	O
true	O
assume	O
thatu	O
holdsGoal	O
clause	B-Application
¬p	O
∨	O
¬q	O
∨	O
...	O
∨	O
¬t	O
false	O
←	O
p	O
∧	O
q	O
∧	O
...	O
∧	O
t	O
show	O
thatp	O
and	O
q	O
and	O
...	O
and	O
t	O
all	O
holdLike	O
in	O
resolution	O
theorem	B-Application
proving	I-Application
,	O
"	O
show	O
φ	O
"	O
and	O
"	O
assume	O
¬φ	O
"	O
are	O
synonymous	O
(	O
indirect	O
proof	O
)	O
;	O
they	O
both	O
correspond	O
to	O
the	O
same	O
formula	O
,	O
viz	O
.	O
</s>
<s>
All	O
variables	O
in	O
a	O
clause	B-Application
are	O
implicitly	O
universally	O
quantified	O
with	O
the	O
scope	O
being	O
the	O
entire	O
clause	B-Application
.	O
</s>
<s>
Horn	B-Application
clauses	I-Application
play	O
a	O
basic	O
role	O
in	O
constructive	O
logic	O
and	O
computational	O
logic	O
.	O
</s>
<s>
They	O
are	O
important	O
in	O
automated	B-Application
theorem	I-Application
proving	I-Application
by	O
first-order	O
resolution	O
,	O
because	O
the	O
resolvent	O
of	O
two	O
Horn	B-Application
clauses	I-Application
is	O
itself	O
a	O
Horn	B-Application
clause	I-Application
,	O
and	O
the	O
resolvent	O
of	O
a	O
goal	O
clause	B-Application
and	O
a	O
definite	B-Application
clause	I-Application
is	O
a	O
goal	O
clause	B-Application
.	O
</s>
<s>
These	O
properties	O
of	O
Horn	B-Application
clauses	I-Application
can	O
lead	O
to	O
greater	O
efficiency	O
of	O
proving	O
a	O
theorem	O
:	O
the	O
goal	O
clause	B-Application
is	O
the	O
negation	O
of	O
this	O
theorem	O
;	O
see	O
Goal	O
clause	B-Application
in	O
the	O
above	O
table	O
.	O
</s>
<s>
Propositional	O
Horn	B-Application
clauses	I-Application
are	O
also	O
of	O
interest	O
in	O
computational	O
complexity	O
.	O
</s>
<s>
The	O
problem	O
of	O
finding	O
truth-value	O
assignments	O
to	O
make	O
a	O
conjunction	O
of	O
propositional	O
Horn	B-Application
clauses	I-Application
true	O
is	O
known	O
as	O
HORNSAT	O
.	O
</s>
<s>
Note	O
that	O
the	O
unrestricted	O
Boolean	B-Algorithm
satisfiability	I-Algorithm
problem	I-Algorithm
is	O
an	O
NP-complete	O
problem	O
.	O
</s>
<s>
Horn	B-Application
clauses	I-Application
are	O
also	O
the	O
basis	O
of	O
logic	B-Language
programming	I-Language
,	O
where	O
it	O
is	O
common	O
to	O
write	O
definite	B-Application
clauses	I-Application
in	O
the	O
form	O
of	O
an	O
implication	O
:	O
</s>
<s>
In	O
fact	O
,	O
the	O
resolution	O
of	O
a	O
goal	O
clause	B-Application
with	O
a	O
definite	B-Application
clause	I-Application
to	O
produce	O
a	O
new	O
goal	O
clause	B-Application
is	O
the	O
basis	O
of	O
the	O
SLD	B-Application
resolution	I-Application
inference	O
rule	O
,	O
used	O
in	O
implementation	O
of	O
the	O
logic	B-Language
programming	I-Language
language	I-Language
Prolog	B-Language
.	O
</s>
<s>
In	O
logic	B-Language
programming	I-Language
,	O
a	O
definite	B-Application
clause	I-Application
behaves	O
as	O
a	O
goal-reduction	O
procedure	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
Horn	B-Application
clause	I-Application
written	O
above	O
behaves	O
as	O
the	O
procedure	O
:	O
</s>
<s>
To	O
emphasize	O
this	O
reverse	O
use	O
of	O
the	O
clause	B-Application
,	O
it	O
is	O
often	O
written	O
in	O
the	O
reverse	O
form	O
:	O
</s>
<s>
In	O
Prolog	B-Language
this	O
is	O
written	O
as	O
:	O
</s>
<s>
In	O
logic	B-Language
programming	I-Language
,	O
computation	O
and	O
query	O
evaluation	O
are	O
performed	O
by	O
representing	O
the	O
negation	O
of	O
a	O
problem	O
to	O
be	O
solved	O
as	O
a	O
goal	O
clause	B-Application
.	O
</s>
<s>
is	O
represented	O
by	O
negating	O
the	O
problem	O
(	O
denying	O
that	O
it	O
has	O
a	O
solution	O
)	O
,	O
and	O
representing	O
it	O
in	O
the	O
logically	O
equivalent	O
form	O
of	O
a	O
goal	O
clause	B-Application
:	O
</s>
<s>
In	O
Prolog	B-Language
this	O
is	O
written	O
as	O
:	O
</s>
<s>
Solving	O
the	O
problem	O
amounts	O
to	O
deriving	O
a	O
contradiction	O
,	O
which	O
is	O
represented	O
by	O
the	O
empty	O
clause	B-Application
(	O
or	O
"	O
false	O
"	O
)	O
.	O
</s>
<s>
The	O
solution	O
of	O
the	O
problem	O
is	O
a	O
substitution	O
of	O
terms	O
for	O
the	O
variables	O
in	O
the	O
goal	O
clause	B-Application
,	O
which	O
can	O
be	O
extracted	O
from	O
the	O
proof	O
of	O
contradiction	O
.	O
</s>
<s>
Used	O
in	O
this	O
way	O
,	O
goal	O
clauses	O
are	O
similar	O
to	O
conjunctive	O
queries	O
in	O
relational	O
databases	O
,	O
and	O
Horn	B-Application
clause	I-Application
logic	O
is	O
equivalent	O
in	O
computational	O
power	O
to	O
a	O
universal	O
Turing	O
machine	O
.	O
</s>
<s>
The	O
Prolog	B-Language
notation	O
is	O
actually	O
ambiguous	O
,	O
and	O
the	O
term	O
“	O
goal	O
clause	B-Application
”	O
is	O
sometimes	O
also	O
used	O
ambiguously	O
.	O
</s>
<s>
The	O
variables	O
in	O
a	O
goal	O
clause	B-Application
can	O
be	O
read	O
as	O
universally	O
or	O
existentially	O
quantified	O
,	O
and	O
deriving	O
“	O
false	O
”	O
can	O
be	O
interpreted	O
either	O
as	O
deriving	O
a	O
contradiction	O
or	O
as	O
deriving	O
a	O
successful	O
solution	O
of	O
the	O
problem	O
to	O
be	O
solved	O
.	O
</s>
<s>
Van	O
Emden	O
and	O
Kowalski	O
(	O
1976	O
)	O
investigated	O
the	O
model-theoretic	O
properties	O
of	O
Horn	B-Application
clauses	I-Application
in	O
the	O
context	O
of	O
logic	B-Language
programming	I-Language
,	O
showing	O
that	O
every	O
set	O
of	O
definite	B-Application
clauses	I-Application
D	O
has	O
a	O
unique	O
minimal	O
model	O
M	O
.	O
An	O
atomic	O
formula	O
A	O
is	O
logically	O
implied	O
by	O
D	O
if	O
and	O
only	O
if	O
A	O
is	O
true	O
in	O
M	O
.	O
It	O
follows	O
that	O
a	O
problem	O
P	O
represented	O
by	O
an	O
existentially	O
quantified	O
conjunction	O
of	O
positive	O
literals	O
is	O
logically	O
implied	O
by	O
D	O
if	O
and	O
only	O
if	O
P	O
is	O
true	O
in	O
M	O
.	O
The	O
minimal	O
model	O
semantics	O
of	O
Horn	B-Application
clauses	I-Application
is	O
the	O
basis	O
for	O
the	O
stable	B-Application
model	I-Application
semantics	I-Application
of	O
logic	B-Language
programs	I-Language
.	O
</s>
