You are on page 1of 43

Propositional and

Predicate logic

GROUP 1
Discrete Structures
Computer Science
Introduction to Team
• Abhilasha Gupta 09010
• Bhoomika Bisht 090101053
• Bini Joseph 090101054
• Haneef Khan -------------
• Igulu Kingsley Theophilus -------------
• Ishan Bhatt 090101086
• Parul Verma 090101123
• Priyanka Singh 090101130
• Sameeksha Sahai 090101148
• Sanchit Rana 090101150
• TIrupathi Balaji 0901011
Contents
PROPOSITIONAL LOGIC
What is Proposition?
• Also known as Statement.
• Declarative sentence that is either
TRUE or FALSE but not both.
Examples of Proposition
• The sun rises in the west. FALSE

• 2 + 4 =6. TRUE

• Do you speak Hindi? QUESTION

• Close the door. COMMAND


Types of Proposition
• Atomic Proposition

• Compound Proposition
Cannot be further subdivided.

Atomic Proposition
• Consists of a single Propositional Variable or a
single Propositional Constant.

• Examples:
o (5, 6) (5, 6, 7)
o3+4=7
• Formed by the
o combination of two or more propositions by means of
logical operators
o Connectives of two or more propositions.
o By negating a single proposition.

Compound Proposition
• Examples:
o p : Paris is in France.
Compound
~p : Paris is not in France. Proposition
o p : Ram is healthy.
q : He has blue eyes.
p^q : Ram is healthy and has blue eyes. Proposition
Compound
Basic Logical Operations
Symbols Connective Nature of the Symbolic Negation
Used Word compound form
statement
~,¬,ı Not Negation ~p ~(~p) = p

^ And Conjuction p^q (~p) v (~q)


v Or Disjunction pvq (~p) ^ (~q)
=>, ―> If...then Implication p―>q p ^ (~q)
(Conditional)
<=>,<―> If and only Equivalence p<―>q [p ^ (~q)] v [q ^ (~p)]
if (Bi-Conditional)
p : Today is Monday.
q : It is raining.
Examples
NEGATION
~p : Today is not Monday. ~q : It is not raining.
p ^ q : Today is Monday and it is raining. CONJUCTION

DISJUNCTION p v q : Today is Monday or it is raining.


p ―> q : If today is Monday, then it is raining.
IMPLICATION
EQUIVALENCE
p ―> q : Today is Monday if and only if it is raining.
TRUTH TABLES
NOT p

NEGATION

p ~p
0 1
1 0
p and q

CONJUCTION
p q p^q
0 0 0
0 1 0
1 0 0
1 1 1
p or q

DISJUNCTION
p q pvq
0 0 0
0 1 1
1 0 1
1 1 1
If p, then q.
p -> q = p ^ (~q)

IMPLICATION
p q p -> q
0 0 1
0 1 1
1 0 0
1 1 1
p if and only if q.
p <-> q = [(p -> q) ^ (q -> p)] = [{p ^ (~q)} v {q ^ (~p)}]

EQUIVALENCE
p q p <-> q
0 0 1
0 1 0
1 0 0
1 1 1
If q, then p.
The converse of p -> q = p ^ (~q) is q -> p

CONVERSE
p q p -> q q -> p
0 0 1 1
0 1 1 0
1 0 0 1
1 1 1 1
If Not q, then Not p.
The inverse of p -> q = p ^ (~q) is (~q) -> (~p).

INVERSE
p q p -> q (~p) -> (~q)
0 0 1 1
0 1 1 0
1 0 0 1
1 1 1 1
If Not p, then Not q.
The inverse of p -> q = p ^ (~q) is (~p) -> (~q).

CONTRAPOSITIVE
p q p -> q (~q) -> (~p)
0 0 1 1
0 1 1 1
1 0 0 0
1 1 1 1
How to NEGATE a compound statement?

Replace 0’s by 1 and 1’s by 0.


Replace ^’s by v and v’s by ^.
Conjunction is replaced by disjunction.
Disjunction is replaced by conjunction.
NEGATION

p^q

pvq p -> (~q) or (~p) -> q

p -> q pvq

p <-> q p^q

(~p) <-> q or p <-> (~q)


TAUTOLOGIES

TRUE or FALSE?
Compound propositions that is always TRUE for all
possible truth values of its variables.

Examples:-
TRUE
The professor is either a woman or man.
People either know your name or they TRUE
don’t.
CONTRADICTIONS

TRUE or FALSE?
Compound propositions that is always FALSE for all
possible truth values of its variables.

