SMAI-Deduction-as-Search-full
SMAI-Deduction-as-Search-full
Deduction as Search
First Order Logic
A First Course in Artificial Intelligence: Chapter 11
Deepak Khemani
Plaksha University
An autonomous agent
This week,
Representation and Reasoning in Logic
Given
All men are mortal
and
Socrates is a man
conclude
Socrates is mortal
KB
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
All Xs are Y
If premises are true
C is X
Then conclusion is true
C is Y
Description Logics
Fuzzy logics Constraint logic programming
• Non-monotonic logics
– Fluents: sentences which can flip their truth value
– Knowledge and Belief
– Default Reasoning
– Inheritance
Modus Ponens (MP) Modus Tollens (MT) Conjunction (C) Constructive Dilemma (CD)
Augmenting the KB in a
piecewise fashion
If the above equivalence is a tautology, then the sentence (α⊃β) will always
take the same truth value as the sentence (¬α∨β). We can verify that the
equivalence is a tautology by constructing a truth table.
KB
Provability: KB ⊢ α
Search Methods in Artificial Intelligence Deepak Khemani, Plaksha University
Finding Proofs
The proof is the end product,
that is a justification of the sentence α being true
Forward Chaining
Pick a rule with matching facts
Add the consequent to the KB
Till the goal is added to the KB
KB ⊨ α
We also say that α is true (given the KB)
KB
Proof: which other sentences in the language can one produce by the
reasoning algorithm?
• 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 argument 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.
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) ∈ ℑ
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.
(Man(Socrates) ⊃ Mortal(Socrates))
$x (Man(x) ⊃ Mortal(x))
P(a) ⊃ Q(a)
MP
P(a) Q(a)
conclude
Socrates is mortal Mortal(Socrates)
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))
q = {<?x, a>}
P(a) Q(a)
Thus if
α = (Sport(tennis) ∧ Likes(Alice, tennis))
β⊃δ = (Sport(?y) ∧ Likes(?x, ?y)) ⊃ Watches(?x, ?y)
Bypassing Conjunction
P(?x,?y) ∧ R(?y)
For example,
P(?x) ⊃ Q(?x)
q = {<?x, a>}
P(a) Goal: P(a) Goal: Q(a)
q = {<?x, a>}
P(a) Goal: P(a) Goal: Q(a)
Backward Chaining
Forward Chaining
¬P(a) ¬Q(a)
q = {<?z, Socrates>}
q = {<?x, ?z>}
Man(Socrates) Goal: Man(?z) Goal: Mortal(?z)
Man(Aristotle)
q = {<?z, Aristotle>}
Then the given facts are, (P ∧ Q), (P ⊃ R), ((R ∧ S) ⊃ T), (~Q ∨ S), (~U ∧ ~V)
(P ?x) (Q ?x)
Rule2
Rule1
(square ?x)
(circle C) (circle E)
OR OR OR
Rule2
Rule1
(square ?x)
(circle C) (circle E)
Dinner
eveningPlan(X)
Movie
outing(X) likes(friend,X)
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)
Dinner
eveningPlan(X)
Movie
outing(X) likes(friend,X)
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)
Blocks World:
Is there a not-maroon block on a maroon block?
People:
Is a not-married person looking at a married one?
Is it provable?
A complete procedure…
in AI: Knowledge Representation & Reasoning
Search Methods in Artificial Intelligence Deepak Khemani, Plaksha University
End : Deduction as Search