Why propositional logic is not enough, the syntax of first-order logic (constants, variables, predicates, functions, quantifiers), semantics over a domain, translating English sentences (and the classic ∀/→ and ∃/∧ pattern), quantifier negation and ordering, valid equivalences, prenex form and Skolemisation, unification and the most general unifier, and first-order resolution and chaining.
Propositional logic needs a separate symbol for every fact: "Socrates is mortal", "Plato is mortal", … and cannot say "all men are mortal" in one sentence. First-order logic (FOL), also called predicate logic, talks about objects, their properties and relations, with quantifiers over all objects.
Syntax
Element
Examples
Denotes
Constants
Ravi, 2, Delhi
specific objects
Variables
x,y,z
arbitrary objects
Functions
Father(x), x+1
maps objects to objects (a term)
Predicates
Student(x), Loves(x,y), x>y
properties/relations (true or false)
Connectives
¬,∧,∨,→,↔
as in propositional logic
Quantifiers
∀x (for all), ∃x (there exists)
Equality
t1=t2
Terms (constants, variables, function applications) denote objects; atomic sentences apply a predicate to terms. A variable is bound if it is in the scope of a quantifier, otherwise free; a sentence has no free variables.
Semantics
An interpretation fixes a non-empty domain of objects and maps constants to objects, functions to functions, predicates to relations. Then:
∀xφ is true iff φ is true for every object assigned to x;
∃xφ is true iff φ is true for at least one object.
Translating English
English
FOL
Everyone loves someone
∀x∃yLoves(x,y)
Someone is loved by everyone
∃y∀xLoves(x,y)
Every student takes at least one course
∀x(Student(x)→∃c(Course(c)∧Takes(x,c)))
There is exactly one president
∃x(Pres(x)∧∀y(Pres(y)→y=x))
Not every bird flies
¬∀x(Bird(x)→Flies(x))≡∃x(Bird(x)∧¬Flies(x))
Equivalences
Rule
Equivalence
Quantifier negation
¬∀xφ≡∃x¬φ; ¬∃xφ≡∀x¬φ
Distribution
∀x(φ∧ψ)≡∀xφ∧∀xψ; ∃x(φ∨ψ)≡∃xφ∨∃xψ
Not distributive
∀x(φ∨ψ)≡∀xφ∨∀xψ; ∃x(φ∧ψ)≡∃xφ∧∃xψ
Same quantifiers commute
∀x∀y≡∀y∀x; ∃x∃y≡∃y∃x
Scope (x not free in ψ)
∀x(φ→ψ)≡(∃xφ)→ψ
Normal forms for inference
To use resolution, convert sentences to clausal form:
Eliminate ↔ and →.
Move ¬ inwards (including quantifier negation).
Standardise variables apart (distinct names for distinct quantifiers).
Skolemise: replace each existential variable by a new constant (if not inside any ∀) or a new function of the enclosing universal variables.
Drop the universal quantifiers (all remaining variables are implicitly universal).
Distribute ∨ over ∧ to get CNF clauses.
Unification
To apply inference rules, find a substitutionθ making two expressions identical. The most general unifier (MGU) commits as little as possible.
Expressions
MGU
Knows(John,x), Knows(John,Jane)
{x/Jane}
Knows(John,x), Knows(y,Bill)
{x/Bill,y/John}
Knows(John,x), Knows(y,Mother(y))
{y/John,x/Mother(John)}
Knows(John,x), Knows(x,Elizabeth)
fail (standardise apart first: then {x1/Elizabeth,x2/John})
P(x), P(f(x))
fail — occurs check (x cannot contain itself)
Inference in FOL
Generalised modus ponens: from p1′,…,pn′ and (p1∧⋯∧pn→q), with θ unifying each pi′ with pi, infer qθ. Basis of forward and backward chaining over definite clauses (Prolog, production systems).
Resolution with unification: from (ℓ∨A) and (¬m∨B) where θ=MGU(ℓ,m), infer (A∨B)θ. Refutation-complete: if KB ⊨α, resolution on KB ∧¬α derives the empty clause.
Decidability: entailment in FOL is only semi-decidable — if KB ⊨α, a complete procedure eventually proves it, but if not, it may run forever.
Quick revision
Practice questions
GATE-style questions: 2 one-mark and 7 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.
Q1MCQ2 marks
Which formula correctly expresses "Every student loves some course"?
Q2MCQ1 mark
¬∀xP(x) is equivalent to
Q3MCQ2 marks
Which formula expresses "Some student is not happy"?
Q4MSQ2 marks
Which of the following are valid (true in every interpretation)?
One or more options are correct.
Q5MCQ2 marks
The most general unifier of P(x,f(y)) and P(a,f(b)), where a and b are constants, is
Q6MCQ2 marks
Skolemising ∀x∃yLoves(x,y) gives
Q7NAT2 marks
Over the domain {1,2,3} with the usual >, for how many values of x is ∃y(y>x) true? ______
Q8MCQ1 mark
Can P(x,x) be unified with P(a,b), where a and b are distinct constants?