Propositional and predicate logic — Unit 2 Notes (Discrete Structures and Theory of Logic)

BCS302 · Unit 2

Propositional and predicate logic notes — Unit 2

Free unit-wise study notes on propositional and predicate logic for Discrete Structures and Theory of Logic, Semester 3 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.

A deep dive into Propositional Logic, Truth Tables, Tautologies, Normal Forms (DNF/CNF), Predicate Logic, and Rules of Inference. The foundation of artificial intelligence and formal verification.

Notebook — 14 pages

Page 1

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

1. Introduction to Propositional Logic

Logic is the study of formal reasoning based on statements. The fundamental building block is a Proposition.

1.1 What is a Proposition?

A proposition (or statement) is a declarative sentence that is either True (T) or False (F), but not both.

  • Valid Propositions: "Delhi is the capital of India" (True). "2+2=52 + 2 = 5" (False).
  • Invalid Propositions: "What time is it?" (Question). "Close the door!" (Command). "x+5=10x + 5 = 10" (Variables make it a predicate, not a proposition, until xx is defined).

1.2 Compound Propositions

Simple propositions can be combined using logical connectives to form compound propositions.

Next — Logical Connectives

1 of 14

Page 2

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

2. Logical Connectives & Truth Tables

Logical connectives dictate how the truth value of a compound proposition is derived from its constituent propositions.

2.1 Basic Connectives

  • Negation (¬P\neg P or P\sim P): "NOT". Reverses the truth value. If PP is True, ¬P\neg P is False.
  • Conjunction (PQP \land Q): "AND". True only if both PP and QQ are True.
  • Disjunction (PQP \lor Q): "OR". True if at least one of PP or QQ is True.
  • Exclusive OR (PQP \oplus Q): "XOR". True if exactly one of PP or QQ is True, but not both.

2.2 Conditional Connectives

  • Implication (PQP \to Q): "If P, then Q". PP is the hypothesis/antecedent, QQ is the conclusion/consequent. This is False only when PP is True and QQ is False. In all other cases, it is True.
  • Biconditional (PQP \leftrightarrow Q): "P if and only if Q" (iff). True when PP and QQ have the exact same truth value.

Next — Implication Variants

2 of 14

Page 3

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

3. Variations of Implication

Given a standard conditional statement PQP \to Q, there are three related conditional statements.

  • Converse: QPQ \to P
  • Inverse: ¬P¬Q\neg P \to \neg Q
  • Contrapositive: ¬Q¬P\neg Q \to \neg P

3.1 Logical Equivalence of Contrapositive

A very important rule in mathematical proofs is that a statement is logically equivalent to its contrapositive.

(PQ)(¬Q¬P)(P \to Q) \equiv (\neg Q \to \neg P)

However, a statement is not logically equivalent to its converse or inverse. (Though the converse and inverse are equivalent to each other).

Next — Tautologies, Contradictions, and Contingencies

3 of 14

Page 4

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

4. Tautology and Contradiction

We classify compound propositions based on their final truth tables.

  • Tautology: A compound proposition that is always True, regardless of the truth values of its constituent variables. Example: P¬PP \lor \neg P.
  • Contradiction (Fallacy): A compound proposition that is always False. Example: P¬PP \land \neg P.
  • Contingency: A proposition that is neither a tautology nor a contradiction (it can be True or False depending on the variables).

4.1 Satisfiability

A proposition is satisfiable if there is at least one assignment of truth values to its variables that makes it True. (Therefore, tautologies and contingencies are satisfiable, but contradictions are not).

Next — Logical Equivalence

4 of 14

Page 5

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

5. Logical Equivalence

Two propositions AA and BB are logically equivalent (denoted ABA \equiv B) if they have identical truth tables.

Alternatively, ABA \equiv B if and only if the biconditional ABA \leftrightarrow B is a tautology.

5.1 Key Logical Equivalences (Laws of Logic)

