Week 03: Propositions and Inference

Simple Language: Propositional Definite Clauses

Interpretation

An interpretation assigns a truth value to each atom. Thus, there are 2num_atoms2^{num\_atoms} possible interpretations.

Models and Logical Consequences

Example: $$ KB = \begin{cases} p \leftarrow q,\ q,\ r \leftarrow s \end{cases} $$ m=(p=true,q=true,r=false,s=false)m = (p = true, q = true, r = false, s = false) would be a model of KBKB.

Proof Procedures

Bottom-Up Proof Procedure

If hb1bmh \leftarrow b_1 \land \cdots \land b_m is a clause in the knowledge base and each bib_i has been derived (all are consequences), then can be derived. This method is called forward chaining.

First, set c:={}c:=\{\}. Then, select a clause h  b1bmh \leftarrow \; b_1 \land \cdots \land b_m in KBKB such that:

Then set C:=C{h}C := C \cup \{h\}.

Repeat until no more clauses can be selected. (Only atomic clauses can be added to the set at the beginning).

KBgKB \vdash g if gCg \in C at the end of the procedure.

Proof of soundness

If there is a gg such that KBgKB \vdash g but KBgKB \nvDash g, there must be some atoms added to CC which aren’t true in every model of KBKB. Call the first such atom hh.

Thus, there must be clause of the form hb2bmh \leftarrow b_2 \land \dots \land b_m . As hh is the first wrong atom, each bib_i must be true in some interpretation II. Thus, this clause must be false in II; thus, cannot be a model of KBKB.

Fixed Point

The CC generated at the end of the bottom-up algorithm is called a fixed point.

If II is the interpretation in which every element of the fixed point is true, and every other atom is false:

Proof of Completeness

Top-Down Procedure

Search backwards from a query to determine if it is a logical consequence of KBKB (i.e. asking if an atom is true).

An answer clause: yesa1amyes \leftarrow a_1 \land \dots \land a_m.

The SLD resolution of the answer clause on atom aia_i with the clause aib1bpa_i \leftarrow b_1 \land \dots \land b_p is another answer clause:

yes  a1ai1b1bpai+1am yes \leftarrow \; a_1 \land \dots \land a_{i-1} \land b_1 \land \dots \land b_p \land a_{i+1} \land \dots \land a_m

Basically: replace the atom with its clause, repeating until no more replacements can be made.

An answer is an answer clause m=0m=0 with m=0m=0; that is, the answer clause is yesyes \leftarrow.

Derivations

Derivation of query ?q1qk? q_1 \land \dots \land q_k is a sequence of answer clauses γ0,,γn\gamma_0, \dots, \gamma_n such that:

Procedure

To solve the query ?q1qk? q_1 \land \dots \land q_k:

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 ac:=yesac := yes.

A failing derivation would return something in the form ac:=yesa0anac := yes \leftarrow a_0 \land \dots \land a_n. This does not mean it cannot be derived, just that it failed. Use DFS; backtrack.