0% found this document useful (0 votes)
6 views

5. First-Order-Logic

The document discusses First Order Logic (FOL) as a formal language for knowledge representation and reasoning, detailing its syntax, semantics, and rules of inference. It explains the structure of sentences, the role of predicates and individuals, and how to interpret logical statements within a defined domain. Additionally, it highlights the importance of quantifiers and the process of deducing truths from given premises using logical operators and relations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

5. First-Order-Logic

The document discusses First Order Logic (FOL) as a formal language for knowledge representation and reasoning, detailing its syntax, semantics, and rules of inference. It explains the structure of sentences, the role of predicates and individuals, and how to interpret logical statements within a defined domain. Additionally, it highlights the importance of quantifiers and the process of deducing truths from given premises using logical operators and relations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Knowledge Representation

and
Reasoning

First Order Logic

Deepak Khemani
Plaksha University
Sentences, Denotation, and Truth
• A logic is a formal language that defines a set of sentences
{𝛂, 𝛃, 𝛄 …}
• Each sentence has a meaning, ascribed from outside.
• Each sentence has a truth value, ascribed from outside
• Compound sentences have truth values that are determined
completely by its constituents and logical operators
• Logic has a notion of Entailment
• Logic also has Rules of Inference
• Logic has a machinery or algorithms for producing new
sentences from old by applying the rules of inference
• The goal of building the machinery is to mechanically produce
all and only the true sentences (conclusions) – given a set of
true sentences (axioms, premises)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Deconstructing Sentences
Deduction is possible because of connections
between constituents of sentences

(α ⊃ β) All men are mortal


α
β Socrates is a man
Modus Ponens Socrates is mortal

The form of the argument captures the connections

Propositional Logic cannot make these connections


Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Aristotelian Logic: Categories and Individuals
Aristotle was concerned with making statements about categories
- Universal Affirmation: All S are P All Men are Mortal
- Particular Affirmation: Some S are P Some Children are Tall
- Universal Denial: No S is P No Priest is Immortal
- Particular Denial: Some S are not P Some Birds are not Priests

Individuals could belong to categories. For example, “X is a P”

The Socratic Argument is one of the fourteen valid forms of the Syllogism
All Men are Mortal
Socrates is a Man
Therefore, Socrates is Mortal

See https://plato.stanford.edu/entries/aristotle-logic/
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Relations on a Domain
A Domain D or a Universe of Discourse is the ”world” of First Order Logic

Mortal Men

All men are mortal


Socrates is a man Socrates

Socrates is mortal

Categories are unary relations or subsets of D

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


First Order Logic / Predicate Calculus
• The meaning or semantics in PL was externally defined.
• The semantics of First Order Logic (FOL) is defined over a domain.
• The domain D is a set and has individuals
• Individuals may be named and identified
• Individuals maybe unknown or variables
• FOL is also called Predicate Calculus because of the use of predicates.
• Unary predicates are interpreted as subsets of the domain D
• Binary predicates are binary relations. Subsets of DxD.
• FOL is a logic that breaks down a sentence into constituents and relations
between them.
• FOL also has the vocabulary to talk of “all” and “some”

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Predicates and Individuals Dogs
Mortal
Individuals
Ted
Constants (named) – Aristotle
Variables (unknown) – X Men

X
Aristotle Rocks
Predicates
Socrates
Unary relations
Man(Socrates)
Man(Aristotle)
Man(X)
Dog(Ted)
Binary relations
Teacher(Socrates, Aristotle)
Pet(Socrates,Ted)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


First Order Logic (FOL): Syntax
The logical part of the vocabulary
• Symbols that stand for connectives or operators
• “∧”, “∨”, “¬”, and “⊃”…
• Brackets “(“, “)”, “{“, “}”…
• The constant symbols “⊥” and “⊤”.

• A set of variable symbols V = {v1, v2, v3, … }


• commonly used {x, y, z, x1, y1, z1, …}
•Quantifiers: “"” read as “for all”, and “$” read as “there exists”.
The former is the universal quantifier and
the latter the existential quantifier.
• The symbol “=” read as “equals”.
•optional: FOL with equality

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


FOL Syntax (contd)
The non-logical part of FOL vocabulary constitutes of three sets.
• A set of predicate symbols P = {P1, P2, P3, …}.
We also use the symbols {P, Q, R, …}.
More commonly we use words like “Man”, “Mortal”, “GreaterThan”.
Each symbol has an arity associated with it.
• A set of function symbols F = {f1, f2, f3, …}.
We commonly used the symbols {f, g, h…}
or words like “Successor” and “Sum”.
Each function symbol has an arity that denotes the number of
arguments it takes.
• A set of constant symbols C = {c1, c2, c3, …}.
We often used symbols like “0”, or “Socrates”, or “Darjeeling” that are
meaningful to us.

The three sets define a language L(P,F,C) or L(R,F,C)


Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Terms of L(P,F,C)

The basic constituents of FOL expressions are terms. The set of terms ℑ
of L(P,F,C) is defined as follows. The constants and the variables are
terms by definition. More terms are defined using the function symbols.

If t ∈ V then t ∈ ℑ
If t ∈ C then t ∈ ℑ
If t1, t2, …, tn ∈ ℑ and f ∈ F is an n-place function symbol
then f(t1,t2, …,tn) ∈ ℑ

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Atomic Formulas of L(P,F,C)
The set of formulas is defined using terms and predicate symbols. By default
the logical symbols “⊥” and “⊤” are also formulas. The set of well formed
formulas F of L(P,F,C) is defined as follows.
Atomic formulas A
⊥∈A
⊤∈A
If t1, t2 ∈ ℑ then (t1=t2) ∈ A
If t1, t2, …, tn∈ ℑ
and P ∈ P is an n-place predicate symbol
then P(t1,t2,…,tn) ∈ A
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Formulas of L(P,F,C)
The set of formulas of L(P,F,C) ℱ is defined as follows
If α ∈ A then α ∈ ℱ