These are identical to the laws of Set Theory:

  • De Morgan's Laws: ¬(PQ)¬P¬Q\neg(P \land Q) \equiv \neg P \lor \neg Q and ¬(PQ)¬P¬Q\neg(P \lor Q) \equiv \neg P \land \neg Q
  • Implication Equivalence: PQ¬PQP \to Q \equiv \neg P \lor Q (This is heavily used to convert implications into standard AND/OR logic).
  • Biconditional Equivalence: PQ(PQ)(QP)P \leftrightarrow Q \equiv (P \to Q) \land (Q \to P)
  • Distributive Laws: P(QR)(PQ)(PR)P \lor (Q \land R) \equiv (P \lor Q) \land (P \lor R)

Next — Normal Forms (DNF and CNF)

5 of 14

Page 6

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

6. Normal Forms

A proposition can be rewritten into standardized formats known as Normal Forms using logical equivalences. This is crucial for automated theorem proving.

6.1 Disjunctive Normal Form (DNF)

A formula is in DNF if it is a sum of products (OR of ANDs). It consists of disjunctions of conjunctions.

Example: (PQ)(¬PR)(Q¬R)(P \land Q) \lor (\neg P \land R) \lor (Q \land \neg R)

A Principal DNF (PDNF) (or Sum of Minterms) is a DNF where every conjunction contains all variables exactly once (either negated or unnegated).

6.2 Conjunctive Normal Form (CNF)

A formula is in CNF if it is a product of sums (AND of ORs). It consists of conjunctions of disjunctions.

Example: (PQ)(¬PR)(Q¬R)(P \lor Q) \land (\neg P \lor R) \land (Q \lor \neg R)

A Principal CNF (PCNF) (or Product of Maxterms) is a CNF where every disjunction contains all variables exactly once.

Next — Rules of Inference

6 of 14

Page 7

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

7. Rules of Inference

Rules of inference are templates for creating valid mathematical arguments. A valid argument ensures that if the premises are True, the conclusion must absolutely be True.

7.1 Modus Ponens (Law of Detachment)

Premise 1: PQP \to Q
Premise 2:
PP
Conclusion:
Q\therefore Q

7.2 Modus Tollens

Premise 1: PQP \to Q
Premise 2:
¬Q\neg Q
Conclusion:
¬P\therefore \neg P

7.3 Hypothetical Syllogism

Premise 1: PQP \to Q
Premise 2:
QRQ \to R
Conclusion:
PR\therefore P \to R

7.4 Disjunctive Syllogism

Premise 1: PQP \lor Q
Premise 2:
¬P\neg P
Conclusion:
Q\therefore Q

Next — Predicate Logic (First-Order Logic)

7 of 14

Page 8

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

8. Predicate Logic

Propositional logic cannot handle statements with variables, such as "x>3x > 3". This is where Predicate Logic (or First-Order Logic) comes in.

8.1 Predicates

A predicate is a statement containing one or more variables, which becomes a proposition when values are substituted for the variables.

Let P(x)P(x) denote "x>3x > 3".
P(4)P(4) is True (proposition).
P(2)P(2) is False (proposition).

8.2 Universe of Discourse (Domain)

The set of all possible values that can be substituted for the variables in a predicate. If P(x)P(x) is "xx is a student", the domain might be "all people in the university".

Next — Quantifiers

8 of 14

Page 9

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

9. Quantifiers

Quantifiers are used to express the extent to which a predicate is true over a domain.

9.1 Universal Quantifier (\forall)

Read as "For all" or "For every".

xP(x)\forall x P(x) means P(x)P(x) is true for every xx in the domain.

9.2 Existential Quantifier (\exists)

Read as "There exists" or "For some".

xP(x)\exists x P(x) means there is at least one xx in the domain for which P(x)P(x) is true.

9.3 Bound vs Free Variables

A variable is bound if a quantifier is attached to it. A variable is free if it is not bound.
In
xP(x,y)\forall x P(x, y), xx is bound, but yy is free.

Next — Negation of Quantifiers

9 of 14

Page 10

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

