<s>
Logic	B-Language
programming	I-Language
is	O
a	O
programming	O
paradigm	O
which	O
is	O
largely	O
based	O
on	O
formal	O
logic	O
.	O
</s>
<s>
Any	O
program	O
written	O
in	O
a	O
logic	B-Language
programming	I-Language
language	I-Language
is	O
a	O
set	O
of	O
sentences	O
in	O
logical	O
form	O
,	O
expressing	O
facts	O
and	O
rules	O
about	O
some	O
problem	O
domain	O
.	O
</s>
<s>
Major	O
logic	B-Language
programming	I-Language
language	I-Language
families	O
include	O
Prolog	B-Language
,	O
answer	B-Application
set	I-Application
programming	I-Application
(	O
ASP	O
)	O
and	O
Datalog	B-Language
.	O
</s>
<s>
In	O
all	O
of	O
these	O
languages	O
,	O
rules	O
are	O
written	O
in	O
the	O
form	O
of	O
clauses	B-Application
:	O
</s>
<s>
In	O
the	O
simplest	O
case	O
in	O
which	O
H	O
,	O
B1	O
,	O
...	O
,	O
Bn	O
are	O
all	O
atomic	O
formulae	O
,	O
these	O
clauses	B-Application
are	O
called	O
definite	B-Application
clauses	I-Application
or	O
Horn	B-Application
clauses	I-Application
.	O
</s>
<s>
However	O
,	O
there	O
are	O
many	O
extensions	O
of	O
this	O
simple	O
case	O
,	O
the	O
most	O
important	O
one	O
being	O
the	O
case	O
in	O
which	O
conditions	O
in	O
the	O
body	O
of	O
a	O
clause	O
can	O
also	O
be	O
negations	O
of	O
atomic	B-Algorithm
formulas	I-Algorithm
.	O
</s>
<s>
Logic	B-Language
programming	I-Language
languages	I-Language
that	O
include	O
this	O
extension	O
have	O
the	O
knowledge	O
representation	O
capabilities	O
of	O
a	O
non-monotonic	O
logic	O
.	O
</s>
<s>
In	O
ASP	O
and	O
Datalog	B-Language
,	O
logic	B-Language
programs	I-Language
have	O
only	O
a	O
declarative	B-Language
reading	O
,	O
and	O
their	O
execution	O
is	O
performed	O
by	O
means	O
of	O
a	O
proof	O
procedure	O
or	O
model	O
generator	O
whose	O
behaviour	O
is	O
not	O
meant	O
to	O
be	O
controlled	O
by	O
the	O
programmer	O
.	O
</s>
<s>
However	O
,	O
in	O
the	O
Prolog	B-Language
family	O
of	O
languages	O
,	O
logic	B-Language
programs	I-Language
also	O
have	O
a	O
procedural	B-Application
interpretation	O
as	O
goal-reduction	O
procedures	O
:	O
</s>
<s>
based	O
on	O
an	O
example	O
used	O
by	O
Terry	O
Winograd	O
to	O
illustrate	O
the	O
programming	O
language	O
Planner	B-Application
.	O
</s>
<s>
As	O
a	O
clause	O
in	O
a	O
logic	B-Language
program	I-Language
,	O
it	O
can	O
be	O
used	O
both	O
as	O
a	O
procedure	O
to	O
test	O
whether	O
X	O
is	O
fallible	O
by	O
testing	O
whether	O
X	O
is	O
human	O
,	O
and	O
as	O
a	O
procedure	O
to	O
find	O
an	O
X	O
which	O
is	O
fallible	O
by	O
finding	O
an	O
X	O
which	O
is	O
human	O
.	O
</s>
<s>
Even	O
facts	O
have	O
a	O
procedural	B-Application
interpretation	O
.	O
</s>
<s>
The	O
declarative	B-Language
reading	O
of	O
logic	B-Language
programs	I-Language
can	O
be	O
used	O
by	O
a	O
programmer	O
to	O
verify	O
their	O
correctness	O
.	O
</s>
<s>
Moreover	O
,	O
logic-based	O
program	B-Application
transformation	I-Application
techniques	O
can	O
also	O
be	O
used	O
to	O
transform	O
logic	B-Language
programs	I-Language
into	O
logically	O
equivalent	O
programs	O
that	O
are	O
more	O
efficient	O
.	O
</s>
<s>
In	O
the	O
Prolog	B-Language
family	O
of	O
logic	B-Language
programming	I-Language
languages	I-Language
,	O
the	O
programmer	O
can	O
also	O
use	O
the	O
known	O
problem-solving	O
behaviour	O
of	O
the	O
execution	O
mechanism	O
to	O
improve	O
the	O
efficiency	O
of	O
programs	O
.	O
</s>
<s>
The	O
use	O
of	O
mathematical	O
logic	O
to	O
represent	O
and	O
execute	O
computer	B-Application
programs	I-Application
is	O
also	O
a	O
feature	O
of	O
the	O
lambda	B-Language
calculus	I-Language
,	O
developed	O
by	O
Alonzo	O
Church	O
in	O
the	O
1930s	O
.	O
</s>
<s>
However	O
,	O
the	O
first	O
proposal	O
to	O
use	O
the	O
clausal	B-Application
form	I-Application
of	O
logic	O
for	O
representing	O
computer	B-Application
programs	I-Application
was	O
made	O
by	O
Cordell	O
Green	O
.	O
</s>
<s>
This	O
used	O
an	O
axiomatization	O
of	O
a	O
subset	O
of	O
LISP	B-Language
,	O
together	O
with	O
a	O
representation	O
of	O
an	O
input-output	O
relation	O
,	O
to	O
compute	O
the	O
relation	O
by	O
simulating	O
the	O
execution	O
of	O
the	O
program	O
in	O
LISP	B-Language
.	O
</s>
<s>
Foster	O
and	O
Elcock	O
's	O
Absys	B-Language
,	O
on	O
the	O
other	O
hand	O
,	O
employed	O
a	O
combination	O
of	O
equations	O
and	O
lambda	B-Language
calculus	I-Language
in	O
an	O
assertional	O
programming	O
language	O
that	O
places	O
no	O
constraints	O
on	O
the	O
order	O
in	O
which	O
operations	O
are	O
performed	O
.	O
</s>
<s>
Logic	B-Language
programming	I-Language
in	O
its	O
present	O
form	O
can	O
be	O
traced	O
back	O
to	O
debates	O
in	O
the	O
late	O
1960s	O
and	O
early	O
1970s	O
about	O
declarative	B-Language
versus	O
procedural	B-Application
representations	O
of	O
knowledge	O
in	O
artificial	B-Application
intelligence	I-Application
.	I-Application
</s>
<s>
Advocates	O
of	O
declarative	B-Language
representations	O
were	O
notably	O
working	O
at	O
Stanford	O
,	O
associated	O
with	O
John	O
McCarthy	O
,	O
Bertram	O
Raphael	O
and	O
Cordell	O
Green	O
,	O
and	O
in	O
Edinburgh	O
,	O
with	O
John	O
Alan	O
Robinson	O
(	O
an	O
academic	O
visitor	O
from	O
Syracuse	O
University	O
)	O
,	O
Pat	O
Hayes	O
,	O
and	O
Robert	O
Kowalski	O
.	O
</s>
<s>
Advocates	O
of	O
procedural	B-Application
representations	O
were	O
mainly	O
centered	O
at	O
MIT	O
,	O
under	O
the	O
leadership	O
of	O
Marvin	O
Minsky	O
and	O
Seymour	O
Papert	O
.	O
</s>
<s>
Although	O
it	O
was	O
based	O
on	O
the	O
proof	O
methods	O
of	O
logic	O
,	O
Planner	B-Application
,	O
developed	O
at	O
MIT	O
,	O
was	O
the	O
first	O
language	O
to	O
emerge	O
within	O
this	O
proceduralist	O
paradigm	O
.	O
</s>
<s>
Planner	B-Application
featured	O
pattern-directed	O
invocation	O
of	O
procedural	B-Application
plans	O
from	O
goals	O
(	O
i.e.	O
</s>
<s>
The	O
most	O
influential	O
implementation	O
of	O
Planner	B-Application
was	O
the	O
subset	O
of	O
Planner	B-Application
,	O
called	O
Micro-Planner	O
,	O
implemented	O
by	O
Gerry	O
Sussman	O
,	O
Eugene	O
Charniak	O
and	O
Terry	O
Winograd	O
.	O
</s>
<s>
It	O
was	O
used	O
to	O
implement	O
Winograd	O
's	O
natural-language	B-General_Concept
understanding	I-General_Concept
program	O
SHRDLU	O
,	O
which	O
was	O
a	O
landmark	O
at	O
that	O
time	O
.	O
</s>
<s>
To	O
cope	O
with	O
the	O
very	O
limited	O
memory	O
systems	O
at	O
the	O
time	O
,	O
Planner	B-Application
used	O
a	O
backtracking	O
control	O
structure	O
so	O
that	O
only	O
one	O
possible	O
computation	O
path	O
had	O
to	O
be	O
stored	O
at	O
a	O
time	O
.	O
</s>
<s>
Planner	B-Application
gave	O
rise	O
to	O
the	O
programming	O
languages	O
QA-4	O
,	O
Popler	O
,	O
Conniver	O
,	O
QLISP	O
,	O
and	O
the	O
concurrent	O
language	O
Ether	O
.	O
</s>
<s>
Hayes	O
and	O
Kowalski	O
in	O
Edinburgh	O
tried	O
to	O
reconcile	O
the	O
logic-based	O
declarative	B-Language
approach	O
to	O
knowledge	O
representation	O
with	O
Planner	B-Application
's	O
procedural	B-Application
approach	O
.	O
</s>
<s>
Kowalski	O
,	O
on	O
the	O
other	O
hand	O
,	O
developed	O
SLD	B-Application
resolution	I-Application
,	O
a	O
variant	O
of	O
SL-resolution	B-Application
,	O
and	O
showed	O
how	O
it	O
treats	O
implications	O
as	O
goal-reduction	O
procedures	O
.	O
</s>
<s>
Kowalski	O
collaborated	O
with	O
Colmerauer	O
in	O
Marseille	O
,	O
who	O
developed	O
these	O
ideas	O
in	O
the	O
design	O
and	O
implementation	O
of	O
the	O
programming	O
language	O
Prolog	B-Language
.	O
</s>
<s>
The	O
Association	O
for	O
Logic	B-Language
Programming	I-Language
was	O
founded	O
to	O
promote	O
Logic	B-Language
Programming	I-Language
in	O
1986	O
.	O
</s>
<s>
Prolog	B-Language
gave	O
rise	O
to	O
the	O
programming	O
languages	O
ALF	B-Application
,	O
Fril	B-Language
,	O
Gödel	B-Language
,	O
Mercury	B-Operating_System
,	O
Oz	B-Language
,	O
Ciao	B-Application
,	O
Visual	B-Application
Prolog	I-Application
,	O
XSB	B-Language
,	O
and	O
λProlog	B-Language
,	O
as	O
well	O
as	O
a	O
variety	O
of	O
concurrent	B-Application
logic	I-Application
programming	I-Application
languages	I-Application
,	O
constraint	B-Application
logic	I-Application
programming	I-Application
languages	O
and	O
Datalog	B-Language
.	O
</s>
<s>
Maarten	O
van	O
Emden	O
and	O
Robert	O
Kowalski	O
defined	O
three	O
semantics	O
for	O
Horn	B-Application
clause	I-Application
logic	B-Language
programs	I-Language
,	O
model-theoretic	O
,	O
fixed-point	O
,	O
and	O
proof-theoretic	O
,	O
and	O
showed	O
that	O
they	O
are	O
equivalent	O
.	O
</s>
<s>
Logic	B-Language
programming	I-Language
can	O
be	O
viewed	O
as	O
controlled	O
deduction	O
.	O
</s>
<s>
An	O
important	O
concept	O
in	O
logic	B-Language
programming	I-Language
is	O
the	O
separation	O
of	O
programs	O
into	O
their	O
logic	O
component	O
and	O
their	O
control	O
component	O
.	O
</s>
<s>
With	O
pure	O
logic	B-Language
programming	I-Language
languages	I-Language
,	O
the	O
logic	O
component	O
alone	O
determines	O
the	O
solutions	O
produced	O
.	O
</s>
<s>
The	O
control	O
component	O
can	O
be	O
varied	O
to	O
provide	O
alternative	O
ways	O
of	O
executing	O
a	O
logic	B-Language
program	I-Language
.	O
</s>
<s>
where	O
"	O
Logic	O
"	O
represents	O
a	O
logic	B-Language
program	I-Language
and	O
"	O
Control	O
"	O
represents	O
different	O
theorem-proving	O
strategies	O
.	O
</s>
<s>
In	O
the	O
simplified	O
,	O
propositional	O
case	O
in	O
which	O
a	O
logic	B-Language
program	I-Language
and	O
a	O
top-level	O
atomic	O
goal	O
contain	O
no	O
variables	O
,	O
backward	O
reasoning	O
determines	O
an	O
and-or	B-Data_Structure
tree	I-Data_Structure
,	O
which	O
constitutes	O
the	O
search	O
space	O
for	O
solving	O
the	O
goal	O
.	O
</s>
<s>
Prolog	B-Language
uses	O
a	O
sequential	O
,	O
last-in-first-out	O
,	O
backtracking	O
strategy	O
,	O
in	O
which	O
only	O
one	O
alternative	O
and	O
one	O
sub-goal	O
is	O
considered	O
at	O
a	O
time	O
.	O
</s>
<s>
Such	O
strategies	O
are	O
used	O
,	O
for	O
example	O
,	O
in	O
concurrent	B-Application
logic	I-Application
programming	I-Application
.	O
</s>
<s>
For	O
most	O
practical	O
applications	O
,	O
as	O
well	O
as	O
for	O
applications	O
that	O
require	O
non-monotonic	O
reasoning	O
in	O
artificial	B-Application
intelligence	I-Application
,	O
Horn	B-Application
clause	I-Application
logic	B-Language
programs	I-Language
need	O
to	O
be	O
extended	O
to	O
normal	O
logic	B-Language
programs	I-Language
with	O
negative	O
conditions	O
.	O
</s>
<s>
A	O
clause	O
in	O
a	O
normal	O
logic	B-Language
program	I-Language
has	O
the	O
form	O
:	O
</s>
<s>
where	O
H	O
and	O
all	O
the	O
Ai	B-Application
and	O
Bi	O
are	O
atomic	B-Algorithm
formulas	I-Algorithm
.	O
</s>
<s>
The	O
negation	O
in	O
the	O
negative	O
literals	O
not	O
Bi	O
is	O
commonly	O
referred	O
to	O
as	O
"	O
negation	B-Application
as	I-Application
failure	I-Application
"	O
,	O
because	O
in	O
most	O
implementations	O
,	O
a	O
negative	O
condition	O
not	O
Bi	O
is	O
shown	O
to	O
hold	O
by	O
showing	O
that	O
the	O
positive	O
condition	O
Bi	O
fails	O
to	O
hold	O
.	O
</s>
<s>
Micro-Planner	O
had	O
a	O
construct	O
,	O
called	O
"	O
thnot	O
"	O
,	O
which	O
when	O
applied	O
to	O
an	O
expression	O
returns	O
the	O
value	O
true	O
if	O
(	O
and	O
only	O
if	O
)	O
the	O
evaluation	O
of	O
the	O
expression	O
fails	O
.	O
</s>
<s>
An	O
equivalent	O
operator	O
typically	O
exists	O
in	O
modern	O
Prolog	B-Language
's	O
implementations	O
.	O
</s>
<s>
This	O
operator	O
differs	O
from	O
negation	O
in	O
first-order	O
logic	O
:	O
a	O
negation	O
such	O
as	O
\+	O
X	O
==	O
1	O
fails	O
when	O
the	O
variable	O
X	O
has	O
been	O
bound	O
to	O
the	O
atom	B-Algorithm
1	O
,	O
but	O
it	O
succeeds	O
in	O
all	O
other	O
cases	O
,	O
including	O
when	O
X	O
is	O
unbound	O
.	O
</s>
<s>
This	O
makes	O
Prolog	B-Language
's	O
reasoning	O
non-monotonic	O
:	O
X	O
=	O
1	O
,	O
\+	O
X	O
==	O
1	O
always	O
fails	O
,	O
while	O
\+	O
X	O
==	O
1	O
,	O
X	O
=	O
1	O
can	O
succeed	O
,	O
binding	O
X	O
to	O
1	O
,	O
depending	O
on	O
whether	O
X	O
was	O
initially	O
bound	O
(	O
note	O
that	O
standard	O
Prolog	B-Language
executes	O
goals	O
in	O
left-to-right	O
order	O
)	O
.	O
</s>
<s>
The	O
logical	O
status	O
of	O
negation	B-Application
as	I-Application
failure	I-Application
was	O
unresolved	O
until	O
Keith	O
Clark	O
 [ 1978 ] 	O
showed	O
that	O
,	O
under	O
certain	O
natural	O
conditions	O
,	O
it	O
is	O
a	O
correct	O
(	O
and	O
sometimes	O
complete	O
)	O
implementation	O
of	O
classical	O
negation	O
with	O
respect	O
to	O
the	O
completion	O
of	O
the	O
program	O
.	O
</s>
<s>
However	O
,	O
the	O
implementation	O
of	O
negation	B-Application
as	I-Application
failure	I-Application
needs	O
only	O
the	O
if-halves	O
of	O
the	O
definitions	O
without	O
the	O
axioms	O
of	O
equality	O
.	O
</s>
<s>
The	O
notion	O
of	O
completion	O
is	O
closely	O
related	O
to	O
McCarthy	O
's	O
circumscription	B-Application
semantics	O
for	O
default	O
reasoning	O
,	O
and	O
to	O
the	O
closed	B-Application
world	I-Application
assumption	I-Application
.	O
</s>
<s>
As	O
an	O
alternative	O
to	O
the	O
completion	O
semantics	O
,	O
negation	B-Application
as	I-Application
failure	I-Application
can	O
also	O
be	O
interpreted	O
epistemically	O
,	O
as	O
in	O
the	O
stable	B-Application
model	I-Application
semantics	I-Application
of	O
answer	B-Application
set	I-Application
programming	I-Application
.	O
</s>
<s>
The	O
epistemic	O
interpretation	O
has	O
the	O
advantage	O
that	O
it	O
can	O
be	O
combined	O
very	O
simply	O
with	O
classical	O
negation	O
,	O
as	O
in	O
"	O
extended	O
logic	B-Language
programming	I-Language
"	O
,	O
to	O
formalise	O
such	O
phrases	O
as	O
"	O
the	O
contrary	O
can	O
not	O
be	O
shown	O
"	O
,	O
where	O
"	O
contrary	O
"	O
is	O
classical	O
negation	O
and	O
"	O
can	O
not	O
be	O
shown	O
"	O
is	O
the	O
epistemic	O
interpretation	O
of	O
negation	B-Application
as	I-Application
failure	I-Application
.	O
</s>
<s>
The	O
fact	O
that	O
Horn	B-Application
clauses	I-Application
can	O
be	O
given	O
a	O
procedural	B-Application
interpretation	O
and	O
,	O
vice	O
versa	O
,	O
that	O
goal-reduction	O
procedures	O
can	O
be	O
understood	O
as	O
Horn	B-Application
clauses	I-Application
+	O
backward	O
reasoning	O
means	O
that	O
logic	B-Language
programs	I-Language
combine	O
declarative	B-Language
and	O
procedural	B-Application
representations	O
of	O
knowledge	O
.	O
</s>
<s>
The	O
inclusion	O
of	O
negation	B-Application
as	I-Application
failure	I-Application
means	O
that	O
logic	B-Language
programming	I-Language
is	O
a	O
kind	O
of	O
non-monotonic	O
logic	O
.	O
</s>
<s>
Despite	O
its	O
simplicity	O
compared	O
with	O
classical	O
logic	O
,	O
this	O
combination	O
of	O
Horn	B-Application
clauses	I-Application
and	O
negation	B-Application
as	I-Application
failure	I-Application
has	O
proved	O
to	O
be	O
surprisingly	O
expressive	O
.	O
</s>
<s>
For	O
example	O
,	O
it	O
provides	O
a	O
natural	O
representation	O
for	O
the	O
common-sense	O
laws	O
of	O
cause	O
and	O
effect	O
,	O
as	O
formalised	O
by	O
both	O
the	O
situation	B-Application
calculus	I-Application
and	O
event	B-Application
calculus	I-Application
.	O
</s>
<s>
In	O
particular	O
,	O
Prakken	O
and	O
Sartor	O
credit	O
the	O
representation	O
of	O
the	O
British	O
Nationality	O
Act	O
as	O
a	O
logic	B-Language
program	I-Language
with	O
being	O
"	O
hugely	O
influential	O
for	O
the	O
development	O
of	O
computational	O
representations	O
of	O
legislation	O
,	O
showing	O
how	O
logic	B-Language
programming	I-Language
enables	O
intuitively	O
appealing	O
representations	O
that	O
can	O
be	O
directly	O
deployed	O
to	O
generate	O
automatic	O
inferences	O
"	O
.	O
</s>
<s>
The	O
programming	O
language	O
Prolog	B-Language
was	O
developed	O
in	O
1972	O
by	O
Alain	O
Colmerauer	O
.	O
</s>
<s>
Colmerauer	O
was	O
working	O
on	O
natural-language	B-General_Concept
understanding	I-General_Concept
,	O
using	O
logic	O
to	O
represent	O
semantics	O
and	O
using	O
resolution	O
for	O
question-answering	O
.	O
</s>
<s>
During	O
the	O
summer	O
of	O
1971	O
,	O
Colmerauer	O
and	O
Kowalski	O
discovered	O
that	O
the	O
clausal	B-Application
form	I-Application
of	O
logic	O
could	O
be	O
used	O
to	O
represent	O
formal	O
grammars	O
and	O
that	O
resolution	O
theorem	O
provers	O
could	O
be	O
used	O
for	O
parsing	O
.	O
</s>
<s>
They	O
observed	O
that	O
some	O
theorem	O
provers	O
,	O
like	O
hyper-resolution	O
,	O
behave	O
as	O
bottom-up	O
parsers	O
and	O
others	O
,	O
like	O
SL-resolution	B-Application
(	O
1971	O
)	O
,	O
behave	O
as	O
top-down	O
parsers	O
.	O
</s>
<s>
It	O
was	O
in	O
the	O
following	O
summer	O
of	O
1972	O
,	O
that	O
Kowalski	O
,	O
again	O
working	O
with	O
Colmerauer	O
,	O
developed	O
the	O
procedural	B-Application
interpretation	O
of	O
implications	O
.	O
</s>
<s>
It	O
also	O
became	O
clear	O
that	O
such	O
clauses	B-Application
could	O
be	O
restricted	O
to	O
definite	B-Application
clauses	I-Application
or	O
Horn	B-Application
clauses	I-Application
,	O
where	O
H	O
,	O
B1	O
,	O
...	O
,	O
Bn	O
are	O
all	O
atomic	O
predicate	O
logic	O
formulae	O
,	O
and	O
that	O
SL-resolution	B-Application
could	O
be	O
restricted	O
(	O
and	O
generalised	O
)	O
to	O
LUSH	O
or	O
SLD-resolution	B-Application
.	O
</s>
<s>
Kowalski	O
's	O
procedural	B-Application
interpretation	O
and	O
LUSH	O
were	O
described	O
in	O
a	O
1973	O
memo	O
,	O
published	O
in	O
1974	O
.	O
</s>
<s>
Colmerauer	O
,	O
with	O
Philippe	O
Roussel	O
,	O
used	O
this	O
dual	O
interpretation	O
of	O
clauses	B-Application
as	O
the	O
basis	O
of	O
Prolog	B-Language
,	O
which	O
was	O
implemented	O
in	O
the	O
summer	O
and	O
autumn	O
of	O
1972	O
.	O
</s>
<s>
The	O
first	O
Prolog	B-Language
program	O
,	O
also	O
written	O
in	O
1972	O
and	O
implemented	O
in	O
Marseille	O
,	O
was	O
a	O
French	O
question-answering	O
system	O
.	O
</s>
<s>
The	O
use	O
of	O
Prolog	B-Language
as	O
a	O
practical	O
programming	O
language	O
was	O
given	O
great	O
momentum	O
by	O
the	O
development	O
of	O
a	O
compiler	O
by	O
David	O
Warren	O
in	O
Edinburgh	O
in	O
1977	O
.	O
</s>
<s>
Experiments	O
demonstrated	O
that	O
Edinburgh	O
Prolog	B-Language
could	O
compete	O
with	O
the	O
processing	O
speed	O
of	O
other	O
symbolic	B-Application
programming	I-Application
languages	O
such	O
as	O
Lisp	B-Language
.	O
</s>
<s>
Edinburgh	O
Prolog	B-Language
became	O
the	O
de	O
facto	O
standard	O
and	O
strongly	O
influenced	O
the	O
definition	O
of	O
ISO	O
standard	O
Prolog	B-Language
.	O
</s>
<s>
Abductive	B-Application
logic	I-Application
programming	I-Application
is	O
an	O
extension	O
of	O
normal	O
Logic	B-Language
Programming	I-Language
that	O
allows	O
some	O
predicates	O
,	O
declared	O
as	O
abducible	O
predicates	O
,	O
to	O
be	O
"	O
open	O
"	O
or	O
undefined	O
.	O
</s>
<s>
A	O
clause	O
in	O
an	O
abductive	O
logic	B-Language
program	I-Language
has	O
the	O
form	O
:	O
</s>
<s>
where	O
H	O
is	O
an	O
atomic	B-Algorithm
formula	I-Algorithm
that	O
is	O
not	O
abducible	O
,	O
all	O
the	O
Bi	O
are	O
literals	O
whose	O
predicates	O
are	O
not	O
abducible	O
,	O
and	O
the	O
Ai	B-Application
are	O
atomic	B-Algorithm
formulas	I-Algorithm
whose	O
predicates	O
are	O
abducible	O
.	O
</s>
<s>
These	O
problems	O
can	O
be	O
either	O
observations	O
that	O
need	O
to	O
be	O
explained	O
(	O
as	O
in	O
classical	O
abductive	O
reasoning	O
)	O
or	O
goals	O
to	O
be	O
solved	O
(	O
as	O
in	O
normal	O
logic	B-Language
programming	I-Language
)	O
.	O
</s>
<s>
Abductive	B-Application
logic	I-Application
programming	I-Application
has	O
been	O
used	O
for	O
fault	O
diagnosis	O
,	O
planning	O
,	O
natural	O
language	O
processing	O
and	O
machine	O
learning	O
.	O
</s>
<s>
It	O
has	O
also	O
been	O
used	O
to	O
interpret	O
Negation	B-Application
as	I-Application
Failure	I-Application
as	O
a	O
form	O
of	O
abductive	O
reasoning	O
.	O
</s>
<s>
Because	O
mathematical	O
logic	O
has	O
a	O
long	O
tradition	O
of	O
distinguishing	O
between	O
object	O
language	O
and	O
metalanguage	O
,	O
logic	B-Language
programming	I-Language
also	O
allows	O
metalevel	O
programming	O
.	O
</s>
<s>
The	O
simplest	O
metalogic	O
program	O
is	O
the	O
so-called	O
"	O
vanilla	B-General_Concept
"	O
meta-interpreter	O
:	O
</s>
<s>
Metalogic	O
is	O
used	O
in	O
logic	B-Language
programming	I-Language
to	O
implement	O
metaprograms	O
,	O
which	O
manipulate	O
other	O
programs	O
,	O
databases	O
,	O
knowledge	O
bases	O
or	O
axiomatic	O
theories	O
as	O
data	O
.	O
</s>
<s>
Constraint	B-Application
logic	I-Application
programming	I-Application
combines	O
Horn	B-Application
clause	I-Application
logic	B-Language
programming	I-Language
with	O
constraint	B-Application
solving	I-Application
.	O
</s>
<s>
It	O
extends	O
Horn	B-Application
clauses	I-Application
by	O
allowing	O
some	O
predicates	O
,	O
declared	O
as	O
constraint	O
predicates	O
,	O
to	O
occur	O
as	O
literals	O
in	O
the	O
body	O
of	O
clauses	B-Application
.	O
</s>
<s>
A	O
constraint	O
logic	B-Language
program	I-Language
is	O
a	O
set	O
of	O
clauses	B-Application
of	O
the	O
form	O
:	O
</s>
<s>
where	O
H	O
and	O
all	O
the	O
Bi	O
are	O
atomic	B-Algorithm
formulas	I-Algorithm
,	O
and	O
the	O
Ci	O
are	O
constraints	O
.	O
</s>
<s>
Declaratively	O
,	O
such	O
clauses	B-Application
are	O
read	O
as	O
ordinary	O
logical	O
implications	O
:	O
</s>
<s>
However	O
,	O
whereas	O
the	O
predicates	O
in	O
the	O
heads	O
of	O
clauses	B-Application
are	O
defined	O
by	O
the	O
constraint	O
logic	B-Language
program	I-Language
,	O
the	O
predicates	O
in	O
the	O
constraints	O
are	O
predefined	O
by	O
some	O
domain-specific	O
model-theoretic	O
structure	O
or	O
theory	O
.	O
</s>
<s>
Procedurally	O
,	O
subgoals	O
whose	O
predicates	O
are	O
defined	O
by	O
the	O
program	O
are	O
solved	O
by	O
goal-reduction	O
,	O
as	O
in	O
ordinary	O
logic	B-Language
programming	I-Language
,	O
but	O
constraints	O
are	O
checked	O
for	O
satisfiability	O
by	O
a	O
domain-specific	O
constraint-solver	O
,	O
which	O
implements	O
the	O
semantics	O
of	O
the	O
constraint	O
predicates	O
.	O
</s>
<s>
The	O
following	O
constraint	O
logic	B-Language
program	I-Language
represents	O
a	O
toy	O
temporal	O
database	O
of	O
john	O
's	O
history	O
as	O
a	O
teacher	O
:	O
</s>
<s>
Constraint	B-Application
logic	I-Application
programming	I-Application
has	O
been	O
used	O
to	O
solve	O
problems	O
in	O
such	O
fields	O
as	O
civil	O
engineering	O
,	O
mechanical	O
engineering	O
,	O
digital	O
circuit	O
verification	O
,	O
automated	B-Application
timetabling	I-Application
,	O
air	B-Application
traffic	I-Application
control	I-Application
,	O
and	O
finance	O
.	O
</s>
<s>
It	O
is	O
closely	O
related	O
to	O
abductive	B-Application
logic	I-Application
programming	I-Application
.	O
</s>
<s>
Concurrent	B-Application
logic	I-Application
programming	I-Application
integrates	O
concepts	O
of	O
logic	B-Language
programming	I-Language
with	O
concurrent	B-Architecture
programming	I-Architecture
.	O
</s>
<s>
Its	O
development	O
was	O
given	O
a	O
big	O
impetus	O
in	O
the	O
1980s	O
by	O
its	O
choice	O
for	O
the	O
systems	O
programming	O
language	O
of	O
the	O
Japanese	O
Fifth	B-Device
Generation	I-Device
Project	I-Device
(	O
FGCS	O
)	O
.	O
</s>
<s>
A	O
concurrent	O
logic	B-Language
program	I-Language
is	O
a	O
set	O
of	O
guarded	O
Horn	B-Application
clauses	I-Application
of	O
the	O
form	O
:	O
</s>
<s>
The	O
conjunction	O
G1	O
,	O
...	O
,	O
Gn	O
is	O
called	O
the	O
guard	B-Language
of	O
the	O
clause	O
,	O
and	O
|	O
is	O
the	O
commitment	O
operator	O
.	O
</s>
<s>
Declaratively	O
,	O
guarded	O
Horn	B-Application
clauses	I-Application
are	O
read	O
as	O
ordinary	O
logical	O
implications	O
:	O
</s>
<s>
However	O
,	O
procedurally	O
,	O
when	O
there	O
are	O
several	O
clauses	B-Application
whose	O
heads	O
H	O
match	O
a	O
given	O
goal	O
,	O
then	O
all	O
of	O
the	O
clauses	B-Application
are	O
executed	O
in	O
parallel	O
,	O
checking	O
whether	O
their	O
guards	O
G1	O
,	O
...	O
,	O
Gn	O
hold	O
.	O
</s>
<s>
If	O
the	O
guards	O
of	O
more	O
than	O
one	O
clause	O
hold	O
,	O
then	O
a	O
committed	O
choice	O
is	O
made	O
to	O
one	O
of	O
the	O
clauses	B-Application
,	O
and	O
execution	O
proceeds	O
with	O
the	O
subgoals	O
B1	O
,	O
...	O
,	O
Bn	O
of	O
the	O
chosen	O
clause	O
.	O
</s>
<s>
Thus	O
concurrent	B-Application
logic	I-Application
programming	I-Application
implements	O
a	O
form	O
of	O
"	O
do	O
n't	O
care	O
nondeterminism	O
"	O
,	O
rather	O
than	O
"	O
do	O
n't	O
know	O
nondeterminism	O
"	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
concurrent	O
logic	B-Language
program	I-Language
defines	O
a	O
predicate	O
shuffle(Left, Right, Merge )	O
,	O
which	O
can	O
be	O
used	O
to	O
shuffle	O
two	O
lists	O
Left	O
and	O
Right	O
,	O
combining	O
them	O
into	O
a	O
single	O
list	O
Merge	O
that	O
preserves	O
the	O
ordering	O
of	O
the	O
two	O
lists	O
Left	O
and	O
Right	O
:	O
</s>
<s>
Here	O
,	O
 [  ] 	O
represents	O
the	O
empty	O
list	O
,	O
and	O
[	O
Head	O
|	O
Tail ]	O
represents	O
a	O
list	O
with	O
first	O
element	O
Head	O
followed	O
by	O
list	O
Tail	O
,	O
as	O
in	O
Prolog	B-Language
.	O
</s>
<s>
(	O
Notice	O
that	O
the	O
first	O
occurrence	O
of	O
|	O
in	O
the	O
second	O
and	O
third	O
clauses	B-Application
is	O
the	O
list	O
constructor	O
,	O
whereas	O
the	O
second	O
occurrence	O
of	O
|	O
is	O
the	O
commitment	O
operator	O
.	O
)	O
</s>
<s>
Arguably	O
,	O
concurrent	B-Application
logic	I-Application
programming	I-Application
is	O
based	O
on	O
message	O
passing	O
,	O
so	O
it	O
is	O
subject	O
to	O
the	O
same	O
indeterminacy	O
as	O
other	O
concurrent	O
message-passing	O
systems	O
,	O
such	O
as	O
Actors	B-Application
(	O
see	O
Indeterminacy	B-Application
in	I-Application
concurrent	I-Application
computation	I-Application
)	O
.	O
</s>
<s>
Carl	O
Hewitt	O
has	O
argued	O
that	O
concurrent	B-Application
logic	I-Application
programming	I-Application
is	O
not	O
based	O
on	O
logic	O
in	O
his	O
sense	O
that	O
computational	O
steps	O
cannot	O
be	O
logically	O
deduced	O
.	O
</s>
<s>
However	O
,	O
in	O
concurrent	B-Application
logic	I-Application
programming	I-Application
,	O
any	O
result	O
of	O
a	O
terminating	O
computation	O
is	O
a	O
logical	O
consequence	O
of	O
the	O
program	O
,	O
and	O
any	O
partial	O
result	O
of	O
a	O
partial	O
computation	O
is	O
a	O
logical	O
consequence	O
of	O
the	O
program	O
and	O
the	O
residual	O
goal	O
(	O
process	O
network	O
)	O
.	O
</s>
<s>
Concurrent	B-Application
constraint	I-Application
logic	I-Application
programming	I-Application
combines	O
concurrent	B-Application
logic	I-Application
programming	I-Application
and	O
constraint	B-Application
logic	I-Application
programming	I-Application
,	O
using	O
constraints	O
to	O
control	O
concurrency	B-Architecture
.	O
</s>
<s>
A	O
clause	O
can	O
contain	O
a	O
guard	B-Language
,	O
which	O
is	O
a	O
set	O
of	O
constraints	O
that	O
may	O
block	O
the	O
applicability	O
of	O
the	O
clause	O
.	O
</s>
<s>
When	O
the	O
guards	O
of	O
several	O
clauses	B-Application
are	O
satisfied	O
,	O
concurrent	B-Application
constraint	I-Application
logic	I-Application
programming	I-Application
makes	O
a	O
committed	O
choice	O
to	O
use	O
only	O
one	O
.	O
</s>
<s>
Inductive	B-Application
logic	I-Application
programming	I-Application
is	O
concerned	O
with	O
generalizing	O
positive	O
and	O
negative	O
examples	O
in	O
the	O
context	O
of	O
background	O
knowledge	O
:	O
machine	O
learning	O
of	O
logic	B-Language
programs	I-Language
.	O
</s>
<s>
Recent	O
work	O
in	O
this	O
area	O
,	O
combining	O
logic	B-Language
programming	I-Language
,	O
learning	O
and	O
probability	O
,	O
has	O
given	O
rise	O
to	O
the	O
new	O
field	O
of	O
statistical	B-Algorithm
relational	I-Algorithm
learning	I-Algorithm
and	O
probabilistic	B-Application
inductive	I-Application
logic	I-Application
programming	I-Application
.	O
</s>
<s>
Several	O
researchers	O
have	O
extended	O
logic	B-Language
programming	I-Language
with	O
higher-order	B-Application
programming	I-Application
features	O
derived	O
from	O
higher-order	B-Algorithm
logic	I-Algorithm
,	O
such	O
as	O
predicate	O
variables	O
.	O
</s>
<s>
Such	O
languages	O
include	O
the	O
Prolog	B-Language
extensions	O
HiLog	B-Language
and	O
λProlog	B-Language
.	O
</s>
<s>
Basing	O
logic	B-Language
programming	I-Language
within	O
linear	O
logic	O
has	O
resulted	O
in	O
the	O
design	O
of	O
logic	B-Language
programming	I-Language
languages	I-Language
that	O
are	O
considerably	O
more	O
expressive	O
than	O
those	O
based	O
on	O
classical	O
logic	O
.	O
</s>
<s>
Horn	B-Application
clause	I-Application
programs	O
can	O
only	O
represent	O
state	O
change	O
by	O
the	O
change	O
in	O
arguments	O
to	O
predicates	O
.	O
</s>
<s>
In	O
linear	O
logic	B-Language
programming	I-Language
,	O
one	O
can	O
use	O
the	O
ambient	O
linear	O
logic	O
to	O
support	O
state	O
change	O
.	O
</s>
<s>
Some	O
early	O
designs	O
of	O
logic	B-Language
programming	I-Language
languages	I-Language
based	O
on	O
linear	O
logic	O
include	O
LO	O
,	O
Lolli	O
,	O
ACL	O
,	O
and	O
Forum	O
.	O
</s>
<s>
F-logic	B-Language
extends	O
logic	B-Language
programming	I-Language
with	O
objects	O
and	O
the	O
frame	O
syntax	O
.	O
</s>
<s>
Logtalk	B-Language
extends	O
the	O
Prolog	B-Language
programming	I-Language
language	I-Language
with	O
support	O
for	O
objects	O
,	O
protocols	O
,	O
and	O
other	O
OOP	O
concepts	O
.	O
</s>
<s>
It	O
supports	O
most	O
standard-compliant	O
Prolog	B-Language
systems	O
as	O
backend	O
compilers	O
.	O
</s>
<s>
Transaction	B-Language
logic	I-Language
is	O
an	O
extension	O
of	O
logic	B-Language
programming	I-Language
with	O
a	O
logical	O
theory	O
of	O
state-modifying	O
updates	O
.	O
</s>
<s>
It	O
has	O
both	O
a	O
model-theoretic	O
semantics	O
and	O
a	O
procedural	B-Application
one	O
.	O
</s>
<s>
An	O
implementation	O
of	O
a	O
subset	O
of	O
Transaction	B-Language
logic	I-Language
is	O
available	B-Language
in	O
the	O
Flora-2	B-Language
system	O
.	O
</s>
<s>
Other	O
prototypes	O
are	O
also	O
available	B-Language
.	O
</s>
