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

Propositional Logic

AI topic

Uploaded by

RAMJAN ALI KHA
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Propositional Logic

AI topic

Uploaded by

RAMJAN ALI KHA
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Propositional Logic

 Munni Khanom  200150


 Abu Sayed  200151
 Sajid Hasan Takbir  200152
 Anamika Marma  200153
 Ove shak  200154
what is propositional logic

 Ai needs knowledge for making decisions. And this knowledge needed


to be logical as it doesn’t understand the real world statements.

 PL is the simplest kind of logic.

 Proposition refers to declarative statement ( true or false not both).

 It is a method of expressing knowledge in logical and mathematical


terms.
 In PL, symbolic variables are used to express the logic. such as A, B,
C, P, Q, R, and so on.

 The statements which can be true or false are only Proposition.


 Example: The sun rises from west. (False proposition)

 Statements that are inquiries, demands, or opinions are not


propositions, such as "Where is Rohini ", “ How are you", and
"What is your name" are not propositions.
Propositions are divided into two categories:

 Atomic propositions  Compound propositions


 It’s made up with only one  Simpler or atomic statements are
proposition. combined with parenthesis and
logical connectives to form
1. 2+2 is 4, it is an atomic compound propositions.
proposition as it is a true fact.
1. "It is raining today, and street is
2. "The Sun is cold" is also a wet."
proposition as it is a false fact. 2. "Ankit is a doctor, and his clinic is
in Mumbai."
Logical Connectives
 Negation ¬ :
The negation of a proposition p is denoted by ¬p and is read as "not p“.
 Conjunction ∧ :
The conjunction of two propositions p and q is denoted by p ∧. The
conjunction is true only if both p and q are true.
 Disjunction ∨ :
The disjunction of two propositions p and q is denoted by p ∨ q . The
disjunction is true if at least one of p and q is true.
 Implication → :
The implication of two propositions p and q is denoted by p → q and is read as "if p then q".
The implication is always true when p is false.

 Biconditional ⇔ :
A sentence such as P⇔ Q is a Biconditional sentence, example I will eat lunch if and only if
my mood improves. P= I will eat lunch, Q= if my mood improves, it can be represented as
P ⇔ Q.
Truth tables

Negation:
p ¬p
Disjunction:
Truth False
p q p∨q
False Truth
true true true
true false true
Conjunction:
false true true
P Q P∧Q
false false true
true true true
true false false
false true false
false false false
Truth Tables

Implication: Biconditional:
p q p→q p q p⇔ q

true true true true true true

true false false true false true

false true true false true false

false false true false false true


Precedence of connectives

Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Forth Precedence Disjunction(OR)
Fifth Precedence Implication
Sixth Precedence Biconditional
Properties of Operators

 Commutativity:  Distributive:
 P ∧ Q= Q ∧ P, or  P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
 P ∨ Q = Q ∨ P.  P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
 Associativity:  DE Morgan's Law:
 (P ∧ Q) ∧ R = P ∧ (Q ∧ R),  ¬(P ∧ Q) = (¬P) ∨ (¬Q),
 (P ∨ Q) ∨ R= P ∨ (Q ∨ R).  ¬(P ∨ Q) = (¬ P) ∧ (¬Q).
 Identity element:  Double-negation elimination:
 P ∧ True = P,  ¬(¬P) = P.
 P ∨ True= True.
Limitations of Propositional
logic
 We cannot represent relations like ALL, some, or none with
propositional logic. Example:
 All the girls are intelligent.
 Some apples are sweet.

 Propositional logic has limited expressive power.

 In propositional logic, we cannot describe statements in terms of their


properties or logical relationships.
Rules of Inference for Propositional Logic

 In artificial intelligence, we need intelligent computers which can


create new logic from old logic or by evidence, so generating the
conclusions from evidence and facts is termed as Inference.

 Inference rules are the templates for generating valid arguments.


Inference rules are applied to derive proofs in artificial intelligence,
and the proof is a sequence of the conclusion that leads to the
desired goal.
Types of Inference rules

 Modus Ponens:
The Modus Ponens rule is one of the most important rules of
inference, and it states that if P and P → Q is true, then we can infer
that Q will be true. It can be represented as:

 Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
 Modus Tollens:
The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P
will also true. It can be represented as:

 Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
 Hypothetical Syllogism:
The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is
true, and Q→R is true.
 Example:
Statement-1: If you have my home key then you can unlock
my home. P→Q
Statement-2: If you can unlock my home then you can take my
money. Q→R
Conclusion: If you have my home key then you can take my
money. P→R
 Disjunctive Syllogism:
The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q
will be true. It can be represented as:

 Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
 Addition:
The Addition rule is one the common inference rule, and it states
that If P is true, then P∨Q will be true.

 Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
 Simplification:
The simplification rule state that if P∧ Q is true, then Q or P will
also be true. It can be represented as:

 Resolution:
The Resolution rule state that if P∨Q and ¬ P∧R is true, then
Q∨R will also be true. It can be represented as:
Uses of PL
 Propositional logic forms the basis of inference engines in rule-based
expert systems.
Rule 1: If a patient has a fever and sore throat, then they may have the flu.
Rule 2: If a patient has a cough and fatigue, then they may have the flu.
 Observed Symptoms:
A patient reports having a fever and sore throat.
 Inference Using Modus Ponens:
• The AI "knows" Rule 1: If a patient has a fever and sore throat, then
they may have the flu.
• It also observes the fever and sore throat (i.e., "A is true").
• By applying modus ponens, the AI infers that the patient may indeed
have the flu ("B is true").
Uses of PL

• In an e-commerce website :  Traffic Light Systems


 If a user is logged in and • Traffic lights are controlled
has items in their cart, then using propositional logic to
allow checkout. manage the flow of vehicles.
• Let P= "User is logged in." For example:
• Let Q= "User has items in the • If there is a pedestrian
cart." waiting and it is safe to
stop traffic, then show the
• Then the checkout button is
enabled if P∧Q (both conditions
walk signal.
are true). P= "Pedestrian is waiting.
Q= "It is safe to stop traffic.
The logic controller turns on the
walk signal if P∧Q is true.

You might also like