If α ∈ ℱ then ¬α ∈ ℱ
If α, β ∈ ℱ then (α∧β) ∈ ℱ
If α, β ∈ ℱ then (α∨β) ∈ ℱ
If α, β ∈ ℱ then (α⊃β) ∈ ℱ

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Universal and Existential Quantifiers
If α ∈ ℱ and x ∈ V then "x (α) ∈ ℱ
"x (α) is read as “for all x (α)”

If α ∈ ℱ and x ∈ V then $x (α) ∈ ℱ


$x (α) is read as “there exists x (α)”

We will also use the notation (forall (x) (α)) and (exists (x) (α))
as given in the book Artificial Intelligence by Eugene
Charniak and Drew McDermott.
Makes representation for use in programs simpler.
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
List notation
Standard mathematical notation
1. "x (Man(x) É Human(x)) : all men are human beings
2. Happy(suresh) Ú Rich(suresh) : Suresh is rich or happy
3. "x (CitrusFruit(x) É ¬Human(x)) : all citrus fruits are non-human
4. $x (Man(x) Ù Bright(x)) : some men are bright

List notation (a la Charniak & McDermott, “Artificial Intelligence”)


1. (forall (x) (if (man x) (human x)))
2. (or (happy suresh) (rich suresh))
3. (forall (x) (if (citrusFruit x) (not (human x))))
4. (exists (x) (and (man x) (bright x)))
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Sentences of L(P,F,C)
A variable within the scope of a quantifier is said to be bound.

If a variable is not bound then it is free.

"x (($y Loves-to-read(x, y)) Ù Book(y))


