Professional Documents
Culture Documents
Logic2 PDF
Logic2 PDF
and Reasoning
with First Order Logic
Module 2
Deepak Khemani
Text book
Deepak Khemani. A First Course in Artificial Intelligence (Chapters 12 & 13), McGraw Hill
Education (India), 2013.
All men are mortal All cities are congested All politicians are honest
Socrates is a man Chennai is a city Sambit is a politician
Socrates is mortal Chennai is congested Sambit is honest
In a valid argument
IF the premises are true
The Socratic argument
THEN the conclusions are necessarily true
KB
P(a) ⊃ Q(a)
MP
P(a) Q(a)
Forward chaining in FOL is a two step process. First a relevant instantiation of a rule is
created. Then the rule instance is used by modus ponens to produce the consequent.
The use of Implicit Quantifier Notation collapses this two step inference into one.
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))
= {<?x, a>}
P(a) Q(a)
then α unifies with β with the substitution θ = {<?x, Alice>, <?y, tennis>}
given above, and one can infer
(SmallerOrEqual 0 ?x)
(SmallerOrEqual 0 7)
(GreaterOrEqual ?x 0)
(GreaterOrEqual ?z 0)
Unify(arg1, arg2)
Return SubUnify(arg1, arg2, ( ))
x y α ≡ y x α
x y α ≡ y x α
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))
in which the computation flows from the left hand side to the right
hand side, that is Forward Chaining
Pattern Action
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
RK611*
CLASS: UNIBUS MODULE
TYPE: DISK DRIVE
SUPPORTER: YES
PRIORITY LEVEL: BUFFERED NPR
TRASFER RATE: 12 ...
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
= {<?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. In the above example
we start with the goal of proving Q(a) and reduce to the sub-goal P(a), which
is satisfied in the KB.
= {<?z, Socrates>}
= {<?x, ?z>}
Man(Socrates) Goal: Man(?z) Goal: Mortal(?z)
= {<?z, Aristotle>}
Man(Aristotle)
Then the given facts are, (P Q), (P R), ((R S) T), (~Q S), (~U ~V)
(R ?x)
{(R ?x)} An AND node
{(P ?x) (Q ?x)}
To solve R (P ?x) (Q ?x)
solve both P & Q
Rule1 Rule2
AND AND
OR OR OR
Rule1 Rule2
AND AND
OR OR OR
outing(X) likes(friend,X)
restaurant(Z) likes(friend,Z)
movie(Y) likes(friend,Y)
outing(beach) movie(theMatrix)
movie(sevenSamurai) restaurant(pizzaHut)
movie(artificialIIntelligence)
restaurant(saravanaBhavan)
outing(X) likes(friend,X)
restaurant(Z) likes(friend,Z)
movie(Y) likes(friend,Y)
outing(beach) movie(theMatrix)
movie(sevenSamurai) restaurant(pizzaHut)
movie(artificialIIntelligence)
restaurant(saravanaBhavan)
Constant Symbols
I(A) = Jack John Anne Jack
I(B) = Anne is married is not married
?
I(C) = John
Knowledge Representation and Reasoning: Introduction Deepak Khemani, IIT Madras
The Goal {(O A B), (O B C), (not (M A)), (M C)}
Given the KB and the goal
(exists (x y) (and (O x y) (not (M x)) (M y)))
or equivalently (and (O ?x ?y) (not (M ?x)) (M ?y))
…is clearly entailed
Interpretations are,
Blocks World: Is there a not-maroon block on a maroon block?
People: Is a not-married person looking at a married one?