10. Negation of Quantifiers (De Morgan's for Predicates)

When we negate a quantified statement, the quantifier flips and the negation moves inside to the predicate.

10.1 Negating Universal

¬(xP(x))x¬P(x)\neg(\forall x P(x)) \equiv \exists x \neg P(x)

"It is not true that everyone is happy" \equiv "There exists someone who is not happy."

10.2 Negating Existential

¬(xP(x))x¬P(x)\neg(\exists x P(x)) \equiv \forall x \neg P(x)

"It is not true that there exists a flying pig" \equiv "All pigs do not fly."

Next — Nested Quantifiers

10 of 14

Page 11

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

11. Nested Quantifiers

Complex statements require multiple quantifiers. The order in which they appear drastically changes the meaning of the statement.

11.1 Same Quantifiers

The order does not matter if the quantifiers are the same.

xyP(x,y)yxP(x,y)\forall x \forall y P(x,y) \equiv \forall y \forall x P(x,y)

11.2 Mixed Quantifiers (Order Matters!)

xyP(x,y)\forall x \exists y P(x,y) is NOT equivalent to yxP(x,y)\exists y \forall x P(x,y).

  • Let L(x,y)L(x, y) be "x loves y".
  • xyL(x,y)\forall x \exists y L(x, y): "For every person xx, there is someone yy that they love." (Everyone loves somebody).
  • yxL(x,y)\exists y \forall x L(x, y): "There is someone yy who is loved by every person xx." (There is one specific person whom everyone loves).

Next — Inference with Quantifiers

11 of 14

Page 12

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

12. Inference with Quantifiers

To apply rules of inference (like Modus Ponens) to quantified statements, we must first remove the quantifiers using Instantiation, apply the rules on specific elements, and then re-apply quantifiers using Generalization.

12.1 Four Rules of Instantiation/Generalization

  • Universal Instantiation: If xP(x)\forall x P(x) is true, then P(c)P(c) is true for any arbitrary element cc in the domain.
  • Universal Generalization: If P(c)P(c) is proven true for an arbitrary element cc, then we can conclude xP(x)\forall x P(x).
  • Existential Instantiation: If xP(x)\exists x P(x) is true, there is some specific element cc for which P(c)P(c) is true. (You cannot assume cc is arbitrary).
  • Existential Generalization: If P(c)P(c) is true for a specific element cc, then we can conclude xP(x)\exists x P(x).

Next — Mathematical Induction

12 of 14

Page 13

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

13. Mathematical Induction

A powerful proof technique used to prove that a proposition P(n)P(n) is true for all positive integers nn.

13.1 Principle of Mathematical Induction

  • Step 1 (Base Case): Prove that P(1)P(1) is true.
  • Step 2 (Inductive Hypothesis): Assume that P(k)P(k) is true for some arbitrary positive integer kk.
  • Step 3 (Inductive Step): Using the assumption from Step 2, prove that P(k+1)P(k+1) is true.

If all three steps are successful, then by the principle of mathematical induction, P(n)P(n) is true for all n1n \ge 1.

13.2 Strong Induction

A variant where the inductive hypothesis assumes that P(1),P(2),,P(k)P(1), P(2), \dots, P(k) are all true, and uses this stronger assumption to prove P(k+1)P(k+1).

Next — Summary & Review Checklist

13 of 14

Page 14

Wink Notes

B.Tech CSE — 3rd Semester

Discrete Structures and Theory of Logic

Unit - 2

14. Summary & Review Checklist

Logic is the grammar of computer science.

14.1 University Exam Checklist

  • Construct a truth table to prove that two compound propositions are logically equivalent.
  • Convert a given proposition into Principal Disjunctive Normal Form (PDNF) and Principal Conjunctive Normal Form (PCNF).
  • Translate English sentences into Predicate Logic using quantifiers.
  • Write the negation of a nested quantified statement (e.g., ¬(xyP(x,y))\neg(\forall x \exists y P(x,y))).
  • Test the validity of an argument using rules of inference (Modus Ponens, Modus Tollens).
  • Prove a formula (like the sum of the first nn numbers) using Mathematical Induction.

14.2 Application Focus

  • How does Propositional Logic directly map to Digital Logic gates (AND/OR/NOT)?
  • How is Predicate Logic used in Artificial Intelligence (specifically in rule-based expert systems and Prolog)?
  • How does the concept of Satisfiability relate to the famous boolean SAT problem in algorithm complexity?

14 of 14

Continue in this subject