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

Lecture 6 Knowledge Representation-5

AI lecture

Uploaded by

ashfaqnoreen55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Lecture 6 Knowledge Representation-5

AI lecture

Uploaded by

ashfaqnoreen55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

Knowledge

Representation
Reasoning
• Deriving logical conclusions from
given facts.
• ‘The process of working with
knowledge, facts and problem
solving strategies to draw
conclusions’ Durkin
Deductive Reasoning
• Deduce new information from logically
related known information
• A deductive argument offers assertions that
lead automatically to a conclusion.
• If there is dry wood, oxygen and a spark, there
will be a fire
Given: There is dry wood, oxygen and a spark
We can deduce: There will be a fire.
• All men are mortal. Socrates is a man.
We can deduce: Socrates is mortal
• Modus Ponens is the basic form of
deductive reasoning
• Modus Ponens: If A is true and if A implies B is
true, then B is true.
Inductive Reasoning
From a limited set of
observations, we form a
‘generalization’.
• e.g.
•Observation: All the crows
that I have seen in my life
are black.
•Conclusion: All crows are
black
Comparison
• Comparing deductive and inductive reasoning:
• Inductive: By experience, every time I have let a ball go,
it falls downwards. Therefore I conclude that the next time
I let a ball go, it will also come down.
• Deductive: I know Newton's Laws. So I conclude, if I let a
ball go, it will certainly fall downwards.
Abductive Reasoning
• Deduction is exact in that the deductions
follow in a logically provable way from the
axioms.
• Abduction is a form of deduction that
allows for plausible inference, i.e. the
conclusion might be wrong, e.g.
Implication: She carries an umbrella if it is raining
Axiom: she is carrying an umbrella
Conclusion: It is raining
• This conclusion might be false, because
there could be other reasons that she is
carrying an umbrella, e.g. she might be
carrying it to protect herself from the sun.
Analogical Reasoning
• Draw analogy between two
situations, looking for similarities
and differences.
• e.g. when you say driving a truck
is just like driving a car
• By analogy you know that there are
some similarities, same basic
concepts
• But you also know that there are
certain other distinguishing
characteristics of each
Common-sense Reasoning
• Gained through experience, rule-of-thumb
• Operates on heuristic knowledge and heuristic
rules.
Non-Monotonic Reasoning
• Used when the facts of the case are not
static, e.g.
• Rule:
• IF the wind blows
THEN the curtains sway
• When the wind stops blowing, the curtains should sway
no longer.
• However, if we use monotonic reasoning, this would
not happen. The fact that the curtains are swaying
would be retained even after the wind stopped blowing
• In non-monotonic reasoning, we have a ‘truth
maintenance system’. It keeps track of what
caused a fact to become true. If the cause is
removed, that fact is removed (retracted) also.
Inference
• Inference is the process of deriving new
information from known information
• In the domain of AI, the component of the system
that performs inference is called an inference
engine.
• We will look at inference within the framework of
‘logic’, which we introduced earlier
Logic
• Logic is a formal language
• Syntax:
• A description of valid statements, the expressions that are legal
in that language. We have already looked at the syntax of two
type of logic system called propositional logic and predicate
logic.
• Propositions: p, q, r
• Associated truth value
• Logical connectives
• Semantics: what expressions mean.
• e.g. the expression ‘the cat drove the car’ is syntactically
correct, but semantically non-sensible.
• Proof systems:
• A logic comes with a proof system, which is a way of
manipulating given statements to arrive at new statements. The
idea is to derive ‘new’ information from the given information
Proof
• Recall proofs in math class. You write down all you
know about the situation and then try to apply all
the rules you know repeatedly until you come up
with the statement you were supposed to prove.
• A proof is a sequence of statements aiming
at inferring some information.
• Steps:
• Initial statements are called premises of the proof (or
knowledge base)
• Use rules
• Add new statements
• Till you arrive at the statement you wished to prove.
Rules of Inference
• “Modus Ponens", which means "affirming method“
• From now onwards, anything that is written down in
a proof, is a statement that is true.
• If you know that alpha implies beta, and you know
alpha to be true, you can automatically say that beta
is true



Modus
Ponens
Rules of Inference
• Modus Tolens: "alpha implies beta" and "not beta" you
can conclude "not alpha".
• If Alpha implies beta is true and beta is known to be not
true, then alpha could not have been true. Had alpha
been true, beta would automatically have been true due
to the implication.