Example: (forall (x) (and (exists (y) (loves-to-read x y)) (book y))

bound free

A formula of L(P,F,C) without free variables


is a sentence of L(P,F,C)
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
FOL: Rules of Inference
The propositional logic rules we saw earlier are valid in FOL as well. In addition we need
new rules to handle quantified statements. The two commonly used rules of inference are,

"x P(x) where a ∈ C Universal Instantiation (UI)


P(a)

P(a) where a ∈ C Generalization


$x P(x)
Examples: "x (Man(x) ⊃ Mortal(x))
(Man(Socrates) ⊃ Mortal(Socrates))

(Man(Socrates) Ù Mortal(Socrates))
$x (Man(x) Ù Mortal(x))

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


FOL: Rules of Substitution

The following rules of substitution are also useful,

¬"x α ≡ $x ¬α DeMorgan’s law


¬$x α ≡ "x ¬α DeMorgan’s law
"x "y α ≡ "y "x α
$x $y α ≡ $y $x α

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Semantics (First Order Logic)
Difficult to express universal statements meaningfully in Propositional Logic.
Consider,
Alice likes mathematics and she likes stories. If she likes mathematics she likes
algebra. If she likes algebra and likes physics she will go to college. …
The statements in red colour are specific to Alice. We often want to make these
as general statements - If SOMEONE likes mathematics she likes algebra. If
SOMEONE likes algebra and likes physics she will go to college.
To make such general statements and reason with them we need the notion of
variables that FOL gives us, and the universal and existential quantifiers.
The variables take values from a domain, and thus we have the notion of
Interpretations in FOL where we choose a domain and interpret the language
L(P,F,C) over the domain.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Semantics: Interpretations for L(P,F,C)
An Interpretation ϑ = <D, I> of a FOL language L(P,F,C)
constitutes of a domain (or Universe of Discourse) D and a
mapping I from the language L to the domain D.
Each of the elements of the sets P, F and C are interpreted
over D. Each of them is understood or gets meaning from the
domain D.
Predicate symbols are mapped to relations on D
Function symbols are mapped to functions on D
Constant symbols are mapped to individuals in D
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Interpretation ϑ = <D,I> of L(P,F,C)
For every predicate symbol Q ∈ P of arity N,
I(Q) = QI where QI is the image of Q and QI Í DxDx…xD

For every function symbol f ∈ F of arity N,


I(f) = fI where fI is the image of f and fI: DxDx…xD à D

For every constant symbol c ∈ C


I(c) = cI where cI is the image of c and cI ∈ D

In addition we have an assignment A: V à D


from the set of variables of L(P,F,C) to the domain.
A(v) = vA where vA ∈ D

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Interpretation of Terms of L(P,F,C)
Terms in FOL denote elements in the domain.
A term t ∈ ℑ mapped to the element of the domain D as follows.
If t ∈ V then tIA = tA
If t ∈ C then tIA = tI
If t = f(t1,t2, …,tn) and f ∈ F then tIA = fI(t1IA, t2IA, … , tnIA)
Variables are mapped by the assignment A.
For example, x à 12
Constants are interpreted by the mapping I.
For example, sifar à 0
Functions denote elements too.
For example, plus(3,8) à 11
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Interpretations
Consider the following KB
{(O A B), (O B C), (not (M A)), (M C)}
or {O(A, B), O(B, C), ¬M(A), ¬M(C)}
Where O is a binary predicate symbol
M is a unary predicate symbol
A, B and C are constant symbols

What is the above KB describing?


Observe that we have not used helpful names!
Remember – meaning lies in the mind of the beholder

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Interpretation 1 {(O A B), (O B C), (not (M A)), (M C)}
Domain: Blocks World

Predicate symbols A is not maroon


A is on B
O à On
M à Maroon
B
B is on C
C is maroon
Constant Symbols
A, B, C à blocks

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Interpretation 2 {(O A B), (O B C), (not (M A)), (M C)}
Domain: People Betty is looking at Cuthbert
Archie is looking at Betty
Predicate symbols
O à LookingAt
M à Married
Cuthbert Betty Archie
Constant Symbols
A à Archie is married is not married
B à Betty
C à Cuthbert

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Truth Assignment to Atomic Formulas of FOL
A valuation function Val: ℱ à {true, false}
Val(⊤) = true
Val(⊥) = false
Val(t1=t2) IA = true iff t1IA= t2IA
Val(Q(t1,t2,…,tn)) IA = true iff <t1IA, t2IA, … , tnIA> ∈ QI

For example,
• colour(lily) = white is true iff both refer to the same colour
• president(usa) = commander(us_army) is true iff both are the same person
• LessThan(5,17) is true iff <5,17> ∈ < relation on Natural Numbers
• Brother(suresh, ramesh) is true iff
<suresh, ramesh> ∈ Brother relation on the set of people

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Truth Assignment to Formulas of FOL
Logical connectives are interpreted in the standard way
If Val(α) = true then Val(¬α) = false
If Val(α) = false then Val(¬α) = true

If Val(α) = false and Val(β) = false then Val(α∨β) = false


else Val(α∨β) = true
If Val(α) = true and Val(β) = false then Val(α⊃β) = false
else Val(α⊃β) = true
If Val(α) = true and Val(β) = true then Val(α∧β) = true
else Val(α∧β) = false

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Truth Assignment to Quantified Formulas of FOL
A formula of the form $x(α) is true if there is some value of x for which the
formula is true. A universally quantified formula "x (α) is true for all possible
values of x. Formally,
($x (α)) IA = true iff αIB is true for some assignment B that is an x-variant of A.
In other words the formula α is true for some value of x.
("x (α)) IA = true iff αIB is true for all assignments B that are x-variants of A.
In other words the formula α is true for all values of x.

An assignment B is said to be an x-variant of an assignment A


if they agree on the value of all variables except x.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Truth Assignment to Sentences of FOL
• A sentence in FOL is a formula without any free variables.
• This means that all variables in the formula are quantified.
• As a consequence the sentences are true or false independent of the
assignment mapping.

The meaning of the terms and sentences of a set of FOL sentences is


given by an interpretation ϑ = <D, I>, where D is a domain and I is an
interpretation mapping.

An interpretation M = <D, I> of set of sentences


or a theory in a language L(P,F,C) is a model
if all the sentences in the set are true in the interpretation.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Tautologies, Satisfiable and Unsatisfiable formulas

• A tautology is a formula of L(P,F,C) that is true in all interpretations.


• For example Happy(suresh) Ú ¬ Happy(suresh)

• A formula of L(P,F,C) is satisfiable iff it is true in at least one


interpretation.
• For example "x (Man(x) É Human(x))
(depends on the meaning of Man and Human)

• A formula of L(P,F,C) is unsatisfiable iff it is true in no interpretation.


• For example Happy(suresh) Ù ¬ Happy(suresh)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Proofs

(in First Order Logic)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


FOL: Will Alice go to college?
Let us rephrase our example (Alice) problem in first order terminology.
1. Alice likes mathematics and she likes stories.
2. If someone likes mathematics she likes algebra[1].
3. If someone likes algebra and likes physics she will go to college.
4. Alice does not like stories or she likes physics.
5. Alice does not like chemistry and history.”

We can formalize the statements in FOL as follows.


1. likes(Alice, Math) ∧ likes(Alice, stories)
2.∀x(likes(x, Math) ⊃ likes(x, Algebra))
3.∀x((likes(x, Algebra) ∧ likes(x, Physics)) ⊃ goesTo(x, College))
4.¬likes(Alice, stories) ∨ likes(Alice, Physics)
5.¬likes(Alice, Chemistry) ∧ ¬likes(Alice, History)
[1] Here we must emphasize that she stands for both she and he.
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Forward Chaining

From Facts to Goals

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


The FOL Proof Natural Deduction
1. likes(Alice, Math) ∧ likes(Alice, stories)
2. ∀x(likes(x, Math) ⊃ likes(x, Algebra))
3. ∀x((likes(x, Algebra) ∧ likes(x, Physics)) ⊃ goesTo(x, College))
4. ¬likes(Alice, stories) ∨ likes(Alice, Physics)
5. ¬likes(Alice, Chemistry) ∧ ¬likes(Alice, History)
We can now generate a proof that is analogous to the proof in propositional logic.
6. likes(Alice, Math) 1, simplification
7. likes(Alice, stories) 1, simplification
8. (likes(Alice, Math) ⊃ likes(Alice, Algebra)) 2, UI
9. likes(Alice, Algebra)) 6, 8, modus ponens
10. likes(Alice, Physics) 4, 7, disjunctive syllogism
11. ((likes(Alice, Algebra) ∧ likes(Alice,Physics)) 9, 10, conjunction
12. ((likes(Alice, Algebra) ∧ likes(Alice,Physics)) ⊃ goesTo(Alice,College)) 3, UI
13. goesTo(Alice, College) 12, 11, modus ponens

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Forward Chaining in FOL
"x (P(x) ⊃ Q(x))
How does one guess
UI the value for x in UI at
this stage?

P(a) ⊃ Q(a)

MP
P(a) Q(a)

Forward chaining in FOL is a two step process.


The use of Implicit Quantifier Notation
collapses this two step inference into one step.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Implicit Quantifier notation
Prefix universally quantified variables with a “?”.
Replace existentially quantified variables not in the scope of a universal quantified
with a Skolem constant (named after the mathematician Thoralf Skolem).

1. Man(?x) É Human(?x) : all men are human beings


2. Happy(suresh) Ú Rich(suresh) : Suresh is rich or happy
3. CitrusFruit(?x) É ¬Human(?x) : all citrus fruits are non-human
4. Man(sk-11) Ù Bright(sk-11)) : some men are bright
List notation
1. (if (man ?x) (human ?x))
2. (or (happy suresh) (rich suresh))
3. (if (citrusFruit ?x) (not (human ?x)))
4. (and (man sk-11) (bright sk-11))

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Unifier: Substitution
A substitution q is a set of <variable, value> pairs each
denoting the value to be substituted for one variable.
When we apply the substitution to a formula α
the new formula is denoted by αq
A unifier for two formulas α and β is a substitution that makes
the two formulas identical. We say that α unifies with β.
A unifier q unifies a set of formulas {α1, α2, …, αN} if,
α1q = α2q = … = αNq = φ
We call the common reduced form φ the factor.
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Modified Modus Ponens (MMP)
MPP: From (a É g) and b infer gq
where q is a unifier* for a and b
and gq is the formula obtained by applying the substitution q to g.

For example,
P(?x) ⊃ Q(?x)
MMP q = {<?x, a>}
P(a) Q(a)

*A substitution q is a unifier for two (or more) formulas a and b if when applied it makes
the two formulas identical. That is, aq =bq

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


MPP: an example

Thus if
α = (Sport(tennis) ∧ Likes(Alice, tennis))
β⊃δ = (Sport(?y) ∧ Likes(?x, ?y)) ⊃ Watches(?x, ?y)

then α unifies with β


with the substitution θ = {<?x, Alice>, <?y, tennis>}
and one can infer
δθ = Watches(?x, ?y)θ = Watches(Alice, tennis)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Modified Modus Ponens (MMP) From α
and β .
(P(?x,?y) ∧ R(?y)) ⊃ Q(?x)
Q(a) Infer α∧β
P(a,?z) ∧ R(?z) Conjunction (C)
q = {<?x, a>, <?y,?z>}
P(a,?z) R(?z)

Bypassing Conjunction
Pa,?z) ∧ R(?z)

