Fundamentals (of Definite Programs):
Syntax and Semantics
- Conclusion: resolution is a complete and effective deduction
Horn clauses (related to ``Definite programs''),
Linear, Input strategy
Breadth-first exploration of the tree (or an equivalent approach)
(possibly ordered clauses, but not required - see Selection
- Very close to what is generally referred to as SLD-resolution
- This allows to some extent realizing Greene's dream (within the
theoretical limits of the formal method), and efficiently!
- Given these results, why not use logic as a general purpose programming language? [Kowalski 74]
- A ``logic program'' would have two interpretations:
- Declarative (``LOGIC''): the logical reading
(facts, statements, knowledge)
- Procedural (``CONTROL''): what resolution does
with the program
- ALGORITHM = LOGIC + CONTROL
- Specify these components separately
- Often, worrying about control is not needed at all (thanks to
- Control can be effectively provided through the ordering of the
literals in the clauses
- All formulas are transformed into a set of Clauses.
- A clause has the form:
are literals, and are the conclusions and conditions of a rule:
- All variables are implicitly universally quantified:
(if are the variables)
- More compact than the traditional clausal form:
- no connectives, just commas
- no need to repeat negations: all negated atoms on one
side, non-negated ones on the other
- A Horn Clause then has the form:
where can be zero and possibly empty.
grandfather(X,Y) father (X,Z), mother(Z,Y).
- A rule (has head and body)
which contains variables can be read as
for all :
``head'' is true if ``goal'' and ... and ``goal'' are true
- A fact n=0 (has only head)
for all : ``head'' is true (always)
- A query (the headless clause)
can be read as:
for which are ``goal'' and ... and ``goal'' true?
- Given a first-order language , with a non-empty set of variables,
constants, function symbols, relation symbols, connectives,
and given a syntactic object ,
i.e. the set of all ``ground instances'' of .
- Given , (Herbrand universe) is the set of all
ground terms of .
- (Herbrand Base) is the set of all ground atoms of .
- Similarly, for the language associated with a given program
we define , and .
We now turn to the operational semantics of logic programs,
given by a concrete operational procedure: Linear (Input)
- Resolution step (linear, input, ...):
- given a clause and a resolvent, we can build a new
resolvent which follows from them by:
- LD-Resolution: linear (and input) resolution, applied to
Note that then all resolvents are negative Horn
clauses (like the query).
we can infer
grandfather(X,Y) father(X,Z), mother(Z,Y)
we can infer
- Prove ``grandfather(john,david) '' using the set of
- grandfather(L,M) father (L,N), father(N,M)
- grandfather(X,Y) father (X,Z), mother(Z,Y)
- We introduce the predicate to prove (negated!)
- [7.] grandfather(john,david)
- We start resolution: e.g. 6 and 7
- [8.] father(john,Z), mother(Z,david)
- using 2 and 8
- [9.] mother(mary,david) Z/mary
- using 4 and 9
- Two control-related issues are still left open in
Given a current resolvent and a set of clauses :
- A Computation (or Selection rule) is a function
which, given a resolvent (and possibly the proof tree up to that
point) returns (selects) a literal from it. This is the goal that will
be used next in the resolution process.
- A Search rule is a function which, given a literal and a
set of clauses (and possibly the proof tree up to that point), returns
a clause from the set. This is the clause that will be used next in
the resolution process.
- SLD-resolution: Linear resolution for Definite programs with
- An SLD-resolution method is given by the combination of
a computation (or selection) rule and a search rule.
- Independence of the computation rule: Completeness does not
depend on the choice of the computation rule.
- Example: a ``left-to-right'' rule (as in ordered resolution)
does not impair completeness - this coincides with the completeness
result for ordered resolution.
- Fundamental result:
``Declarative'' semantics () ``operational'' semantics
I.e., all the facts in can be deduced using SLD-resolution.
- Given a rule
it can be seen as a description of the goals the solver (resolution
method) has to execute in order to solve ``head''
- Possible, given computation and search rules.
- In general, ``In order to solve `head', solve `goal'
and ... and solve `goal' ''
- If ordered resolution is used (left-to-right computation rule),
then read ``In order to solve `head', first solve `goal'
and then `goal' and then ... and finally solve
- Thus the ``control'' part corresponding to the computation rule
is often associated with the order of the goals in the body of a
- Another part (corresponding to the search rule) is often
associated with the order of clauses
- Example - read ``procedurally'':
father(X,Y) mother(Z,Y), married(X,Z).
all subsets of
Last modification: Wed Jan 3 19:10:51 CET 2007 <email@example.com>