Modus
Tolens
Rules of Inference
• And-introduction say that from "Alpha" and from
"Beta" you can conclude "Alpha and Beta". That
seems pretty obvious.
• Conversely, and-elimination says that from
"Alpha and Beta" you can conclude "Alpha".


  
  

And- And-
Introduction elimination
Rules of Inference


 
    
    

Modus Modus And- And-


Ponens Tolens Introduction elimination
Inference Example
Prove S
Step Formula Derivation
1 PQ Given
2 P→R Given
3 (Q  R) →S Given
Inference Example
Prove S
Step Formula Derivation
1 PQ Given
2 P→R Given
3 (Q  R) →S Given
4 P 1 And-elimination
Inference Example
Prove S
Step Formula Derivation
1 PQ Given
2 P→R Given
3 (Q  R) →S Given
4 P 1 And-elimination
5 R 4, 2 Modus Ponens
Inference Example
Prove S
Step Formula Derivation
1 PQ Given
2 P→R Given
3 (Q  R) →S Given
4 P 1 And-elimination
5 R 4, 2 Modus Ponens
6 Q 1 And-elimination
Inference Example
Prove S
Step Formula Derivation
1 PQ Given
2 P→R Given
3 (Q  R) →S Given
4 P 1 And-elimination
5 R 4, 2 Modus Ponens
6 Q 1 And-elimination
7 Q R 5, 6 And-introduction
Inference Example
Prove S
Step Formula Derivation
1 PQ Given
2 P→R Given
3 (Q  R) →S Given
4 P 1 And-elimination
5 R 4, 2 Modus Ponens
6 Q 1 And-elimination
7 Q R 5, 6 And-introduction
8 S 7, 3 Modus Ponens
Exercise
• Today is Saturday and it is October
• If it doesn’t rain or if there is a football game, I
will ride my bike to OSU
• If I am in Corvallis, it will not rain
• If it is October and it is Saturday, I will be in
Corvallis
• If it is October, there will not be a football game
at OSU Can
• you prove that I will ride my bike to OSU?
Lecture Summary
• Reasoning
• Types of reasoning:
• Deductive
• Inductive
• Adbuctive
• Analogical
• common-sense
• non-monotonic reasoning
• Logic: syntax, semantics, Proof systems
• Rules of inference: Modus Ponens, Modus Tolens,
And-introduction, And-elimination
• Inference example
Resolution
• The deduction mechanism we discussed may
be used in practical systems, but is not
feasible. It uses a lot of inference rules,
which introduces a large branch factor in
the search for a proof.
• An alternative is Resolution, a strategy used
to assert the determine the truth of an
assertion.
• Only one Resolution rule:
 
  
 
Resolution Rule
           
F F F T F T F
F F T T F T T
F T F F T F F
F T T F T T T
T F F T T T T
T F T T T T T
T T F F T F T
T T T F T T T
Conjunctive Normal Form
• ANDs of ORs
• Resolution requires all sentences to be converted
into a special form called Conjunctive Normal
Form (CNF)
• A sentence written in CNF looks like
( A  B)  ( B   C )  ( D)
note : D ( D   D)

• Outermost structure is made up of conjunctions.


Inner units called clauses are made up of
disjunctions
Conjunctive Normal Form
• Clause
(B  C)
• A clause is the disjunction of many things.
• Literals
• The units that make up a clause are called literals.
And a literal is either a variable or the negation of a
variable. So you get an expression where the
negations are pushed in as tightly as possible, then
you have ors, then you have ands.
• You can think of each clause as a requirement.
Each clause has to be satisfied to satisfy the
entire statement
Convert to CNF
• Eliminate arrows
(implications)

A  B  A  B
Convert to CNF
• Drive in negations using De Morgan’s Laws

 ( A  B ) ( A   B )

 ( A  B ) (  A   B )
Convert to CNF
• Distribute OR over AND

A  (B  C)
( A  B )  ( A  C )
Convert to CNF
Example

