KnowledgeRepresentation PDF
KnowledgeRepresentation PDF
KnowledgeRepresentation PDF
1
Propositional Logic Concepts Simple & Compound Propositions
Given some propositions to be true in a given context, • Fast foods tend to be unhealthy.
− logic helps in inferencing new proposition, which is also true in • Parakeets are colorful birds.
the same context.
2
Exploring the Wumpus World Exploring the Wumpus World
[1,1] The first percept is [none, none,none,none,none], indicates that there is a pit in [2,2] or [3,1],
move to safe cell e.g. 2,1 return to [1,1] to try next safe cell
3
Propositional Logic Propositional Logic
• A simple language useful for showing key ideas and definitions
• Logical constants: true, false • User defines a set of propositional symbols, like P and Q.
• Propositional symbols: P, Q, S, ... (atomic sentences) • User defines the semantics of each propositional symbol:
• Wrapping parentheses: ( … ) • P means “It is hot.”
• Sentences are combined by connectives: • Q means “It is humid.”
...and [conjunction] • R means “It is raining.”
• (P Q) R
...or [disjunction]
• “If it is hot and humid, then it is raining”
...implies [implication / conditional] • QP
..is equivalent [biconditional] • “If it is humid, then it is hot”
...not [negation]
• Literal: atomic sentence or negated atomic sentence
Truth tables
Truth tables II
The five logical connectives:
A complex sentence:
4
Models of complex sentences Inference rules
• Logical inference is used to create new sentences that logically
follow from a given set of predicate calculus sentences (KB).
– A rule is sound if its conclusion is true whenever the premise is true Modus Ponens A, A B B
• Following rules can be shown to be sound using a truth table From an implication and the premise of the implication, you can
RULE PREMISE CONCLUSION infer the conclusion.
Modus Ponens A, A B B
And Introduction A, B AB
And Elimination AB A
Double Negation A A
Unit Resolution A B, B A
Resolution A B, B C AC
5
Sound rules of inference Sound rules of inference
RULE PREMISE CONCLUSION RULE PREMISE CONCLUSION
And Introduction A, B AB And Elimination AB A
From a list of sentences, one can infer their conjunction From a conjunction, one can infer any of the conjuncts.
Unit Resolution A B, B A B can’t be both true an false, one of the other disjuncts must be
true in one of the premises. Or equivalently, implicative is
From a disjunction, if one of the disjuncts is false, then one can transitive.
infer the other one is true.
A B, B C A C
6
Exploring the Wumpus World
After the third move
• Some atomic propositions:
S12 = There is a stench in cell (1,2)
• We can prove that the
B34 = There is a breeze in cell (3,4) Wumpus is in (1,3) using
W22 = The Wumpus is in cell (2,2) the four rules given.
V11 = We have visited cell (1,1)
OK11 = Cell (1,1) is safe.
etc
• Some rules:
(R1) S11 W11 W12 W21
(R2) S21 W11 W21 W22 W31
(R3) S12 W11 W12 W22 W13
(R4) S12 W13 W12 W22 W11
Etc
7
Limitations of Propositional Logic Formal Languages and Commitments
Language Ontological Epistemological
• number of propositions Commitment Commitment
– since everything has to be spelled out explicitly, the number of rules is (“what is”) (“what can be known”)
immense Propositional Logic facts true, false, unknown
• Can’t directly talk about properties of individuals or relations
between individuals (e.g., “Bill is tall”) First-order Logic facts, objects, true, false, unknown
relations
• dealing with change (monotonicity) Temporal Logic facts, objects, true, false, unknown
– even in very simple worlds, there is change relations, times
– the agent’s position changes
– time-dependent propositions and rules can be used Probability Theory facts degree of belief
• even more propositions and rules ∈ [0,1]