Knowledge Representation and Reasoning (8hrs) · Introduction to AI

First-order predicate logic — syntax

Watch lectures

First-Order Predicate Logic — Syntax — Beginner-Friendly Notes

1. Why We Need FOL (First-Order Logic)

Propositional logic cannot say "all birds fly" without listing each bird. FOL adds objects, relations, variables, quantifiers — so one sentence covers infinitely many individuals.

Propositional = facts. FOL = objects + relations + quantification.

2. Syntax — Vocabulary

  • Constants: specific objects — a,b,John,3a, b, John, 3 (lowercase start).
  • Variables: placeholders — x,y,zx, y, z.
  • Predicates: relations/properties — Bird(x)Bird(x), Flies(x)Flies(x), Likes(John,Mary)Likes(John, Mary), Greater(x,y)Greater(x,y) — capitalised, arity matters.
  • Functions: map objects to objects — Father(John)Father(John), Successor(3)Successor(3) — not boolean, returns an object.
  • Terms: constants, variables, or function applied to terms — e.g., Father(John)Father(John), xx.

3. Atomic Sentences

Predicate applied to terms: Bird(Tweety)Bird(Tweety), Likes(x,y)Likes(x, y), Greater(Successor(2),3)Greater(Successor(2), 3)

4. Complex Sentences (build recursively)

If P,QP, Q are sentences and xx variable:

  • Connectives as before: $
    eg P,, P \land Q,, P \lor Q,, P \Rightarrow Q,, P \Leftrightarrow Q$
  • Quantified: ∀x P(x)\forall x\ P(x), ∃x P(x)\exists x\ P(x)
  • Equality: x=yx = y (optional)

Examples:

  • "Every bird flies": ∀x (Bird(x)⇒Flies(x))\forall x\ (Bird(x) \Rightarrow Flies(x))
  • "There is a red bird": ∃x (Bird(x)∧Red(x))\exists x\ (Bird(x) \land Red(x))
  • "John likes everyone": ∀y Likes(John,y)\forall y\ Likes(John, y)
  • "Someone likes John": ∃x Likes(x,John)\exists x\ Likes(x, John)

5. Precedence & Well-Formed Formulas

Quantifiers bind tightest: ∀x Bird(x)⇒Flies(x)\forall x\ Bird(x) \Rightarrow Flies(x) means ∀x (Bird(x)⇒Flies(x))\forall x\ (Bird(x) \Rightarrow Flies(x)). Use parentheses to be safe.

6. Why Syntax Matters for AI

  • Allows general rules (one rule for all birds) and relations (family, spatial).
  • Next topics add quantifiers (meaning) and inference (how to reason).

7. One-Line Summary

First-order logic builds sentences from constants, variables, predicate and function terms with connectives and quantifiers, enabling general statements about objects and relations.

8. Quick Self-Check

  1. Is Likes(John)Likes(John) well-formed if Likes expects 2 args?
  2. Write "All cats are mammals" in FOL.
Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.

← All Introduction to AI modules