( A  B )  (C  D)
1. ( A  B )  ( C  D)
2.( A   B )  ( C  D)
3.( A   C  D)  ( B   C  D)
Resolution by
Refutation
• Proof strategy called Resolution
Refutation
• Write all sentences in CNF
• Negate the desired conclusion
• Apply the resolution rule until you derive a
contradiction or cannot apply the rule anymore.
• If we derive a contradiction, then the
conclusion follows from the given axioms
• If we cannot apply anymore, then the
conclusion cannot be proved from the
given axioms
Resolution by
Refutation
Step Formula Derivation
1 PQ Given Prove R
2 ¬P  R Given 1 PQ
3 ¬Q  R Given 2 P→R
3 Q →R
Resolution Example
Step Formula Derivation
1 PQ Given Prove R
2 ¬P  R Given 1 PQ
3 ¬Q  R Given 2 P→R
4 ¬R Negated Conclusion 3 Q →R
Resolution Example
Step Formula Derivation
1 PQ Given Prove R
2 ¬P  R Given 1 PQ
3 ¬Q  R Given 2 P→R
4 ¬R Negated Conclusion 3 Q →R
5 QR 1,2 Resolution Rule
Resolution Example
Step Formula Derivation
1 PQ Given Prove R
2 ¬P  R Given 1 PQ
3 ¬Q  R Given 2 P→R
4 ¬R Negated Conclusion 3 Q →R
5 QR 1,2
6 ¬P 2,4
Resolution Example
Step Formula Derivation
1 PQ Given Prove R
2 ¬P  R Given 1 PQ
3 ¬Q  R Given 2 P→R
4 ¬R Negated Conclusion 3 Q →R
5 QR 1,2
6 ¬P 2,4
7 ¬Q 3,4
Resolution Example
Step Formula Derivation
1 PQ Given Prove R
2 ¬P  R Given 1 PQ
3 ¬Q  R Given 2 P→R
4 ¬R Negated Conclusion 3 Q →R
5 QR 1,2
6 ¬P 2,4
7 ¬Q 3,4
8 R 5,7 Contradiction!
Resolution Example
• Note that you could have come up with multiple ways of proving R

Step Formula Step Formula


1 PQ Given 1 PQ Given
2 ¬P  R Given 2 ¬P  R Given
3 ¬Q  R Given 3 ¬Q  R Given

4 ¬R 4 ¬R
5 ¬Q 3,4 5 QR 1,2
6 P 1,5 6 ¬P 2,4
7 R 2,6 7 ¬Q 3,4

8 R 5,7
Resolution Example 2
1. (P→Q) →Q
2. P→R
3. ¬R → ¬Q
Convert to CNF:
1.( P  Q)  Q 2.P  R  P  R
(  P  Q )  Q
 (  P  Q )  Q 3. R   Q  R   Q
( P   Q )  Q
( P  Q )  (  Q  Q )
( P  Q )
Resolution Example 2
Step Formula Derivation Step Formula Derivation
1 QP Given 1 QP Given
2 ¬PR Given 2 ¬PR Given
3 R  ¬Q Given 3 R  ¬Q Given
4 ¬R 4 ¬R
5 ¬P 2,4 5 ¬Q 3,4
6 Q 1,5 6 P 1,5
7 R 3,6 7 R 2,6
Proof Strategies
• We may apply rules in an arbitrary order, but
there are some rules of thumb
• Unit preference: prefer using a clause with one literal.
Produces shorter clauses
• Set of support: try to involve the thing you are trying to
prove. Chose a resolution involving the negated goal.
These are relevant clauses. We move ‘towards solution’
Lecture Summary
• Reasoning
• Types of reasoning: Deductive, Inductive, Adbuctive,
Analogical, common-sense, non-monotonic reasoning
• Logic: syntax, semantics, Proof systems
• Rules of inference: Modus ponens, Modus tolens, And-
introduction, And-elimination
• Inference example
• Resolution Refutation
• Convert to CNF
• Remove arrows
• Drive in Negations (De Morgans)
• Distribute Or over And
• Add negation of Goal
• Repeatedly apply resolution rule
Assignment 4
Question 1- Consider the following propositions:
p: It’s sunny this afternoon.
q: It’s colder than yesterday.
r: We will go swimming.
s: We will take a canoe trip.
t: We will be home by sunset.
Premises:
a) “It’s not sunny and it’s colder than yesterday”
b) “We will go swimming only if it’s sunny.”
c) “If we don’t go swimming then we will take canoe trip.”
d) “If we take a canoe trip, then we will be home by sunset.”
Formalize the above sentences in propositional logic and
prove “We will be home by sunset.”
• Question 2: Use Propositional Resolution to show
that the clauses {pVq}, {p->r}, {p->¬r}, {pV¬q}
are not simultaneously satisfiable.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy