Unit 3: Propositional




Propositional Logic

Propositional Logic (also called Statement Logic) is a branch of logic that deals with statements (propositions) which are either true (T) or false (F), but not both.

It is a very important unit for MCA students because it is widely used in:

  • Computer programming
  • Digital circuits
  • Artificial Intelligence
  • Database queries
  • Compiler design

Propositions

A proposition is a declarative statement that has a definite truth value, either true or false.

Examples

  • “2 + 3 = 5” → True
  • “Lucknow is the capital of UP” → True
  • “5 is a prime number” → True

Not Propositions

  • Questions: “What is your name?”
  • Commands: “Close the door”
  • Open statements: “x > 5” (truth depends on x)

Simple and Compound Propositions

TypeDescriptionExample
SimpleCannot be broken furtherp: 5 > 3
CompoundFormed using connectivesp ∧ q

Logical Connectives (Operators)

Logical connectives are used to join propositions.

SymbolNameMeaningExample
¬NOTNegation¬p
ANDConjunctionp ∧ q
ORDisjunctionp ∨ q
IF–THENImplicationp → q
IF AND ONLY IFBiconditionalp ↔ q

Truth Tables (Very Important for Exams)

A truth table shows all possible truth values of propositions and the resulting truth value of a compound proposition.

Truth Table for NOT (¬)

p¬p
TF
FT

Truth Table for AND (∧)

pqp ∧ q
TTT
TFF
FTF
FFF

Truth Table for OR (∨)

pqp ∨ q
TTT
TFT
FTT
FFF

Truth Table for Implication (→)

pqp → q
TTT
TFF
FTT
FFT

Memory Tip: Implication is false only when p is True and q is False.

Tautology and Contradiction

Tautology

A compound proposition that is always true for all truth values.

Example: p ∨ ¬p

p¬pp ∨ ¬p
TFT
FTT

Contradiction

A compound proposition that is always false.

Example: p ∧ ¬p

p¬pp ∧ ¬p
TFF
FTF

Contingency

A proposition that is sometimes true and sometimes false.

Algebra of Propositions (Logical Laws)

These laws help simplify logical expressions and are heavily asked in exams.

Important Laws

Law NameExpression
Identityp ∧ T = p, p ∨ F = p
Dominationp ∨ T = T, p ∧ F = F
Idempotentp ∧ p = p, p ∨ p = p
Double Negation¬(¬p) = p
Commutativep ∧ q = q ∧ p
Associative(p ∧ q) ∧ r = p ∧ (q ∧ r)
Distributivep ∧ (q ∨ r) = (p ∧ q) ∨ (p ∧ r)

De Morgan’s Laws (Most Important)

ExpressionEquivalent
¬(p ∧ q)¬p ∨ ¬q
¬(p ∨ q)¬p ∧ ¬q

Theory of Inference

Inference is the process of deriving a logical conclusion from one or more given propositions (premises).

Common Rules of Inference

RuleForm
Modus Ponensp, p → q ⟹ q
Modus Tollens¬q, p → q ⟹ ¬p
Hypothetical Syllogismp → q, q → r ⟹ p → r
Disjunctive Syllogismp ∨ q, ¬p ⟹ q

Example (Modus Ponens)

  • If it rains, roads are wet (p → q)
  • It rains (p)
  • Therefore, roads are wet (q)

Natural Deduction (Natural Detection)

Natural Deduction is a formal method of proving the validity of arguments using rules of inference step by step.

It mimics human logical reasoning and is commonly asked as long-answer questions.

Structure of Natural Deduction Proof

  1. Given premises
  2. Apply inference rules
  3. Reach a conclusion

Simple Natural Deduction Example

Premises:

  1. p → q
  2. q → r

Conclusion: ∴ p → r

(Using Hypothetical Syllogism)

Visual Flow (Easy to Memorize)

Proposition → Truth Table → Laws → Tautology / Contradiction
Inference Rules
Natural Deduction

Exam-Oriented Important Points

  • Definition of proposition is frequently asked
  • Truth tables carry high weightage
  • De Morgan’s laws are compulsory
  • Inference rules appear in proof-based questions
  • Natural deduction is asked in long answers

Conclusion

Propositional logic builds the foundation of logical reasoning in computer science. For MCA students, mastering this unit helps in programming logic, algorithm design, and artificial intelligence.

Solved Numerical Problems (Exam-Oriented)

Problem 1: Construct Truth Table

Question: Construct the truth table for the proposition:
F = (p ∧ q) → p

Solution:

pqp ∧ q(p ∧ q) → p
TTTT
TFFT
FTFT
FFFT

Result: Since the final column is always True, the proposition is a Tautology.

Problem 2: Check Whether a Proposition is a Tautology

Question: Prove that p ∨ ¬p is a tautology.

Solution:

p¬pp ∨ ¬p
TFT
FTT

Conclusion: Always true → Tautology

Problem 3: Check Whether a Proposition is a Contradiction

Question: Show that p ∧ ¬p is a contradiction.

Solution:

p¬pp ∧ ¬p
TFF
FTF

Conclusion: Always false → Contradiction

Problem 4: Logical Equivalence Using Laws

Question: Prove that ¬(p ∨ q) ≡ ¬p ∧ ¬q

Solution (Truth Table Method):

pqp ∨ q¬(p ∨ q)¬p¬q¬p ∧ ¬q
TTTFFFF
TFTFFTF
FTTFTFF
FFFTTTT

Conclusion: Both columns are identical → Logically Equivalent (De Morgan’s Law)