(P(?x,?y) ∧ R(?y)) ⊃ Q(?x)


P(a,?z) Q(a)

R(?z) q = {<?x, a>, <?y,?z>}


Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
A shorter proof with Modified Modus Ponens

1. likes(Alice, Math) ∧ likes(Alice, stories)


2. likes(?x, Math) ⊃ likes(?x, Algebra)
3. (likes(?x, Algebra) ∧ likes(?x, Physics)) ⊃ goesTo(?x, College)
4. ¬likes(Alice, stories) ∨ likes(Alice, Physics)
5. ¬likes(Alice, Chemistry) ∧ ¬likes(Alice, History)

6. likes(Alice, Math) 1, simplification


7. likes(Alice, stories) 1, simplification
8. likes(Alice, Algebra) 6, 2, MPP
9. likes(Alice, Physics) 4, 7, disjunctive syllogism
10. goesTo(Alice, College) 3, 8, 9, MPP

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


More general and more specific sentences
We say that a sentence α is more general than sentence β if there exists a non-empty
substitution λ such that αλ = β.

Everyone loves a good student (good-student ?x) É (loves ?y ?x)


is more general than
Everyone’s dad loves a good student (good-student ?x) É (loves (dad ?y) ?x)
and
Suresh loves a good a student (good-student ?x) É (loves suresh ?x)

A more general sentence entails a less general one


- generalized UI
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
General Inferences and Specific Inferences
(if (GreaterOrEqual ?y ?z) (SmallerOrEqual ?z ?y))

Most General Unifier


q = {<?y, ?x>, <?z, 0>} (MGU)
(GreaterOrEqual ?x 0)

Most general
conclusion
(SmallerOrEqual 0 ?x)

q = {<?x, 7>, <?y, 7>, <?z, 0>}


UI

(SmallerOrEqual 0 7)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


The Unification Algorithm
• The unification algorithm takes two or more formulas and finds the most
general unifier for the formulas
• In the list notation for formulas there are three kinds of elements
• lists
• constants
• variables
• Two constants can only unify (match) if identical
• Two lists are unified element-by-element building up the substitution as
we scan the lists.
• A variable can match another variable, or a constant, or a list not
containing the variable

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Standardizing variables apart
Consider the two formulas

(if (GreaterOrEqual 7 ?x) (SmallerOrEqual ?x 7))

(GreaterOrEqual ?x 0)

Clearly one cannot substitute ?x with both 0 and 7


Solution: Rename variables differently in each formula.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Standardizing variables apart

Solution: Rename variables differently in each formula.

(if (GreaterOrEqual 7 ?x) (SmallerOrEqual ?x 7))

(GreaterOrEqual ?z 0)

q = {<?z, 7>, <?x, 0>}

… and one can now derive the conclusion (SmallerOrEqual 0 7)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


The Unification Algorithm
Algorithm Unify returns the MGU for arg1 and arg2

Unify(arg1, arg2)
Return SubUnify(arg1, arg2, ( ))

It calls an auxiliary function SubUnify adding a third argument.


- to build the substitution q piece by piece
- initially q is the empty list

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Algorithm SubUnify (arg1, arg2, q)

1. If arg1 and arg2 are both constants they must be equal.


