Professional Documents
Culture Documents
Module 2 L2 Techniques of KR Logical Propositional
Module 2 L2 Techniques of KR Logical Propositional
Representation
Techniques of Knowledge Representation
1. Logical Representation
2. Semantic Representation
3. Frames Representation
4. Production Rules
Logical Representation
Premise: If it is raining, the ground is
Logic? wet. Observation: It is raining.
Conclusion: Therefore, the ground is wet.
TRUE FALSE
Propositional Variables
• “2 + 2 = 4” = P TRUE
• John likes patient care = Q TRUE
• “1 + 1 > 3” = R FALSE
Symbols
Variables that are used to represent propositions are called Propositional variables
Propositional Variables
Sentence: “Adam is good in playing football and this time he is representing his
college at National Level”
P^Q
P and Q
Propositional Logic : Connectives
• Also called as : Logical Operators [Logical operators are generally used
for combining two or more relational statements. They return Boolean
values.]
• The Connectives:
• Conjunction (^, &): AND
• Disjunction (V , |): OR
• Negation (¬, ~): NOT
• Implication (->, ⇒): IF….THEN
• Biconditional (↔ , ⇔) IF AND ONLY IF
Propositional Sentence : A statement obtained by using connectives
P^Q
Connectives : 1) Negation
• Let P be a proposition, ¬P is called negation of P which simply states
that “If P is true then ¬P is false. If P is false then ¬P is true.”
• Example:
• P = “Arjun's dog has a black tail”
• ¬P = ?
P ¬P
True False
False True
¬P = “Arjun's dog does not
have a black tail”
Connectives : 2) Conjunction
• Let P and Q be two propositions, Conjunction of P and Q is denoted
by P ^ Q
• When both P and Q are true then only the compound proposition*
P^Q are true.
Example: “12 is divisible by 3 and 3 is a prime P Q P^Q
number” T T T
T F F
P = 12 is divisible by 3 = ?
Q = 3 is a prime number = ? F T F
F F F
P^Q=?
*A compound proposition is a proposition that involves the assembly of multiple statements
Connectives : 3) Disjunction
• Let P and Q be two propositions, Disjunction of P or Q is denoted by P
VQ
P Q P->Q
T T T
P is called hypothesis (or premise) and Q is T F F
called conclusion (or consequence) F T T
F F T
Connectives : 4) Implication
• Example 1:
• “If you try hard for your exam, then you will succeed”
P Q
P Q
P Q
T T P->Q = T
T F P->Q = F
F T P->Q = T
P Q P->Q
F F P->Q = T
T T T
T F F
F T T
F F T
Connectives : 4) Implication
• Example 3:
• “If you get 100% marks in the final exam, then you will be awarded a Trophy”
P Q
T T P->Q = T
T F P->Q = F
F T P->Q = T
P Q P->Q F P->Q = T
F
T T T
T F F
F T T
F F T
Connectives : 4) Implication
1) T, 2) F, 3) T, 4) F, 5) T.
Connectives : 4) Implication
P Q Q->P FACTS:
T T T 1. Implication and Contrapositive both are
T F T Q -> P equivalent
[CONVERSE] 2. Converse and Inverse both are equivalent
F T F
3. Neither Converse nor Inverse is equivalent to
F F T Implication
Connectives : 4) Implication – Converse,
Contrapositive and Inverse
• Applying What We've Learned: Problem-Solving Session – State the
converse, contrapositive and inverse of the following statement:
1. If you receive ‘A’ grade in Artificial Intelligence then, you will be
awarded a scholarship
2. If exercise is good for health then, I will go the park
Solutions: Solutions:
1. Converse: if you are awarded a scholarship then 1. Converse: If I will go to the park, then exercise is
you have received ‘A’ grade in Artificial good for health.
Intelligence 2. Contrapositive: If I will not go to the park then
2. Contrapositive: if you will not be awarded a exercise is not good for health.
scholarship then you didn’t receive A grade in AI 3. Inverse: If exercise is not good for health then I'm
3. Inverse: if you didn’t receive A grade in AI then not going to the park.
you will not be awarded a scholarship
Connectives : 5) Biconditional
• Let P and Q be two propositions, the biconditional statement of the
form P ↔ Q is the proposition, “P if and only if Q”
• P ↔ Q is true whenever the truth values of P and Q are same.
Example: P Q P↔Q
Let P = “You get promoted” T T T
Q = “You have connections” T F F
F T F
P ↔ Q = “You get promoted if and only if you F F T
have connections”
Connectives : 5) Biconditional
• Applying What We've Learned: Problem-Solving Session – Write each
of the proposition in the form “P if and only if Q”:
1. It rains if it is a weekend day, and it is a weekend day if it rains
2. The trains run late on exactly those days when I book the ticket
3. For you to get an “A” in this course, it is necessary and sufficient
that you attend AI classes regularly.
Solutions:
1. It rains if and only if it is a weekend day
2. The trains run late if and only if I book the ticket
3. You can get an “A” in this course if and only if you attend AI classes regulary
Precedence of Logical Operators
Operator Precedence
() - Paranthesis 1
¬ 2
^ 3
V 4
-> 5
↔ 6
Computing Truth Tables
P V Q -> ¬R
Step 1: Declare Variables and its Step 2: Step 3: Precedence Step 4: Finally compute
various states Precedence Rule 1 Rule 3 the entire statement