Problem 5: Simplification Using Algebra of Propositions

Question: Simplify:
(p ∧ q) ∨ (p ∧ ¬q)

Solution:

(p ∧ q) ∨ (p ∧ ¬q)
= p ∧ (q ∨ ¬q)
= p ∧ T
= p

Problem 6: Validity Using Rules of Inference

Question: From the premises:

  1. p → q

  2. p
    Prove q.

Solution:

  • Given: p → q
  • Given: p
  • By Modus Ponens: q

Conclusion: Argument is Valid

Problem 7: Inference – Modus Tollens

Question: Given:

  1. p → q

  2. ¬q
    Prove ¬p.

Solution: Using Modus Tollens:
∴ ¬p

Problem 8: Hypothetical Syllogism

Question: From the premises:

  1. p → q

  2. q → r
    Derive p → r.

Solution: Using Hypothetical Syllogism:
∴ p → r

Problem 9: Natural Deduction Proof

Question: Prove using natural deduction:
Premises: p → q, q → r
Conclusion: p → r

Solution Steps:

  • p → q (Given)
  • q → r (Given)
  • p → r (By Hypothetical Syllogism)

Problem 10: Classify the Proposition

Question: Determine whether the proposition (p → q) ∧ (q → p) is a tautology, contradiction, or contingency.

Solution (Key Observation): (p → q) ∧ (q → p) ≡ p ↔ q

Truth table gives both T and F values.

Conclusion: Contingency

Predicate Logic

Predicate Logic (also called First Order Logic) is an extension of propositional logic. While propositional logic deals with whole statements, predicate logic analyzes the internal structure of statements using variables, predicates, and quantifiers.

Predicate logic is extremely important in computer science, artificial intelligence, databases, logic programming, and compiler design.

Theory of Predicates

Predicate

A predicate is a statement containing one or more variables that becomes a proposition when specific values are assigned to those variables.

Representation

A predicate is denoted by capital letters such as P(x), Q(x, y).

Examples

  • P(x): x > 5
  • Q(x, y): x + y = 10

These are not propositions until values of x and y are specified.

Domain of Discourse

The domain of discourse is the set of all possible values that a variable can take.

Example:

  • Domain = Natural numbers
  • P(x): x is even

First Order Predicate Logic (FOPL)

First Order Predicate Logic allows:

  • Variables that range over individuals
  • Quantification over variables

It does not allow quantification over predicates or functions.

Difference Between Propositional Logic and Predicate Logic

BasisPropositional LogicPredicate Logic
VariablesPropositionsObjects
StructureSimpleRich & expressive
QuantifiersNot usedUsed

Predicate Formulas

Atomic Formula

An atomic formula is a predicate applied to variables or constants.

Example:

  • P(x)
  • Q(a, b)

Compound Predicate Formula

Compound formulas are formed using:

  • Logical connectives (¬, ∧, ∨, →, ↔)
  • Quantifiers (∀, ∃)

Example: ∀x (P(x) → Q(x))

Well-Formed Formula (WFF)

A well-formed formula is a syntactically correct predicate formula constructed using valid rules.

Quantifiers (Very Important)

Quantifiers specify how many elements in the domain satisfy a predicate.

Universal Quantifier (∀)

  • Meaning: “For all” or “For every”
  • Notation: ∀x P(x)
  • Example: ∀x (x > 0) → All x are greater than zero

Existential Quantifier (∃)

  • Meaning: “There exists” or “At least one”
  • Notation: ∃x P(x)
  • Example: ∃x (x is even)

Negation of Quantifiers (De Morgan Type)

OriginalEquivalent
¬∀x P(x)∃x ¬P(x)
¬∃x P(x)∀x ¬P(x)

Exam Tip: This is very frequently asked.

Order of Quantifiers

∀x ∃y P(x, y) ≠ ∃y ∀x P(x, y)

Order of quantifiers changes the meaning completely.

Inference Theory of Predicate Logic

Inference

Inference is the process of deriving new logical conclusions from given premises.

Predicate logic inference extends propositional inference by handling quantifiers.

Important Rules of Inference in Predicate Logic

RuleForm
Universal Instantiation (UI)∀x P(x) ⟹ P(a)
Existential Instantiation (EI)∃x P(x) ⟹ P(a)
Universal Generalization (UG)P(x) ⟹ ∀x P(x)
Existential Generalization (EG)P(a) ⟹ ∃x P(x)

Example: Universal Instantiation

  • Premise: ∀x (x is mortal)
  • Conclusion: Socrates is mortal

Combined Inference Example

Premises:

  1. ∀x (Human(x) → Mortal(x))
  2. Human(Socrates)

Conclusion: ∴ Mortal(Socrates)

Rules Used:

  • Universal Instantiation
  • Modus Ponens

Validity of Arguments in Predicate Logic

An argument is valid if the conclusion logically follows from the premises using inference rules.

Predicate logic validity often involves:

  • Removing quantifiers
  • Applying inference rules

Common Mistakes (Exam Warning)

  • Confusing ∀ and ∃
  • Wrong negation of quantifiers
  • Ignoring domain of discourse
  • Changing order of quantifiers

Exam-Oriented Important Points

  • Definition of predicate is frequently asked
  • Quantifiers carry high weightage
  • Negation of quantifiers is compulsory
  • Inference rules appear in long answers
  • Examples are important for full marks

Conclusion

Predicate logic increases the expressive power of logic and is essential for modeling real-world problems in computer science. For MCA students, this unit is a bridge between logic theory and practical applications like AI and databases.