Examples:-
All men are good and all men are bad. FALSE
X is prime and x is an even number
FALSE
greater than 8.
Algebra of Propositions
• Identity
p ^ 1 <=> p
p ∨ 0 <=> p
• Domination
p ∨ 1 <=> 1
p ^ 0 <=> 0
• Idempotent
p ∨ p <=> p
p ^ p <=> p
• Double negation
~(~p) <=> p
• Commutative
p ∨ q <=> q ∨ p
p ^ q <=> q ^ p
• Associative
(p ∨ q) ∨ r <=> p ∨ (q ∨ r)
(p ^ q) ^ r <=> p ^ (q ^ r)
• Distributive
p ∨ (q ^ r) <=> (p ∨ q) ^ (p ∨ r)
p ^ (q ∨ r) <=> (p ^ q) ∨ (p ^ r)
• De Morgan
~( p ∨ q ) <=> ~p ^ ~q
( p ^ q ) <=> ~p ∨ ~q
• Other useful equivalences
p ∨ ~p <=> 1
p ^ ~p <=> 0
p → q <=> (~p ∨ q)
General rule for translation

Translations
Look for patterns corresponding to logical
connectives in the sentence and use them to define
elementary propositions.

Step 1 :Find Logical Connectives.

Step 2 :Break the sentence into


elementary prepositions.

Step 3 :Re-write the sentence in


prepositional logic.
This mobile is good and cheap.

Example
Step 1 :Find Logical Connectives. and
Step 2 : Break the sentence into p: This computer is good.
elementary prepositions. q: This computer is cheap.

Step 3 : Re-write the sentence in


prepositional logic.
p^q
PREDICATE LOGIC
Everybody loves Somebody

What is Predicate Logic?


A predicate is a statement that contains a finite
number of variables.

Becomes a proposition when specific values are


substituted for the variables.
Predicate logic is the generalization of
Propositional logic
Physics is a subject.

Mathematics is a subject.

Examples
 Object: Physics, Mathematics.

 “Is a subject” is a predicate

 Relation: the object is related to the predicate

 Function:
Replace the object by variable x
P(x) symbolizes the sentence “x is a subject”
Thus,
P(x) : x is a subject is the predicate logic and it becomes
proposition when specific values like ‘Physics’ or ‘Mathematics’
are substituted.
To convert propositional logic to
predicate logic

To change predicates into statements we need to


assign specific values to their variables. Another
way is to add quantifiers.
Quantifiers are words that refer to quantities such as
“some ” or “all” and indicates how frequently a certain
statement is true.
 x P(x) means “for all x, P(x)”

Universal Quantifiers
P(x) is true for all x in the universe
of discourse.
 x P(x) is TRUE if P(x) is true for
every single x.
 x P(x) is FALSE, if there is a x for
which P(x) is false.
 x P(x) means “for some x, P(x)”

Existential Quantifiers
P(x) is true for some x in the universe
of discourse.
 x P(x) is TRUE, if there is a x for which
P(x) is true.
 x P(x) is FALSE, if P(x) is false for every
single x.
General rule: To negate a quantifier, move
negation to the right, changing quantifiers as
you go.

Negation of Quantifiers
( x P(x)) is the same as  x P(x).

( x P(x)) is the same as  x P(x).


A variable is bound if it is known or quantified.
Otherwise, it is free.

Free and Bound Variables


Examples: Reminder:
In a proposition, all
P(x) x is free variables must be
P(8) x is bound to 8 bound.
 x P(x) x is bound by quantifier
Multiple Quantifiers
xy P(x,y)
• For all x and y, P(x, y) is true.

xy P(x,y)
• For at least one x and y for which P(x, y) is true.

xy P(x,y)
• For all x, there is at least one y for which P(x, y) is true.

xy P(x,y)
• There is at least one x that can map with all y such that P(x, y)
is true
Rule of Inference
Addition Conjunction
P P
---------------- Q
.: P v Q ----------------
.: P ^ Q

Simplification
P^Q
----------------
.: P
Rule of Inference(Contd.)
Modus Ponens Modus Tollens
P Q PQ
P ~Q
---------------- ----------------
.: Q .: ~P

Hypothetical Syllogism
PQ
QR
----------------
.: P  R
Rule of Inference(Contd.)
Disjunction Constructive
Syllogism Dilemma
PvQ (PQ) ^ (R  S)
~P PvR
---------------- ----------------
.: Q .: Q v S

Destructive
Dilemma
(PQ) ^ (R  S)
~Q v ~S
----------------
.: ~P  ~R
To conclude…
Predicate logic is distinguished from
propositional logic by its use of quantifiers.

Each interpretation of predicate logic includes a


domain of discourse over which the quantifiers
range.
Queries if Any

You might also like