Chap03Logic
Chap03Logic
“Logic”
Outline
• Objectives
• Propositional logic
• Introduction
• Facts
• Syntax
• Operators
• Properties of operators
• Connectives
• Precedence of connectives
• Task
Propositional Logic
Propositional logic
Propositional logic (PL) is the simplest form of logic where all the
statements are made by 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.
Example:
It is Sunday.
The Sun rises from West (False proposition)
3+3= 7(False proposition)
5 is a prime number.
Propositional Logic
Logical Connectives:
Logical connectives are used to connect two simpler propositions
or representing a sentence logically. We can create compound
propositions with the help of logical connectives. There are
mainly five connectives, which are given as follows:
Negation: A sentence such as ¬ P is called negation of P. A
literal can be either Positive literal or negative literal.
Conjunction: A sentence which has ∧ connective such as, P ∧ Q
is called a conjunction.
Example: Kamal is intelligent and hardworking. It can be written
as,
P= Kamal is intelligent, Q= Kamal is hardworking. → P∧ Q.
Propositional Logic
Truth Table:
In propositional logic, we need to know the truth values of
propositions in all possible scenarios. We can combine all the
possible combination with logical connectives, and the
representation of these combinations in a tabular format is called
Truth table.
Following are the truth table for all logical connectives:
Propositional Logic
Propositional Logic
Precedence of 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:
Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Fourth Precedence Disjunction(OR)
Fifth Precedence Implication
Six Precedence Biconditional
Propositional Logic
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.
Associativity:
(P ∧ Q) ∧ R= P ∧ (Q ∧ R),
(P ∨ Q) ∨ R= P ∨ (Q ∨ R)
Course: Artificial Intelligence CS363- Instructor: ZAIDULLAH, Asst. Prof. Institute of Computing , KUST -- Email: [email protected]
Propositional Logic
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.
Student task
Create truth table and verify all the properties of
operators discussed
18 De Morgan’s Laws – 2 - 9a
CS-708
19 Proof – 2 - 16
CS-708
20 Proof – 2 - 16d
CS-708
Topic: Logic
Summary
• Propositional logic
• Introduction
• Facts
• Syntax
• Operators
• Properties of operators
• Connectives
• Precedence of connectives