Syntax and semantics of propositional logic, truth tables, validity, satisfiability and entailment, the key logical equivalences, converting to CNF, sound inference rules (modus ponens, modus tollens, resolution), proof by resolution refutation, Horn clauses with forward and backward chaining, and knowledge-based agents.
Atomic propositions (p,q,r, or names like Raining) are combined with connectives:
Connective
Symbol
Read as
negation
¬p
not p
conjunction
p∧q
p and q
disjunction
p∨q
p or q (inclusive)
implication
p→q
if p then q
biconditional
p↔q
p if and only if q
Precedence (highest first): ¬, ∧, ∨, →, ↔.
Semantics
A model (interpretation) assigns true/false to every atom; the truth of compound sentences follows the truth tables:
p
q
¬p
p∧q
p∨q
p→q
p↔q
T
T
F
T
T
T
T
T
F
F
F
T
F
F
F
T
T
F
T
T
F
F
F
T
F
F
T
T
Term
Meaning
Valid (tautology)
true in every model, e.g. p∨¬p
Satisfiable
true in at least one model
Unsatisfiable (contradiction)
true in no model, e.g. p∧¬p
Entailment KB⊨α
α is true in every model of KB
Equivalence α≡β
same truth value in every model
Key facts: α is valid iff ¬α is unsatisfiable; KB⊨α iff KB→α is valid iff KB∧¬α is unsatisfiable.
Logical equivalences
Law
Equivalence
Double negation
¬¬p≡p
De Morgan
¬(p∧q)≡¬p∨¬q; ¬(p∨q)≡¬p∧¬q
Implication elimination
p→q≡¬p∨q
Contrapositive
p→q≡¬q→¬p
Biconditional
p↔q≡(p→q)∧(q→p)
Distributivity
p∨(q∧r)≡(p∨q)∧(p∨r); dually
Commutativity, associativity
for ∧ and ∨
Exportation
(p∧q)→r≡p→(q→r)
Absorption
p∨(p∧q)≡p
Normal forms
Literal: an atom or its negation. Clause: a disjunction of literals.
CNF (conjunctive normal form): a conjunction of clauses — the input to resolution and SAT solvers.
DNF: a disjunction of conjunctions of literals.
Conversion to CNF: (1) eliminate ↔ and →; (2) push ¬ inwards with De Morgan and double negation; (3) distribute ∨ over ∧.
Inference rules
Rule
Premises
Conclusion
Modus ponens
α→β, α
β
Modus tollens
α→β, ¬β
¬α
And-elimination
α∧β
α
Hypothetical syllogism
α→β, β→γ
α→γ
Disjunctive syllogism
α∨β, ¬α
β
Resolution
ℓ1∨⋯∨ℓk∨p, ¬p∨m1∨⋯∨mn
ℓ1∨⋯∨ℓk∨m1∨⋯∨mn
A procedure is sound if it derives only entailed sentences and complete if it can derive every entailed sentence.
Resolution refutation
To prove KB⊨α: convert KB∧¬α to CNF and repeatedly resolve pairs of clauses; deriving the empty clause (a contradiction) proves entailment. Resolution refutation is sound and complete for propositional logic.
Horn clauses and chaining
A Horn clause has at most one positive literal: facts (q), rules (p1∧⋯∧pk→q), and goals/constraints (¬p1∨⋯∨¬pk). For Horn knowledge bases, inference takes linear time:
Forward chaining (data-driven): repeatedly fire rules whose premises are all known, adding conclusions until the query appears or nothing changes.
Backward chaining (goal-driven): to prove q, find a rule concluding q and recursively prove its premises (the basis of Prolog).
Knowledge-based agents
An agent keeps a knowledge base, TELLs it percepts, ASKs it what to do, and acts. The Wumpus world is the textbook example: from "breeze in [1,2]" and the rule "a square is breezy iff a neighbour has a pit", the agent infers where pits might be. Propositional logic is limited because it cannot express general statements about objects compactly — that is what predicate logic adds.
Quick revision
Practice questions
GATE-style questions: 4 one-mark and 6 two-mark. Wrong MCQs cost ⅓ of their marks in the real exam; MSQ and NAT have no negative marking. Attempt each before opening the solution.
Q1MCQ1 mark
The implication p→q is logically equivalent to
Q2MSQ2 marks
Which of the following are tautologies (true under every assignment)?
One or more options are correct.
Q3NAT2 marks
Over the variables p,q,r, the number of truth assignments that satisfy (p∨q)∧¬r is ______.
Q4MCQ2 marks
The conjunctive normal form of (p∧q)→r is
Q5MCQ1 mark
A knowledge base KB entails a sentence α (KB⊨α) if and only if
Q6NAT2 marks
Over p,q,r, the number of models of (p→q)∧(q→r) is ______.
Q7MCQ2 marks
Applying the resolution rule to the clauses (p∨q) and (¬p∨r) yields
Q8MSQ2 marks
Which of the following inference patterns are sound?
One or more options are correct.
Q9NAT1 mark
The number of rows in a truth table over 5 propositional variables is ______.
Q10MCQ1 mark
Which clause is a Horn clause (at most one positive literal)?