You are on page 1of 18

Lecture 21

Propositional Logic
Artificial Intelligence
COSC-3112

Ms. Humaira Anwer


humaira.anwer@kfueit.edu.pk

Lecture 21- Propositional Logic 1


Outline
• Propositional (Boolean) logic
• Facts about Propositional Logic
• Tautologies
• Atomic Propositions
• Compound Propositions
• Precedence of Connectives
• Logical Equivalence
• Properties of Operators
• Limitations of Propositional Logic
• Converting Assertions into Logical Forms

Lecture 21- Propositional Logic 2


Propositional Logic
• Propositional logic (PL) is the simplest form of logic
where all the statements are made by propositions.
• Propositions: A proposition is a declarative
statement which is either true or false.
• It is a technique of knowledge representation in logical
and mathematical form.

Lecture 21- Propositional Logic 3


Basic Facts about Propositional
Logic
• Propositional logic is also called Boolean logic as it works on 0 and 1.
• In propositional logic, we use symbolic variables to represent the logic, and we
can use any symbol for a representing a proposition, such A, B, C, P, Q, R, etc.
• Propositions can be either true or false, but it cannot be both.
• Propositional logic consists of an object, relations or function, and logical
connectives.
• These connectives are also called logical operators.
• The propositions and connectives are the basic elements of the propositional
logic.
• Connectives can be said as a logical operator which connects two sentences.
• A proposition formula which is always true is called tautology, and it is also
called a valid sentence.
• A proposition formula which is always false is called Contradiction.
• Statements which are questions, commands, or opinions are not propositions
such as "Where is John", "How are you", "What is your name", are not
propositions.
Lecture 21- Propositional Logic 4
Tautologies
• A sentence is a tautology if it is true for any
setting of its propositional symbols
P Q P∨Q ¬(P)  ¬ (Q) (P ∨ Q) ∨
(¬(P)  ¬
(Q))

false false false true true

false true true false true

true false true false true

true true true false true

• (P ∨ Q) ∨ (¬(P)  ¬Lecture
(Q)) is a tautology
21- Propositional Logic 5
Is this a tautology?
• (P → Q) ∨ (Q → P)

Lecture 21- Propositional Logic 6


Syntax of Propositional Logic
• The syntax of propositional logic defines the
allowable sentences for the knowledge
representation.
• There are two types of Propositions:
a. Atomic Proposition:
b. Compound Propositions:

Lecture 21- Propositional Logic 7


Atomic Propositions

Atomic Proposition:
• Atomic propositions are the simple propositions.
• It consists of a single proposition symbol.
• These are the sentences which must be either true or false
Example:
a. 2+2 is 4, it is an atomic proposition as it is a true fact
b. "The Sun is cold" is also a proposition as it is a false fact

Lecture 21- Propositional Logic 8


Compound Propositions

Compound Proposition:
• Compound propositions are constructed by combining
simpler or atomic propositions
• These are constructed by using parenthesis and logical
connectives.
Example:
a. "It is raining today, and street is wet."
b. “John is a doctor, and his clinic is in London."

Lecture 21- Propositional Logic 9


Table for Propositional Logic
Connectives

Lecture 21- Propositional Logic 10


Precedence Connectives
• Just like arithmetic operators, there is a precedence order for
propositional connectors or logical operators.
• This order should be followed while evaluating a propositional problem.
• Following is the list of the precedence order for operators:

Lecture 21- Propositional Logic 11


Logical Equivalence
• Logical equivalence is one of the features of
propositional logic.
• Two propositions are said to be logically equivalent
if and only if the columns in the truth table are
identical to each other.

Lecture 21- Propositional Logic 12


Logical Equivalence
• Let's take two propositions A and B, so for logical
equivalence
• Calculate truth tables for
• ¬A∨ B
• A→B

• In truth table above, we can see that column for ¬A∨ B


and A→B, are identical hence A is Equivalent to B

Lecture 21- Propositional Logic 13


Is this a Logical equivalence?
•P∨Q
• ¬(¬(P)  ¬(Q))

Lecture 21- Propositional Logic 14


Famous logical equivalences
• (a OR b) ≡ (b OR a) commutatitvity
• (a AND b) ≡ (b AND a) commutatitvity
• ((a AND b) AND c) ≡ (a AND (b AND c)) associativity
• ((a OR b) OR c) ≡ (a OR (b OR c)) associativity
• NOT(NOT(a)) ≡ a double-negation elimination
• (a => b) ≡ (NOT(b) => NOT(a)) contraposition
• (a => b) ≡ (NOT(a) OR b) implication elimination
• NOT(a AND b) ≡ (NOT(a) OR NOT(b)) De Morgan
• NOT(a OR b) ≡ (NOT(a) AND NOT(b)) De Morgan
• (a AND (b OR c)) ≡ ((a AND b) OR (a AND c)) distributitivity

• (a OR (b AND c)) ≡ ((a OR b)21-AND


Lecture (a OR
Propositional Logic c)) distributitivity 15
Properties of Operators
• Commutativity:
• P∧ Q= Q ∧ P, or
• P ∨ Q = Q ∨ P.
• Associativity:
• (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
• Identity element:
• P ∧ True = P,
• P ∨ True= True.
• Distributive:
• P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
• P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
• DE Morgan's Law:
• ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
• ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
• Double-negation elimination:
• ¬ (¬P) = P.

Lecture 21- Propositional Logic 16


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.

Lecture 21- Propositional Logic 17


Converting Assertions into Logical
Forms
• Sentence “He has an Ace if he does not have a
Knight or a Spade”
• ¬(k ∨ s) → a
• Where k = knight, s = spade and a = Ace
• Practice: You will get a slap , unless you stop
whining
• w→s

Lecture 21- Propositional Logic 18

You might also like