<s>
SLD	B-Application
resolution	I-Application
(	O
Selective	O
Linear	O
Definite	B-Application
clause	I-Application
resolution	O
)	O
is	O
the	O
basic	O
inference	O
rule	O
used	O
in	O
logic	B-Language
programming	I-Language
.	O
</s>
<s>
It	O
is	O
a	O
refinement	O
of	O
resolution	O
,	O
which	O
is	O
both	O
sound	O
and	O
refutation	O
complete	O
for	O
Horn	B-Application
clauses	I-Application
.	O
</s>
<s>
with	O
selected	O
literal	O
,	O
and	O
an	O
input	O
definite	B-Application
clause	I-Application
:	O
</s>
<s>
whose	O
positive	O
literal	O
(	O
atom	O
)	O
unifies	B-Algorithm
with	O
the	O
atom	O
of	O
the	O
selected	O
literal	O
,	O
SLD	B-Application
resolution	I-Application
derives	O
another	O
goal	O
clause	O
,	O
in	O
which	O
the	O
selected	O
literal	O
is	O
replaced	O
by	O
the	O
negative	O
literals	O
of	O
the	O
input	O
clause	O
and	O
the	O
unifying	O
substitution	O
is	O
applied	O
:	O
</s>
<s>
The	O
name	O
"	O
SLD	B-Application
resolution	I-Application
"	O
was	O
given	O
by	O
Maarten	O
van	O
Emden	O
for	O
the	O
unnamed	O
inference	O
rule	O
introduced	O
by	O
Robert	O
Kowalski	O
.	O
</s>
<s>
"	O
SLD	O
"	O
stands	O
for	O
"	O
SL	O
resolution	O
with	O
Definite	B-Application
clauses	I-Application
"	O
.	O
</s>
<s>
In	O
the	O
simplest	O
case	O
,	O
such	O
a	O
last-in-first-out	B-Application
selection	O
function	O
can	O
be	O
specified	O
by	O
the	O
order	O
in	O
which	O
literals	O
are	O
written	O
,	O
as	O
in	O
Prolog	B-Language
.	O
</s>
<s>
However	O
,	O
the	O
selection	O
function	O
in	O
SLD	B-Application
resolution	I-Application
is	O
more	O
general	O
than	O
in	O
SL	O
resolution	O
and	O
in	O
Prolog	B-Language
.	O
</s>
<s>
In	O
logic	B-Language
programming	I-Language
,	O
however	O
,	O
an	O
SLD	O
refutation	O
also	O
has	O
a	O
computational	O
interpretation	O
.	O
</s>
<s>
SLD	B-Application
resolution	I-Application
implicitly	O
defines	O
a	O
search	B-Data_Structure
tree	I-Data_Structure
of	O
alternative	O
computations	O
,	O
in	O
which	O
the	O
initial	O
goal	O
clause	O
is	O
associated	O
with	O
the	O
root	O
of	O
the	O
tree	O
.	O
</s>
<s>
For	O
every	O
node	O
in	O
the	O
tree	O
and	O
for	O
every	O
definite	B-Application
clause	I-Application
in	O
the	O
program	O
whose	O
positive	O
literal	O
unifies	B-Algorithm
with	O
the	O
selected	O
literal	O
in	O
the	O
goal	O
clause	O
associated	O
with	O
the	O
node	O
,	O
there	O
is	O
a	O
child	O
node	O
associated	O
with	O
the	O
goal	O
clause	O
obtained	O
by	O
SLD	B-Application
resolution	I-Application
.	O
</s>
<s>
It	O
is	O
a	O
failure	O
node	O
if	O
its	O
associated	O
goal	O
clause	O
is	O
non-empty	O
but	O
its	O
selected	O
literal	O
unifies	B-Algorithm
with	O
no	O
positive	O
literal	O
of	O
definite	B-Application
clauses	I-Application
in	O
the	O
program	O
.	O
</s>
<s>
SLD	B-Application
resolution	I-Application
is	O
non-deterministic	O
in	O
the	O
sense	O
that	O
it	O
does	O
not	O
determine	O
the	O
search	O
strategy	O
for	O
exploring	O
the	O
search	B-Data_Structure
tree	I-Data_Structure
.	O
</s>
<s>
Prolog	B-Language
searches	O
the	O
tree	O
depth-first	B-Algorithm
,	O
one	O
branch	O
at	O
a	O
time	O
,	O
using	O
backtracking	O
when	O
it	O
encounters	O
a	O
failure	O
node	O
.	O
</s>
<s>
Depth-first	B-Algorithm
search	I-Algorithm
is	O
very	O
efficient	O
in	O
its	O
use	O
of	O
computing	O
resources	O
,	O
but	O
is	O
incomplete	O
if	O
the	O
search	O
space	O
contains	O
infinite	O
branches	O
and	O
the	O
search	O
strategy	O
searches	O
these	O
in	O
preference	O
to	O
finite	O
branches	O
:	O
the	O
computation	O
does	O
not	O
terminate	O
.	O
</s>
<s>
Other	O
search	O
strategies	O
,	O
including	O
breadth-first	B-Algorithm
,	O
best-first	B-Algorithm
,	O
and	O
branch-and-bound	B-Algorithm
search	O
are	O
also	O
possible	O
.	O
</s>
<s>
SLD	B-Application
resolution	I-Application
is	O
also	O
non-deterministic	O
in	O
the	O
sense	O
,	O
mentioned	O
earlier	O
,	O
that	O
the	O
selection	O
rule	O
is	O
not	O
determined	O
by	O
the	O
inference	O
rule	O
,	O
but	O
is	O
determined	O
by	O
a	O
separate	O
decision	O
procedure	O
,	O
which	O
can	O
be	O
sensitive	O
to	O
the	O
dynamics	O
of	O
the	O
program	O
execution	O
process	O
.	O
</s>
<s>
The	O
SLD	B-Application
resolution	I-Application
search	O
space	O
is	O
an	O
or-tree	O
,	O
in	O
which	O
different	O
branches	O
represent	O
alternative	O
computations	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
propositional	O
logic	B-Language
programs	I-Language
,	O
SLD	O
can	O
be	O
generalised	O
so	O
that	O
the	O
search	O
space	O
is	O
an	O
and-or	B-Data_Structure
tree	I-Data_Structure
,	O
whose	O
nodes	O
are	O
labelled	O
by	O
single	O
literals	O
,	O
representing	O
subgoals	O
,	O
and	O
nodes	O
are	O
joined	O
either	O
by	O
conjunction	O
or	O
by	O
disjunction	O
.	O
</s>
<s>
In	O
the	O
general	O
case	O
,	O
where	O
conjoint	O
subgoals	O
share	O
variables	O
,	O
the	O
and-or	B-Data_Structure
tree	I-Data_Structure
representation	O
is	O
more	O
complicated	O
.	O
</s>
<s>
Given	O
the	O
logic	B-Language
program	I-Language
:	O
</s>
<s>
In	O
Prolog	B-Language
,	O
if	O
this	O
clause	O
were	O
added	O
to	O
the	O
front	O
of	O
the	O
original	O
program	O
,	O
then	O
Prolog	B-Language
would	O
use	O
the	O
order	O
in	O
which	O
the	O
clauses	O
are	O
written	O
to	O
determine	O
the	O
order	O
in	O
which	O
the	O
branches	O
of	O
the	O
search	O
space	O
are	O
investigated	O
.	O
</s>
<s>
Prolog	B-Language
would	O
try	O
this	O
new	O
branch	O
first	O
,	O
fail	O
,	O
and	O
then	O
backtrack	O
to	O
investigate	O
the	O
single	O
branch	O
of	O
the	O
original	O
program	O
and	O
succeed	O
.	O
</s>
<s>
were	O
now	O
added	O
to	O
the	O
program	O
,	O
then	O
the	O
search	B-Data_Structure
tree	I-Data_Structure
would	O
contain	O
an	O
infinite	O
branch	O
.	O
</s>
<s>
If	O
this	O
clause	O
were	O
tried	O
first	O
,	O
then	O
Prolog	B-Language
would	O
go	O
into	O
an	O
infinite	O
loop	O
and	O
not	O
find	O
the	O
successful	O
branch	O
.	O
</s>
<s>
SLDNF	O
is	O
an	O
extension	O
of	O
SLD	B-Application
resolution	I-Application
to	O
deal	O
with	O
negation	B-Application
as	I-Application
failure	I-Application
.	O
</s>
<s>
In	O
SLDNF	O
,	O
goal	O
clauses	O
can	O
contain	O
negation	B-Application
as	I-Application
failure	I-Application
literals	O
,	O
say	O
of	O
the	O
form	O
,	O
which	O
can	O
be	O
selected	O
only	O
if	O
they	O
contain	O
no	O
variables	O
.	O
</s>
