1/18
Looks like no tags are added yet.
Conjunctive Normal Form
Writing a formula as the conjunction of disjunction of literals. Each clause contains literals and disjunctions, and are conjuncted to form a more complex formula.
What to remember about CNF (corresponds to DNF too)
Only requires conjunction if joining a clause. A single clause (therefore containing disjunction and literals) can exist by itself and still be in CNF
What are the clauses in this formula?
(P V Q) ^ ¬R ^ (¬P V Q V R)
P V Q
¬R
¬P V Q V R
Implicational/Rule Form
Writing a formula only in terms of positive literals, conjunction, disjunction and implication.
What should you notice about the structure of the implicational form?
The antecedent/tail is always conjunctive whereas the consequent/head is always disjunctive.
What is a Horn clause?
A clause that has at most one positive literal (and any number of negative literals).
What is a definite clause?
A Horn clause containing exactly one positive literal.
What is a unit clause/fact?
A definite clause containing no negative literals
What is a (propositional) logic program?
An ordered list of definite Horn clauses written in implicational form

What is a (conjunctive) query? What else must you remember about them?
An ordered list of positive literals.
They are normally prefaced with a question mark to distinguish them from the rules in the logic programs.
e.g. ? Q1, Q2 … Qn
How are queries and logic programs related?
We want to decide whether a query can be proven using a logic program. This is achieved through a process called resolution.
What does the resolution procedure do?
Takes a logic program P and a query ?q as an input. The aim is to verify if ?q can be true under P, so the resolution procedure returns true of false once completed.
State the steps of the resolution procedure.
Take the first conjunct in the query.
Search for the first rule in the logic program whose consequent/head matches the conjunct. If found, replace the conjunct in the query with the corresponding antecedent/tail for its consequent/head.
Repeat these steps onto the new iterations of the query, moving along the conjuncts of the query from left to right.
If the query becomes empty, return true
Else, return false
How do we denote that a query is empty? What does this mean?
With an white square □/■
This means the query logically follows from the logic program, and that there is a successful derivation tree.
How do we denote an unsuccessful derivation? What is another way to say that the query is false?
With a black square ■
“The procedure terminates in failure”
Show that T follows logically from the following logic program and draw its derivation tree:
→ P
P → Q
P → R
Q → S
R, S → T

What is a derivation tree?
A tree generated through a resolution procedure. It looks like an upside down binary tree, where each query (besides the initial query) has two children: the preceding query and the matched rule that transformed the preceding query into it.
What do we do if there are multiple rules that can be matched to the current query, and the first one we encounter leads to failure but any subsequent ones lead to success?
Backtracking.
If the first rule leads to failure, return to the last branching point and skip over the previously matched rule. Repeat until a match that results in success is found.
Write out the full derivation tree for ?T given the following rules:
→ P
Q → R
P → R
R → T
