Clauses as logical formulas
We have used an implication arrow,
pointing to the left, to write clauses.
To explain how a collection of clauses constitutes a
logical theory, we will interprete the clauses introduced
in terms of the other logical operators:
conjunction, disjunction and negation.
When we have literals A and B we write for the conjunction
of A and B, which informally means that both A and B must
be true.
We write for the disjunction of A and B, with the informal
meaning that either one of A and B must be true.
And we write for the negation of A, which informally is true
only if A is not true.
From propositional logic we know that the implication
is true if and only if is true,
since when B is false it does not matter whether A is true.
Using the logical operators introduced above,
the general form of a clause is
[]
which, when it is written without the implication symbol,
is equivalent to
[]
that is a disjunction containing a number of positive literals ,
for i ranging from 1 to m and negative literals , for j
ranging from 1 to n.
That we may write the negation of as
is due to the equivalence
[]
which is known as the Morgan law.
The clauses that we introduced previously correspond to
disjunctive formulas in the following way:
\hspace{1.0cm}\fbox{
\begin{tabular}{r l l}
rule & \HA & \HB \\
fact & \HA & \HB A \\
goal & \HAB & \HB \\
empty & \HAB & \HB false
\end{tabular}
}
For understanding this correspondence the reader must take into account
\normalsize
that the empty conjunction, as occurs in the right hand side of
the clause representing a fact, is always true.
The empty disjunction on the other hand is always false
since, intuitively, it is not possible to choose for a true literal.
A program P is a conjunction of
program clauses.
For convenience we write such a conjunction as a collection.
We allow only Horn clauses that have only one positive literal,
the literal representing the head of a clause,
to occur in a logic program.
Practically, this is motivated by the fact that proof procedures for general
clauses are computationally very expensive.
In addition, however, Horn clause programs have pleasant model-theoretic
properties.