Do nothing (if they are not equal return NIX)
2. If arg1 is a variable, call VarUnify(arg1, arg2, q)
3. If arg2 is a variable, call VarUnify(arg2, arg1, q)
/* at this point one or both arguments must be lists */
4. If Length(arg1) ≠ Length(arg2) return NIX
5. For each corresponding element in arg1 and arg2
Call SubUnify recursively building up the substitution q

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Algorithm VarUnify(var, arg, q)

1. If var occurs* in arg return NIX


2. If var has a value <var, pat> in q
return SubUnify(pat, arg)
3. If var = arg return q
4. Return q ß {<var, arg>} È q

*Occurs check: Should not be able to unify ?x with (plus ?x 1), for example

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Unification: an example
α = (and (Sport tennis) (Likes Alice tennis))
β⊃δ = (if (and (Sport ?y) (Likes ?x ?y)) (Watches ?x ?y))

Unify(α, β) à SubUnify(α, β, ( ))
Both α and β are lists of length 3 à Call SubUnify with each element
1. SubUnify(and, and, ( )) à identical constants àθ=()

2. SubUnify((Sport tennis), (Sport ?y), ( )) à both are lists of length 2 à 2 recursive calls
1. SubUnify(Sport, Sport, ( )) à identical constants àθ=()
2. SubUnify(tennis, ?y, ( )) à Call VarUnify(?y, tennis, θ) à θ = (<?y, tennis>)

3. SubUnify((Likes Alice tennis), (Likes ?x, ?y), (<?y, tennis>)) à both are lists of length 3 à 3 recursive calls
1. SubUnify(Likes, Likes, (<?y, tennis>)) à identical constants à θ = (<?y, tennis>)
2. SubUnify(Alice, ?x, (<?y, tennis>)) à Call VarUnify(?x, Alice, θ) à θ = (<?y, tennis>, <?x, Alice>)
3. SubUnify(tennis, ?y, (<?y, tennis>, <?x, Alice>))
à Call VarUnify(?y, tennis, θ) à ?y has a value <?y, tennis) ∈ θ
à SubUnify(tennis, tennis, (<?y, tennis>, <?x, Alice>)) à identical constants
Return θ = (<?y, tennis>, <?x, Alice>)
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Unification: another example
From α = (not (CanSee ?z ?z))
and β⊃δ = (if (not (CanSee ?x (feet ?x)) (MustExercise ?x))
Can we conclude (MustExercise ?x)?

Unify(α, β) à SubUnify(α, β, ( ))
Both α and β are lists of length 2 à Call SubUnify with each element
1. SubUnify(not, not, ( )) à identical constants àθ=()

2. SubUnify(CanSee ?z ?z), (CanSee ?x (feet ?x)), ( )) à both are lists of length 3


à 3 recursive calls
1. SubUnify(CanSee, CanSee, ( )) à identical constants àθ=()
2. SubUnify(?z, ?x, ( )) à Call VarUnify(?z,?x, θ) à θ = (<?z,?x>)
3. SubUnify(?z, (feet ?x), (<?z,?x>)) à Call VarUnify(?z, (feet ?x), (<?z,?x>))
à ?z has a value <?z, ?x) ∈ θ
à SubUnify(?x, (feet ?x), (<?z,?x>)) à Occurs check ?x ∈ (feet ?x)
--> return NIX

