Propositional and first-order (predicate) logic for AI: syntax, truth tables, validity and entailment, normal forms, inference by resolution, quantifiers and translation of English, and unification. GATE asks tautology checks, entailment, quantifier negation and MGUs.
1. Propositional logic: truth, validity and entailment
A proposition is a statement that is true or false. Formulas are built with , , , and . A model (interpretation) assigns T or F to every symbol; with symbols there are models.
is false only when is T and is F.
is true when both sides have the same value.
A formula is a tautology (valid) if true in every model, a contradiction (unsatisfiable) if true in none, and satisfiable if true in at least one.
Entailment: means is true in every model where is true. Two key equivalences:
The second form is the basis of proof by refutation.
Law
Equivalence
Implication
Contrapositive
De Morgan
,
Biconditional
Distribution
Exportation
The converse and the inverse are not equivalent to .
2. Normal forms and inference by resolution
A literal is a symbol or its negation. A clause is a disjunction of literals. A formula is in CNF if it is a conjunction of clauses and in DNF if it is a disjunction of conjunctions of literals. To reach CNF: remove and , push inward (De Morgan), then distribute over .
An inference procedure is sound if it derives only entailed formulas and complete if it can derive every entailed formula.
Modus ponens: from and , infer .
Modus tollens: from and , infer .
Resolution: from and , infer , called the resolvent.
Resolution is sound, and resolution refutation is complete for propositional logic: to show , convert to CNF and resolve pairs of clauses until the empty clause appears (a contradiction). If no new clause can be added and the empty clause never appears, .
A Horn clause has at most one positive literal, for example , that is . For Horn knowledge bases, forward chaining (data-driven: fire rules whose premises are known) and backward chaining (goal-driven: work back from the query) decide entailment in time linear in the size of the KB.
Resolution refutation: adding the negated goal ¬R to the knowledge base derives the empty clause
3. First-order (predicate) logic: quantifiers and translation
First-order logic (FOL) adds objects, predicates (properties and relations, such as ), functions (such as ) and quantifiers over a domain.
: holds for every object in the domain.
: holds for at least one object.
The standard translation patterns:
English
FOL
All students are clever
Some student is clever
No student is clever
Not all students are clever
Use with and with . says everything is a clever student, and is true as soon as one non-student exists.
Negation flips the quantifier: and . Apply it one quantifier at a time, left to right.
Order matters for mixed quantifiers: (one liked by everyone) implies (everyone likes someone), but not the other way round. Quantifiers of the same kind commute: . Also distributes over and over , but not the reverse.
4. Inference in first-order logic: Skolemisation and unification
To run resolution in FOL, every sentence is turned into clausal form:
Remove and ; push inward (flipping quantifiers).
Standardise apart: give each quantifier its own variable name.
Skolemise: replace each existentially quantified variable by a new constant, or by a Skolem function of the universal variables in whose scope it lies. becomes .
Drop the universal quantifiers and convert to CNF.
Universal instantiation lets us replace a variable by any ground term; existential instantiation introduces a new constant (once).
A substitution such as replaces variables by terms. Two atoms unify if some makes them identical. The most general unifier (MGU) is the one that commits the least; every other unifier is an instance of it. Rules of thumb:
Predicate names and argument counts must match.
Different constants never unify; a function term never unifies with a constant or a different function.
Occurs check: cannot be bound to a term containing , such as .
For example, and have MGU .
First-order resolution resolves two clauses after applying the MGU of a complementary pair. It is sound and refutation-complete, but validity in FOL is only semi-decidable: if a proof will be found, otherwise the search may run forever.
Formulas to remember
Implication
Contrapositive
Entailment by refutation
Resolution rule
Quantifier negation
Skolemisation
Number of modelsFor propositional symbols
Common mistakes
Treating as equivalent to its converse or its inverse .
Writing for "all students are clever"; pairs with , pairs with .
Swapping the order of and ; is weaker than .
In resolution, resolving on two complementary pairs at once; resolve on exactly one literal pair per step.
Forgetting the occurs check: never unifies with a term like .
Concluding from a model where both are true; entailment needs true in every model of .
Worked examples
Try each step yourself, then reveal the working.
Example 1: Entailment by truth table
numerical
Let . Does ? How many of the 8 models satisfy ?
Step 1: List when the KB is true.
Try it on paper first.
Example 2: A resolution refutation
conceptual
From , prove by resolution.
Step 1: Convert the KB and the negated goal to clauses.
Try it on paper first.
Example 3: Translate and negate a quantified sentence
conceptual
Write "Every student has a friend who likes maths" in FOL, using , for " is a friend of " and . Then write its negation with only on atoms.
Step 1: Translate from the outside in.
Try it on paper first.
Example 4: Finding a most general unifier
conceptual
Find the MGU of and , where is a constant. Also say whether and unify.
Step 1: Match the first arguments.
Try it on paper first.
Previous year questions
7 official GATE DA questions on this topic, newest first.
10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.
Mark as mastered
Loading your progress…
My revision notes
Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.