2. Definition
• a branch of symbolic logic dealing with
propositions (proposal, scheme, plan) as units
and with their combinations and the
connectives that relate them.
3. Syntax
• Defines the allowable sentences.
• Atomic Sentence:
– Consist of single proposition symbol.
– Either TRUE or FALSE
• Rules:
– Uppercase names used for symbols P,O,R
– Names are arbitrary (uninformed or random)
»Example:
»W[1,3] Wumpus in [1,3]
6. • Every sentence constructed with binary
connectives must be enclosed in parenthesis
((A ˄B) C) right form
A ˄B C wrong one
Multiplication has higher precedence than addition
Order of precedence is
, ˄,V, and
(i) A ˄ B ˄ Cread as (A ˄B) ˄ C (or) A ˄(B ˄ C)
(ii) ¬ P ˄Q˄ RS
((¬ P) ˄(Q˄ R))S
7. Semantics
• Defines the rules.
• Model fixes truth vales true or false for every
propositional symbol.
• Semantics specify how to compute the
truth of sentences formed with each of 5
connectives.
• Ex; (Wumpus World)
M1= { P1,2 = False, P2,2 = False, P3,1= True}
8. • Atomic sentences are easy
– True is true in every model
– False is false in every model.
• Complex Sentence
– Using “ Truth Table”
9. Example 1:
• Evaluate the sentence
¬ P1,2 ˄(P2,2 ˄ P3,1) (True ˄ (False ˄ True)
Result= True
Example 2:
5 is even implies sam is smart
This sentence will be true if sam is smart
P => Q is only FALSE when the Premise(p)
is TRUE AND Consequence(Q) is FALSE.
P => Q is always TRUE when the Premise(P)
is FALSE OR the Consequence(Q) is TRUE.
10. Example 3:
• B1,1 (P1,2 ˄P2,1)
– B1,1 means breeze in [1,1]
– P1,2 means pit in [1,2]
– P2,1 means pit in [2,1]
– So False False
Now
Result : True
Example 3:
• B1,1 (P1,2 ˄P2,1)
• The result is true
• But incomplete (violate the rules of
wumpus world)
11. A Simple Knowledge Base
• Take Pits alone
• i,j values
• Let Pi,j be true if there is a pit in [i,j]
• Let Bi,j be true if there is a breeze in [i,j]
12. KB
1. There is no pit in [1,1]
R1 : ¬P1,1
2. A square is breeze if and only if there is a pit
in a neighboring square.
R2 : B1,1 (P1,2 ˄P2,1)
R3 : B2,1 (P1,1 ˄P1,2 ˄P3,1)
3. The above 2 sentences are true in all wumpus
world. Now after visiting 2 squares
R4 : ¬B1,1
R5 : B2,1
13. • KB consists of R1 to R5 Consider the all
above in 5 single sentences
R1 ˄ R2 ˄ R3 ˄ R4 ˄ R5
Concluded that all 5 sentences are
True
14. Inference(conclusion, assumption..)
• Used to decide whether α is true in every
model in which KB is true.
Example: Wumpus World
B1,2 , B2,1 , P1,1 , P2,2 , P3,1, P1,2 , P2,1
So totally 27=128 models are possible
16. From the table KB is true if R1 through R5 is true
in all 3 rows P1,2 is false so there is no pit in
[1,2].
There may be or may not be pit in [2,2]
18. • Here TT truth table
• This enumeration algorithm is sound and
complete because it works for any KB and
alpha and always terminates.
• Complexity:
– Time complexity O(2 power n)
– Space complexity O(n)
n symbols
19. Equivalence
• 2 sentences are logically true in the same set of models then P Q.
• Also P ˄Q and Q ˄ P are logically equivalence
20. Validity
• A sentence is valid if it is true in all the models
Example:
• P ˄ ¬P is valid.
• Valid is also know as tautologies.
21. Satisfiability
• A sentence is true if it is true in some model.
A sentence is satisfiable if it is true in some model
e.g., A B, C
A sentence is unsatisfiable if it is true in no models
e.g., A A
22. • Validity and satisfiability are connected.
• α is valid if α is satisfiable.
• α is valid if ¬α is unsatisfiable.
• ¬α is satisfiable if ¬α is not valid