Simple Language: Propositional Definite Clauses
- Atom: symbol starting with lower case letter
- Body: atom or of the form
, where and are bodies - Definite clause: atom or rule of form
, where is an atom and is a body. If it has an empty body, is called an atomic clause/fact - Knowledge base: set of definite clauses
Interpretation
An interpretation assigns a truth value to each atom. Thus, there are
- Body
is true in if both and are true in - Rule
is false in if is true and is false - i.e. If
is true, must be true
- i.e. If
- Knowledge base
is true in iff every clause in is true in
Models and Logical Consequences
- Model of a set of clauses: interpretation in which all the clauses are true
- If is
a set of clauses and is a conjunction of atoms, is a logical consequence of ( ) if is true in every model of
Example:
$$
KB = \begin{cases}
p \leftarrow q,\
q,\
r \leftarrow s
\end{cases}
$$
Proof Procedures
- A possibly non-deterministic algorithm for deriving consequences of a knowledge base
- Given a proof procedure,
means can be derived from the knowledge base - A proof procedure is sound if
implies - Every consequence it finds is true
- A proof procedure is complete if
implies - All consequences are found by the procedure
Bottom-Up Proof Procedure
If
First, set
Then set
Repeat until no more clauses can be selected. (Only atomic clauses can be added to the set at the beginning).
Proof of soundness
If there is a
Thus, there must be clause of the form
Fixed Point
The
If
-
is a model of - If
in is false in . Then, is false but each is true in - Thus,
can be added to (WHY?), meaning it is not the fixed point
- Thus,
- If
-
is called a minimal model
Proof of Completeness
- Suppose
; is true in all models of - Thus,
is true in the minimal model - Thus,
is in the fixed point - Thus,
must have been generated by the bottom up algorithm - Thus,
Top-Down Procedure
Search backwards from a query to determine if it is a logical consequence of
An answer clause:
The SLD resolution of the answer clause on atom
Basically: replace the atom with its clause, repeating until no more replacements can be made.
An answer is an answer clause
Derivations
Derivation of query
-
is the answer clause -
is the answer clause obtained by resolving -
is an answer
Procedure
To solve the query
-
- Until
is an answer: - Select
atom from the body of - Choose a clause
from with as the head ( ) - Replace
with the body of
- Choose a clause
- If the clause is just a definition (e.g.
), then it does not get replaced with anything; shrinks
- Select
Either don’t-care non-determinism, in which case if a selection does not lead to a solution, there is no point in trying other alternatives, or don’t-know-non-determinism, in which other choices may lead to a solution.
A successful derivation would return
A failing derivation would return something in the form