Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
-
Upload
garey-charles -
Category
Documents
-
view
229 -
download
0
description
Transcript of Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
Reasoning withPropositional Logic
automated processing of a simple knowledge baseCD
D Goforth - COSC 4117, fall 2006 2
Knowledge representation propositions: set of atomic statements
that may be true or false general knowledge: set of complex
sentences describing conditions (constraints) on environment
facts: data (from perceptions) about specific state of environment
D Goforth - COSC 4117, fall 2006 3
Knowledge representation KB - knowledge base: conjunction of
general knowledge and facts model: assignment of true/false values
to the propositions so KB can be determined to be true or false
NOTE: term “model” is not clearly defined – sometimes, it means any assignment to propositions; usually it means an assignments so KB is true
D Goforth - COSC 4117, fall 2006 4
model
propositions: set of atomic statements that may be true or false general knowledge: complex sentences describing conditions on environment facts: data (from perceptions) about specific state of environment KB - knowledge base: conjunction of general knowledge and facts model: assignment of true/false values to the propositions
facts general knowledge
Agent
propositionspropositions
general knowledgeenvironment
Agent sets true/false values of propositionsto make model(s) whereKB is consistent (true)
- these models represent “understanding”
D Goforth - COSC 4117, fall 2006 5
Knowledge representationtruth table
P1 P2 P3 ...Pn R1 R2 R3 ...Rm Rm+1 Rm+2 Rm+3 ...Rk KB=ΛRi
t t t ...t t f f ...t f f f ...f f
t t t ...t t f f ...t f f f ...f ft t t ...f f f t ...t f t t ...f f
f t t ...f t t t ...t t t t ...t t
f f f ...f t f f ...f f t f ...f f
...
...
propositions general knowledge facts
a model m
aking KB true
D Goforth - COSC 4117, fall 2006 6
propositions: set of atomic statements that may be true or false general knowledge: complex sentences describing conditions on environment facts: data (from perceptions) about specific state of environment KB - knowledge base: conjunction of general knowledge and facts model: assignment of true/false values to the propositions
model
facts general knowledge
Agent
propositionspropositions
general knowledge
Is GREEN in front of RED? NO
D Goforth - COSC 4117, fall 2006 7
Facts (from perception):1. RED occludes ORANGE2. ORANGE occludes GREEN
Propositions:1. ORANGE inFrontOf RED2. ORANGE inFrontOf GREEN3. RED inFrontOf GREEN4. RED inFrontOf ORANGE5. GREEN inFrontOf RED6. GREEN inFrontOf ORANGE
General knowledge (incomplete):•if (ORANGE occludes RED) then (ORANGE inFrontOf RED)•if (RED inFrontOf ORANGE) then not(ORANGE inFrontOf RED)•if (RED inFrontOf ORANGE) and (ORANGE inFrontOf GREEN) then (RED inFrontOf GREEN)•etc…
general knowledge
Agent
propositions
general knowledgefacts
model propositions
D Goforth - COSC 4117, fall 2006 8
Knowledge representationtruth table
P1 P2 P3 ...P6 R1 R2 R3 ...Rm Rm+1 Rm+2 KB=ΛRi
t t t ...t t f f ...t t t f
f t t ...f t t t ...t t t t
f f f ...f t f f ...f t t f
...
...
propositions general knowledge facts
Combination of true/false that describesthe order of RED, GREEN, ORANGE
Logical equivalences
Review the truth tables for each of these connectives:
Practice applying these logical equivalence axioms
D Goforth - COSC 4117, fall 2006 11
Uses of logical equivalence axioms Rewriting sentences
Show equivalence or difference Format for reasoning Reduce number of connectives(people like variety; computers like simplicity)e.g., A B ( A B ) ( B A )
( A B ) ( B A ) (A B ) (B A )
D Goforth - COSC 4117, fall 2006 12
Properties of sentences validity: sentence is true in all models satisfiability: sentence is true in some
model• general knowledge is valid;• facts are (should be) satisfiable
D Goforth - COSC 4117, fall 2006 13
Proof strategiesA. finding models that satisfy KB
– truth table enumeration O(2n) for n propositions
B. applying inference rules
D Goforth - COSC 4117, fall 2006 14
B. Inference rules human-like reasoning from classic logic
1. and elimination2. modus ponens3. logical equivalences
D Goforth - COSC 4117, fall 2006 15
1. And elimination Spot is big and friendly
Spot is friendly A Λ B
B
D Goforth - COSC 4117, fall 2006 16
2. Modus ponens Spot is a dog
A dog is a mammal(if Spot is a dog then Spot is a mammal)
Spot is a mammal A , A=>B
B
D Goforth - COSC 4117, fall 2006 17
3. Logical equivalence (eg) logical equivalence:
~ ( A \/ B ) = ~A Λ ~B The car is not (red or green)
The car is not redand it’s not green
~ ( A \/ B ) ~A Λ ~B
Question – can we claim “car is not red”?
D Goforth - COSC 4117, fall 2006 18
Short inference sequencePropositions: A car is red
B car is greenKnowledge: ~ ( A \/ B )Inference: ~ ( A \/ B )
~A Λ ~B (logical equivalence)
~A (and elimination)Claim: car is not red
D Goforth - COSC 4117, fall 2006 19
Automated reasoning reduced variety of representation for
sentences harder to ‘read’ for humans simpler data structure to process
reduced set of inference rules less efficient for humans equally powerful simpler algorithm for implication
D Goforth - COSC 4117, fall 2006 20
Simplified representation - CNF Conjunctive Normal Form
conjunction of disjunctions (AND of OR’s)of literals (atomic propositions or negations)
(P \/ Q \/ ~R) Λ (~W \/ ~Q \/ T) Λ (W \/ P) A Knowledge base is in CNF if the
statements are disjunctions
less readable?
Example sentence
Example sentence in CNF
D Goforth - COSC 4117, fall 2006 22
Restricted CNF – Horn clause CNF disjunction
At most one literal is positive (P \/ Q \/ ~R) is not Horn clause (~W \/ ~Q \/ T) is Horn clause
Basis of PROLOG – logic programming language
(~W \/ ~Q \/ T) is (W Λ Q) T
D Goforth - COSC 4117, fall 2006 23
Summary 1 Representation – facts, propositions,
general knowledge Models, validity and satisfiability Propositional logic Reasoning – by searching models
– by inference CNF, Horn clauses
D Goforth - COSC 4117, fall 2006 24
Summary 2 Logical equivalence axioms Sound and complete inference Inference strategies
And elimination Modus ponens Resolution
Inference algorithms (coming next) Resolution proof by contradiction Forward chaining – data-driven Backward chaining –goal-directed