You are on page 1of 42

Lecture 11 Inference in First Order Logic

Dr. Muhammad Adnan Hashmi

1 January 2013

Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward and backward chaining

Logic programming
Resolution
2

1 January 2013

1 January 2013

Stands for substitution

Typically a constant, which substitutes the variable

1 January 2013

Once the substitution is made, we can entail the new sentence

It should not appear elsewhere in the data base, because of the existential quantifier (i.e., there exists.). So we assume the 1 January 2013 minimum value, i.e., there exists just one

UI can be applied repeatedly to the same FOL sentence, in order to add new sentences The new KB always remains logically equivalent to the old one EI can be applied only once; and once it is applied, then the existentially quantified sentence should be removed from the KB The new KB is not logically equivalent to the old, but rather it is inferentially equivalent (You replace the existentially quantified sentence with an entailed one).
6

1 January 2013

1 January 2013

For convenience, each one of these can be replaced by one symbol, e.g., A, B, C etc.

1 January 2013

This depth refers to the level of nesting of the functional terms in the FOL DB

1 January 2013

Unification is all about finding substitutions in order to make two expressions equal

What substitution is required in order to make these two expressions equal?


1 January 2013

10

1 January 2013

11

1 January 2013

12

1 January 2013

13

1 January 2013

14

i.e., with statements of this format

Something important to remember


1 January 2013

15

The law says that it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missiles were sold to it by Colonel West, who is American. Prove that Col. West is a criminal

1 January 2013

16

1 January 2013

17

1 January 2013

18

1 January 2013

19

All the basic facts that have been derived

Start from the basic facts at the bottom. Then, you go through a series of iterations; each iteration is represented by trying to go one level upward from the current one. In each iteration, we write what we can infer (using unification on implication sentences only) from the bottom level. Basically, we can infer the consequent if the premise is satisfied with 20 1 January 2013 some substitution.

First Iteration (unification and reasoning is possible only on the following three implications) Substitution: {x|M1}

Substitution: {x|M1}
Substitution: {x|Nono}
1 January 2013

21

Second Iteration: Only one implication is now possible on the following rule with substitution {x|West, y|M1, z|Nono}

1 January 2013

22

Sound and complete for first-order definite clauses These are clauses in which the antecedent is a conjunction of literals and the consequent just contains one term, e.g.,

Datalog = first-order definite clauses + no functions (e.g., crime KB) FC terminates for Datalog in poly iterations; at most p.nk literals May not terminate if entailment is not possible; this is unavoidable as entailment with definite clauses is semi-decidable.
23

1 January 2013

1 January 2013

These combine logic programming and relational DBs (http://en.wikipedia.org/wiki/Deductive_database)

24

1 January 2013

3SAT stands for SATisfiability of clauses, where each clause contains 3 literals (http://en.wikipedia.org/wiki/Boolean_satisfiability_problem)

25

1 January 2013

26

Goal/query

Work backward from the goal (query), chaining through implications in order to find facts that support the goal. The algorithm returns a set of substitutions that satisfy the goal It simply considers a goal, and finds every clause in the knowledge base whose positive literal (consequent) satisfies with this goal When this condition is satisfied, a new recursive call is generated in which the antecedent of the rule is added at the next (bottom) level

1 January 2013

27

Criminal(West) can be unified with Criminal(x) with the substitution {x|West}:

We first generate the literals in the antecedent

1 January 2013

28

Criminal(West) can be unified with Criminal(x) with the substitution {x|West}:

Then, we move depth-first through the literals, making the substitution {x|West}

1 January 2013

29

Weapon(y) can be unified with the consequent Weapon(x): The difference in variables doesnt matter; the concept is the same, i.e., x or y is a weapon
1 January 2013

So we generate its antecedent, i.e., Missile(y)

30

Missile(M1) unifies with Missile(y) with {y|M1} Now, generate antecedents for Sells, and assign {z|Nono}
31

1 January 2013

With {z|Nono}, we get Hostile(Nono) Which unifies with Hostile(x)


32

1 January 2013

1 January 2013

33

1 January 2013

34

1 January 2013

35

1 January 2013

http://en.wikipedia.org/wiki/Prolog

36

1 January 2013

37

1 January 2013

38

1 January 2013

39

1 January 2013

40

In the previous slide, the squares marked in red are nothing but the consecutive goals in the backward chaining procedure. In fact, backward chaining is really just a special case of resolution, with a particular control strategy to decide which resolution to perform next.

1 January 2013

41

1 January 2013

42

You might also like