Return NIX
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Skolemization: existentially quantified variables
When the existential quantifier is not in the scope of any universal
quantifier, then the variable it quantifies is replaced by a Skolem constant.
For example the statements,
(exists (z) (and (Student z) (Bright z)))
∃z(Student(z) ∧ Bright(z))
(exists (y) (and (Girl y) (forall (x) (if (Boy x) (Likes x y)
∃y(Girl(y) ∧ ∀x(Boy(x) ⊃ Likes(x, y)))
are skolemized as,
(and (Student sk1) (Bright sk1))
(Student(sk1) ∧ Bright(sk1))
(and (Girl sk2) (if (Boy ?x) (Likes ?x sk2)))
((Girl sk2) ∧ ((Boy ?x) ⊃ (Likes ?x, sk2)))
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Skolemization: existential variables within universal quantifiers
When the existential quantifier is in the scope of one or more universal quantifiers
then the existentially quantified variable is a Skolem function of the corresponding
universally quantified variables.
For example the statements,
(forall (x y) (exists (z) (and (LessThan x z) (LessThan y z))))
∀x ∀y ∃z (LessThan(x, z) ∧ LessThan(y, z))
(forall (x) (if (Boy x) (exists (y) (and (Girl y) (Likes x y)))))
∀x (Boy(x) ⊃ ∃y(Girl(y) ∧ Likes(x, y)))
are skolemized as,
(and (LessThan ?x (sk57 ?x ?y)) (LessThan ?y (sk57 ?x ?y)))
LessThan(?x sk57(?x ?y)) ∧ LessThan(?y sk57(?x ?y))
(if (Boy ?x) (and (Girl (sk16 ?x)) (Likes ?x (sk16 ?x))))
(Boy ?x) ⊃ (Girl(sk16 ?x) ∧ Likes(?x (sk16 ?x))))

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


FOL: Rules of Substitution Recap

The following rules of substitution are also useful,


Moving a negation operator inside changes the quantifier

¬"x α ≡ $x ¬α DeMorgan’s law


¬$x α ≡ "x ¬α DeMorgan’s law
Two quantifiers of the same type are commutative

"x "y α ≡ "y "x α


$x $y α ≡ $y $x α

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


The real nature of a variable
Whether a variable is universally quantified or existentially quantified has to be decided
carefully. One must keep in mind that a negation sign influences the nature of the quantifier.
Consider the formalization of “An immortal man does not exist”
¬∃x(Man(x) ∧ ¬Mortal(x))
What is the nature of the variable x?

On the surface it is bound by an existential quantifier so one might mistakenly skolemize


it as ¬((Man sk11) ∧ ¬(Mortal sk11)) but that only talks of a specific, albeit unspecified,
individual or individuals. The correct way to skolemize a formula is to first push the
negation sign inside. That gives us the form,
∀x¬(Man(x) ∧ ¬Mortal(x))
which is another way of saying that all men are mortal.
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
The real nature of a variable
The following sentence reads “If there exists a number that is even and odd then the
Earth is flat” and is formalized as,
∃x(Number(x) ∧ Even(x) ∧ Odd(x)) ⊃ Flat(Earth)
However if we rewrite the equivalent formulas as,

¬(∃x(Number(x) ∧ Even(x) ∧ Odd(x))) ∨ Flat(Earth)


≡ "x(¬(Number(x) ∧ Even(x) ∧ Odd(x))) ∨ Flat(Earth)
≡ "x(¬(Number(x) ∧ Even(x) ∧ Odd(x)) ∨ Flat(Earth))
≡ "x((Number(x) ∧ Even(x) ∧ Odd(x)) ⊃ Flat(Earth))

We can see that x is really a universally quantified variable.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


The real nature of a variable
The following example that asserts “A detective who has a sidekick is successful”
also illustrates the point that a quantifier in the antecedent part of an implication
statement is masquerading as the other quantifier. Variable y is universal.
∀x [(Detective(x) ∧ ∃y Sidekick(y,x)) ⊃ Successful(x)]
≡ ∀x [¬(Detective(x) ∧ ∃y Sidekick(y,x)) ∨ Successful(x)]
≡ ∀x [(¬Detective(x) ∨ ¬∃y Sidekick(y,x)) ∨ Successful(x)]
≡ ∀x [(¬Detective(x) ∨ ∀y ¬Sidekick(y,x) ∨ Successful(x)]
≡ ∀x [∀y (¬Detective(x) ∨ ¬Sidekick(y,x) ∨ Successful(x)]
≡ ∀x [∀y (¬(Detective(x) ∧ Sidekick(y,x)) ∨ Successful(x)]
≡ ∀x ∀y [(Detective(x) ∧ Sidekick(y,x)) ⊃ Successful(x)]

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Inference with a Skolem constant
In the unification algorithm the Skolem constants are simply treated as constants.
From $x Even(x)
And "x (Even(x) ⊃ ¬Odd(x))
Infer $x ¬Odd(x)
When we skolemize the premises we get,
Even (SomeEvenNumber)
Even (?x) ⊃ ¬Odd(?x)
With the substitution {?x= SomeEvenNumber } we can infer
¬Odd(SomeEvenNumber).
A constant can also be thought of as a function of arity 0.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Inference with a Skolem function
In the unification algorithm the Skolem functions are simply treated as functions.
From "x $y Loves(x,y) Everyone loves someone
And ∀x ∀y (Loves(x,y) ⊃ CaresFor(x,y))
If someone loves somebody then they care for them
Infer "x $y CaresFor(x,y) Everyone cares for someone
When we skolemise the premises we get,
Loves (?x (sk7(?x)))
Loves (?z ?y) ⊃ CaresFor (?z ?y)

Applying the substitution {?z=?x, ?y=(sk7(?x))} we get the conclusion,

CaresFor (?x (sk7(?x)))

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Rule Based Expert Systems Recap

In the 1980’s the idea that you can capture the knowledge of a human
expert in the form of rules led to the development of Expert Systems. Rule
Based Systems or Production Systems have been used in general to
decompose a problem and address it in parts. In its most abstract form a
rule or a production is a statement of the form,

Left Hand Side à Right Hand Side

in which the computation flows from the left hand side to the right hand
side, that is Forward Chaining

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Recap
Forward Chaining Rule Based Systems
Productions or rules can be used both in a forward direction and backward
direction. In the forward direction it is in a data driven manner. The
production then looks like,

Pattern à Action

where the pattern is in the given database. Thus a rule based system looks
at a part of a state, and triggers some action when a pattern is matched.
Usually the actions are to make some changes in the database describing
the state.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


An example of an OPS5 rule Recap

One could write a rule to sort an array of numbers as follows


(p interchange
(array ^index i ^value N)
(array ^index {j > i} ^value {M < N} Actions
à Not just deduction
(modify 1 ^value M) Basis of a programming language
(modify 2 ^value N))
We have used above the notation of the language OPS5 (Forgy, 1981), one of the first rule
based languages developed at Carnegie Mellon University.
(rule interchange
IF there is an element at index i with value N,
AND there is an element at index j > i with value M < N
THEN
modify array(i) to hold M,
AND modify array(j) to hold N)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


XCON
Originally called R1[1] the XCON system was a forward chaining rule based system to help
automatically configure computer systems (McDermott, 1980a; 1980b). XCON (for eXpert
CONfigurer) was built for the computer company Digital Equipment Corporation, and helped
choose components for their VAX machines. XCON was implemented in the rule based language
OPS5. By 1986 XCON had been used successfully at DEC processing over 80,000 orders with
an accuracy over 95%.

XCON is a forward chaining rule based system that worked from requirements towards
configurations, without backtracking. It needed two kinds of knowledge (Jackson, 1986),

• knowledge about components, for example voltage, amperage, pinning-type and number of
ports, and
• knowledge about constraints, that is, rules for forming partial configurations of equipment and
then extending them successfully.
[1]McDermott's 1980 paper on R1 won the AAAI Classic Paper Award in 1999. According to
legend, the name of R1 comes from McDermott, who supposedly said as he was writing it,
"Three years ago I wanted to be a knowledge engineer, and today I are one." -
http://en.wikipedia.org/wiki/Xcon

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


XCON: Component Knowledge
XCON stored the component knowledge in a separate database, and
used its production system architecture to reason about the
configuration. The following is an example of a record that describes
a disk controller.

RK611*
CLASS: UNIBUS MODULE
TYPE: DISK DRIVE
SUPPORTER: YES
PRIORITY LEVEL: BUFFERED NPR
TRASFER RATE: 12 ...

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


XCON: Rules
Constraints knowledge is specified in the form of rules. The LHS describes patterns in
partial configurations that can be extended, and the RHS did those extensions. The
following is an English translation of an XCON rule taken from (Jackson, 1986).

DISTRIBUTE-MB-DEVICES-3
IF the most current active context is distributing massbus devices
& there is a single port disk drive that has not been assigned to a massbus
& there is no unassigned dual port disk drives
& the number of devices that each massbus should support is known
& there is a massbus that has been assigned at least one disk drive and that
should support additional disk drives
& the type of cable needed to connect the disk drive to the previous device on
the disk drive is known
THEN
assign the disk drive to the massbus

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Backward Chaining

From Goals to Facts

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Backward Chaining
We move from the goal to be proved towards the available facts.
From (a É g) and Goal*:b infer Goal:aq
where q is a unifier for g and b
and aq is the formula obtained by applying the substitution q to a.
For example,
P(?x) ⊃ Q(?x)

q = {<?x, a>}
P(a) Goal: P(a) Goal: Q(a)

A goal is said to be solved if it matches a fact in the KB.

* The Goal: prefix identifies a goal formula as different from a fact.


Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Backward Chaining and Modus Tollens
P(?x) ⊃ Q(?x)

q = {<?x, a>}
P(a) Goal: P(a) Goal: Q(a)
Backward Chaining

⊥ Proof by Contradiction Assume ¬Q(a)

Forward Chaining
¬P(a) ¬Q(a)

Modus Ponens Modus Tollens


¬Q(?x) ⊃ ¬P(?x) ≡ P(?x) ⊃ Q(?x)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Backward Reasoning

• Backward reasoning is goal directed


• We only look for rules for which the consequent
matches the goal.
• This results in low branching factor in the
search tree
• which rule to apply from the matching set of rules?
• Foundations of Logic Programming
• the programming language Prolog

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Deductive Retrieval
The goal need not be a specific proposition
It can be have variables as well
Goal formulas with variables can match facts after unification.
For example.
Goal: Mortal(?z) can be interpreted as an existential statement

Is (there a z such that) $z Mortal(z) is true?

The answer, in addition to yes or no,


can also return a value for the variable
for which it is true.

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Deductive Retrieval: possible answers
q = {<?z, Socrates>}
Man(Socrates) Man(?x) ⊃ Mortal(?x)

q = {<?x, ?z>}
q = {<?z, Plato>}
Man(Plato) Goal: Man(?z) Goal: Mortal(?z)

Man(Aristotle)
q = {<?z, Aristotle>}

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Backward Chaining (Propositional Logic)
Alice likes mathematics (P) and she likes stories (Q). If she likes mathematics (P) she likes algebra (R). If
she likes algebra (R) and likes physics (S) she will go to college (T). She does not like stories (Q) or she
likes physics (S). She does not like chemistry (U) and history (V).

Then the given facts are, (P ∧ Q), (P ⊃ R), ((R∧ S) ⊃ T), (~Q ∨ S), (~U ∧ ~V)

Equivalently Goal Set (to show that) “Is T true?”


1.P We answer this by
2.Q {T} Given goal backward chaining.
3.(P ⊃ R) {R, S} from 4
4.((R∧ S) ⊃ T) {P, S} from 3
5.(Q ⊃ S) {S} P matches 1
6.~U {Q} from 5
7.~V { } Q matches 2, nothing more to show
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Backward Chaining with Conjunctive Antecedents

A goal (R ?x) and a rule (if (and (P ?x) (Q ?x)) (R ?x))

A goal which matches the consequent of a rule reduces


to the antecedents in the rule.
An AND node
To solve R solve (R ?x)
{(R ?x)} both P & Q

{(P ?x), (Q ?x)}


(P ?x) (Q ?x)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Goal Trees
Consider the following KB in skolemized list notation, and the goal (niceToy ?z)

Rule1: (if (and (green ?x) (circle ?x)) (niceToy ?x))


Rule2: (if (and (red ?x) (square ?x)) (niceToy ?x))
(green A)
(green B)
(circle C)
(red C)
(red D)
(square D)
(circle E)
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University
Goal tree = AND/OR tree
(niceToy ?x)

Rules
Rule2
Rule1

(square ?x)

(circle ?x) (red ?x) (square D)


(green ?x)
Facts
(circle C) (circle E)

(green A) (green B) (red C) (red D)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Depth First Search Goal Set
{(niceToy ?x)}
{(green ?x), (circle ?x)} Rule1
(niceToy ?x)
{(circle A)} ?x=A FAIL
{(circle B)} ?x=B FAIL
OR {(red ?x), (square ?x)} Rule2
{(square C)} ?x=C FAIL
Rule1 Rule2
{(square D)} ?x=D
AND AND {} Success

(green ?x) (circle ?x) (red ?x) (square ?x)

OR OR OR

(green A) (green B) (circle C) (circle E) (red C) (red D) (square D)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


AND/OR tree: Solution = subtree
(niceToy ?x)

Rule2
Rule1

(square ?x)

(circle ?x) (red ?x) (square D)


(green ?x)

(circle C) (circle E)

(green A) (green B) (red C) (red D)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


A Prolog KB (program) A preview
outingPlan(X,Y,Z) :- eveningPlan(X), moviePlan(Y), dinnerPlan(Z).
eveningPlan(X) :- outing(X), likes(friend, X).
Rules
moviePlan(X) :- movie(X), likes(friend,X).
dinnerPlan(X) :- restaurant(X), likes(friend,X).
outing(mall).
outing(beach).
movie(theMatrix).
movie(artificialIntelligence). (if (and (restaurant ?x) (likes friend ?x)) (dinnerPlan ?x))
movie(bhuvanShome).
movie(sevenSamurai).
restaurant(pizzaHut).
restaurant(saravanaBhavan). Facts
likes(friend, beach).
likes(friend, theMatrix).
likes(friend, bhuvanShome).
likes(friend, sarvanaBhavan).

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


outingPlan(X,Y,Z)
The Goal Tree
Dinner
eveningPlan(X)
Movie
Rules

outing(X) likes(friend,X)

movie(Y) likes(friend,Y) restaurant(Z) likes(friend,Z)

outing(mall)
likes(friend, bhuvanShome) likes(friend,saravanaBhavan)

likes(friend, theMatrix)
outing(beach)
restaurant(pizzaHut) Facts
movie(theMatrix)
movie(sevenSamurai)

movie(artificialIIntelligence)
restaurant(saravanaBhavan)
likes(friend, beach) movie(bhuvanShome)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Backward Chaining: Depth First Search
{outingPlan(X,Y,Z)} theta = { }
{eveningPlan(X), moviePlan(Y), dinnerPlan(Z)} theta = { }
{outing(X), likes(friend, X), moviePlan(Y), dinnerPlan(Z)} theta = { }
{likes(friend, mall), moviePlan(Y), dinnerPlan(Z)} theta = {X=mall}
{“fail”, moviePlan(Y), dinnerPlan(Z)} theta = {X=mall}
{outing(X), likes(friend, X), moviePlan(Y), dinnerPlan(Z)} theta = { } backtrack
{likes(friend, beach), moviePlan(Y), dinnerPlan(Z)} theta = {X=beach}
{moviePlan(Y), dinnerPlan(Z)} theta = {X=beach}
{movie(Y), likes(friend,Y), dinnerPlan(Z)} theta = {X=beach}
{likes(friend, theMatrix), dinnerPlan(Z)} theta = {X=beach, Y=theMatrix}
{dinnerPlan(Z)} theta = {X=beach, Y=theMatrix}
{restaurant(Z), likes(friend,Z)} theta = {X=beach, Y=theMatrix}
{likes(friend,pizzaHut)} theta = {X=beach, Y=theMatrix, Z=pizzaHut}
{“fail”} theta = {X=beach, Y=theMatrix, Z=pizzaHut}
{restaurant(Z), likes(friend,Z)} theta = {X=beach, Y=theMatrix} backtrack
{likes(friend, saravanaBhavan)} theta = {X=beach, Y=theMatrix, Z= saravanaBhavan }
{} theta = {X=beach, Y=theMatrix, Z= saravanaBhavan }

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


outingPlan(X,Y,Z)
The Solution
Dinner
eveningPlan(X)
Movie

outing(X) likes(friend,X)

movie(Y) likes(friend,Y) restaurant(Z) likes(friend,Z)

outing(mall)
likes(friend, bhuvanShome) likes(friend,saravanaBhavan)

likes(friend, theMatrix)
outing(beach)
restaurant(pizzaHut)
movie(theMatrix)
movie(sevenSamurai)

movie(artificialIIntelligence)
restaurant(saravanaBhavan)
likes(friend, beach) movie(bhuvanShome)

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


A not so easy problem
Consider the following KB
Recap

{(O A B), (O B C), (not (M A)), (M C)}

Where O is a binary predicate symbol


M is a unary predicate symbol
A, B and C are constant symbols

What is the above KB describing?


Observe that we have not used helpful names!
Remember – meaning lies in the mind of the beholder

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Interpretation 1 {(O A B), (O B C), (not (M A)), (M C)}
Domain: Blocks World

Predicate symbols A is not maroon


A is on B
O à On
M à Maroon
B ?
B is on C
C is maroon
Constant Symbols
A, B, C à blocks
Recap

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Interpretation 2 {(O A B), (O B C), (not (M A)), (M C)}
Domain: People Betty is looking at Cuthbert
Archie is looking at Betty
Predicate symbols
O à LookingAt
M à Married
Cuthbert Betty Archie
Constant Symbols
A à Archie is married is not married
B à Betty ?
C à Cuthbert
Recap

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


The Goal {(O A B), (O B C), (not (M A)), (M C)}
Given the KB is the following the goal / query true?
(exists (x y) (and (O x y) (not (M x)) (M y)))
or equivalently (and (O ?x ?y) (not (M ?x)) (M ?y))

Interpretations of the query are,


Blocks World: Is there a not-maroon block on a maroon block?

People: Is a not-married person looking at a married one?

Knowledge Representation and Reasoning Deepak Khemani, Plaksha University


Incompleteness of Backward and Forward Chaining
Given the KB,
{(O A B), (O B C), (not (M A)), (M C)}
And the Goal,
(and (O ?x ?y) (not (M ?x)) (M ?y))
Neither Forward Chaining nor Backward Chaining
is able to generate a proof.

Both are Incomplete!


Next, we look at a proof method,
the Resolution Refutation System,
that is Sound and Complete for FOL
Knowledge Representation and Reasoning Deepak Khemani, Plaksha University

You might also like