CHAP-2 Prepositional and Predicate Logic
CHAP-2 Prepositional and Predicate Logic
SYLLABUS
Propositional logic,
Truth tables,
Predicate logic,
propositional variable.
Propositional variables are usually represented
true or false.
PROPOSITION
not.
Also, (i) and (iii) are true,
p 𝖠 q → r means (p 𝖠 q) →
q
r
T RU T H T A B L E S
A truth table is a table showing the truth value of
a propositional logic formula as a function of its
inputs.
Implication
implications.
Its technical name is the material conditional
operator
T RU T H T A B L E S
N OT E : ¬ p 𝖠 q means ( ¬ p) 𝖠 q an d not ¬ (p 𝖠
q).
TAU T O L O G I E S
AND
CONTRADICTIONS
TAU T O L O G I E S : Some propositions P(p, q, . . .)
contain only T (True) in the last column of their
truth tables or, in other words, they are true for
any truth values of their variables
C O N T R A D I C T I O N S : if propositions P(p, q, . . .)
contains only F in the last column of its truth
table or, in other words, if it is false for any truth
values of its variables.
Note: The negation of a tautology is a
contradiction since it is always false, and the
negation of a contradiction is a tautology since it
is always true.
TAU T O L O G I E S A N D
CONTRADICTIONS
PROVE
[(A→B)𝖠A]→B[(A→B)𝖠A]→B IS A
TAU T O L O GY
PROVE
(A∨B)𝖠[(¬A)𝖠(¬B)](A∨B)𝖠[(¬A)𝖠(¬B)]
IS A CONTRADICTION
CONTINGENCY
A Contingency is a formula which has both some
true and some false values for every value of its
propositional variables.
It is also said to be Satisfiable.
¬ (p 𝖠 q) ≡ ¬ p ∨ ¬ q
if they have identical truth tables.
E xample:
L O G I C A L E Q U I VA L E N C E
Let p be “Roses are red” and q be “Violets are
blue.” Let S be the statement:
“It is not true that roses are red and violets
are
¬ (p 𝖠 q). However,, ¬ (p 𝖠 q) ≡ ¬ p ∨ ¬ q.
blue.” Then S can be written in the form
Because ¬p ∨ p ≡ T
≡ T∨T
≡T
P R O V E (P → Q ) 𝖠 (P → R ) ≡ P → (Q 𝖠
R ).
¬ p ∨ (q 𝖠 r).
Note that, by “Substitution for →”, we have: R H S =
(p → q) 𝖠 (p → r) ≡ (¬ p ∨ q) 𝖠 (¬ p
∨ r)
Substitution
≡ ¬p ∨ (q 𝖠 r)
for → , twice
≡ p → (q 𝖠 r)
Distribution law
CONDITIONAL AND
B I C O N D I T I O N A L S TAT E M E N T S
Conditional statements: “If p then q.” p→ q
The conditional p → q is frequently read
“p implies q” or “p only if q.”
The conditional p → q is false only when the
first part p is true and the second part q is false.
When p is false, the conditional p → q is true
regardless of the truth value of q.
Bi-conditional statements: “p if and only
if q.”
p↔q
The bi-conditional p ↔ q is true whenever p and q
q
“If p then q” is logically equivalent to the
statement “Not p or q”
L O G I C A L E Q U I VA L E N C E S
C O N S T R U C T I N G T H E T RU T H TA B L E
(p → q) 𝖠 (¬p ↔q)
Example: Construct the truth table for
C O N S T R U C T I N G T H E T RU T H TA B L E
C O N S T R U C T I N G T H E T RU T H TA B L E
T R A N S L AT I N G L O G I C A L F O R M U L A S TO
ENGLISH SENTENCES
Using the above logic operators, we can construct
more complicated logical formulas. (They are
called compound propositions.)
Example;
Proposition p: Alice is
smart. Proposition q: Alice is
honest.
T R A N S L AT I N G L O G I C A L F O R M U L A S F RO M
ENGLISH SENTENCES
We can also go in the other direction, translating
English sentences to logical formulas:
Proposition p: Alice is
smart. Proposition q: Alice is
honest
Alice is either smart or honest, but Alice is not
(p ∨ q) 𝖠 (p → ¬ q).
honest if she is smart:
Alice is smart is necessary and sufficient
(p → q) 𝖠 (q → p).
for Alice to be honest:
Translation: A ∨ B → C
C=you can attend a PG-13 movie
T R A N S L AT I O N :G E N E R A L RULE
propositions
You can have free coffee (a) if you are
senior
citizen (b) and it is a Tuesday (c)
Step 3: rewrite the sentence in propositional
logic
Assume two elementary statements:
p: you drive over 65 mph ;
q: you get a speeding ticket
ARGUMENTS
An argument is an assertion that a given set of
propositions P1, P2, . . . , Pn, called premises, yields
(has a consequence) another proposition Q, called
the conclusion.
Such an argument is denoted by P1, P2, . . . , Pn | - Q
is a tautology.
Example: “If p implies q and q implies r, then p
implies r”
That is, the following argument is valid:
p → q, q → r | - p → r (Law of Syllogism)
EXAMPLE:
S 1 : If a man is a bachelor, he is
unhappy. S 2 : If a man is unhappy, he
dies young.
p → q, q → r | - p→ r
where p is “He is a bachelor,” q is “He is
argument is valid.
PROPOSITIONAL FUNCTIONS,
Q UA N T I F I E R S
A propositional function (or an open sentence or
condition) defined on A is an expression
The symbol ∃ which reads “there exists” or
“for some” or “for at least one” is called the
existential quantifier
D UA L I T Y P R I N C I P L E
(P∩Q) 𝖴 (Q∩R)
Example:
C O N J U N C T I V E N O R M A L F O R M (CNF)
A compound statement is in conjunctive normal
form if it is obtained by operating A N D among
variables (negation of variables included) connected
with ORs.
In terms of set operations, it is a compound
statement obtained by Intersection among variables
connected with Unions.
C N F is an 𝖠 of ∨s, where ∨ is over variables or
their negations (literals); an ∨ of literals is also
(P𝖴Q) ∩ (Q𝖴R)
F R O M T RU T H TA B L E TO D N F A N D C N F
A minterm is a conjunction of literals in which
each variable is represented exactly once
but p𝖠 ¬q is not.
(p 𝖠 q 𝖠 r ) ∨ (p 𝖠 ¬q 𝖠 r ) ∨ (¬p𝖠 ¬q 𝖠 r)
D N F of F:
F R O M T RU T H TA B L E TO C N F
Complementation can be used to obtain
conjunctive normal forms from truth tables.
replacing all ∨ by 𝖠
replacing all 𝖠 by ∨
replacing all atoms by their complements.
The complement of q is ¬ q
The complement of ¬ q is q
⚫ (p 𝖠 q) ∨ ¬ r ( ¬ p ∨ ¬ q) 𝖠 r
F R O M T RU T H TA B L E TO C N F
Solution: ¬ G is true for the following
assignments.
p = 1; q = 0; r = 1
p = 1; q = 0; r = 0
p = 0; q = 0; r = 1
(p 𝖠 ¬q 𝖠 r) ∨ ( p𝖠 ¬q 𝖠 ¬r) ∨ (¬p 𝖠
The D N F of ¬ G is therefore:
¬q 𝖠 r)
The formula has the complement:
Example: p ∨ ¬q ∨ r.
A clause is a disjunction of literals.
¬ (p 𝖠 q) ∨ ( ¬ p 𝖠 q) ≡ ¬ p.
Q4. Check if its true or not