Lecture 8: First-Order Logic
Why First-Order Logic?¶
Propositional logic: Cannot express “all,” “some,” “relations”
FOL: Objects, relations, functions, quantifiers
More expressive than propositional logic
Learning Objectives¶
Understand syntax and semantics of first-order logic
Use quantifiers (∀, ∃) and terms
Represent knowledge in FOL
Apply knowledge engineering process
FOL: Basic Elements¶
Objects: People, numbers, etc.
Relations: Brother(John, Mary)
Functions: Mother(John) → person
Predicates: True/false of objects
FOL: Syntax¶
Constants: John, 2
Variables: x, y
Terms: Constants, variables, or f(t₁,...,tₙ)
Atomic sentences: Predicate(term₁,...,termₙ)
Complex: ¬, ∧, ∨, ⇒, ⇔, ∀, ∃
Quantifiers¶
∀x P(x): “For all x, P(x)”
∃x P(x): “There exists x such that P(x)”
∀x P(x): Equivalent to ¬∃x ¬P(x)
De Morgan: ¬∀x P(x) ≡ ∃x ¬P(x)
FOL: Semantics¶
Model: Domain, interpretation of symbols
Interpretation: Maps constants to objects, predicates to relations
Satisfaction: m ⊨ φ defined recursively
FOL: Kinship Domain¶

Brother(x,y): x is brother of y
Parent(x,y): x is parent of y
Sibling(x,y): ∃p Parent(p,x) ∧ Parent(p,y)
Grandparent: Parent(x,y) ∧ Parent(y,z)
Knowledge Engineering¶
Identify: Task, questions
Assemble: Relevant knowledge
Vocabulary: Decide on symbols
Encode: General knowledge, specific instance
Pose queries: Query inference procedure
Debug: Fix errors
Electronic Circuits Example¶
Gates: AND, OR, NOT
Terminals: Connected, signal
OneOf: Each gate is exactly one type
Consistency: Connected terminals have same signal
Summary¶
FOL: Objects, relations, functions, quantifiers
∀, ∃: Universal and existential
Knowledge engineering: Process for building KBs
Next: Inference in FOL
References¶
Russell & Norvig, AIMA 4e, Ch. 8
Chapter PDF:
chapters/chapter-08.pdf