Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 37 Β· Predicate Logic

Translating English into Predicate Logic

Learn reliable patterns for turning English sentences into first-order formulas, avoid classic ambiguities, and test translations against small models in Python.

Formalizing a sentence is a skill, and like most skills it improves with a checklist and with deliberate practice. In this lesson you will learn the standard patterns for "all", "some", "no" and "only", the traps hidden in everyday phrasing, and how to test a translation by running it on a small model.

A four-step method

  1. Choose the domain (people, numbers, servers).
  2. Choose predicates for properties and relations, with a legend: S(x): x is a student, L(x, y): x likes y.
  3. Find the quantifiers in the order the English introduces them.
  4. Connect with β†’ and ∧ correctly: restricted βˆ€ takes β†’; restricted βˆƒ takes ∧.

The four classical patterns

With S(x) = "x is a student" and P(x) = "x passed":

English Logic
All students passed βˆ€x (S(x) β†’ P(x))
Some student passed βˆƒx (S(x) ∧ P(x))
No student passed βˆ€x (S(x) β†’ Β¬P(x)), or Β¬βˆƒx (S(x) ∧ P(x))
Some student did not pass βˆƒx (S(x) ∧ Β¬P(x))

These are the four categorical statements of Aristotle (A, I, E and O), which medieval logicians studied for centuries.

Four patterns

All S are P βˆ€x (S β†’ P)
Some S are P βˆƒx (S ∧ P)
No S are P βˆ€x (S β†’ Β¬P)
Some S aren't P βˆƒx (S ∧ Β¬P)

βˆ€ pairs with β†’, βˆƒ pairs with ∧

1 / 2

"Only", "unless", "at least", "exactly"

  • "Only students passed": βˆ€x (P(x) β†’ S(x)). Mind the direction: it is the converse of "all students passed".
  • "A passes only if B": A β†’ B.
  • "A unless B": Β¬B β†’ A (equivalently A ∨ B).
  • "At least two": βˆƒx βˆƒy (x β‰  y ∧ P(x) ∧ P(y)).
  • "At most one": βˆ€x βˆ€y ((P(x) ∧ P(y)) β†’ x = y).
  • "Exactly one": βˆƒx (P(x) ∧ βˆ€y (P(y) β†’ y = x)), often written βˆƒ!x P(x).

Counting quantifiers need equality. First-order logic with = can express "at least n", "at most n" and "exactly n" for every fixed n, but not "finitely many" or "even number of" (a theorem of model theory).

Testing a translation on a model

Because a formula is executable on a finite model, you can test whether your formalization matches your intuition: build a small world, evaluate the formula, and compare with the English judgment. If they disagree, the translation (or your reading of the English) is wrong.

Python Test translations on a small world

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Counting with equality

Let us check the "at least / at most / exactly" patterns against the plain count of items satisfying a predicate.

Python At least, at most, exactly

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The patterns agree with counting: x > 20 has no solutions (so "at most one" is vacuously true, "exactly one" false).

Relations and nested quantifiers in English

English Logic
Everyone has a mother βˆ€x βˆƒy M(y, x)
Someone is everyone's friend βˆƒy βˆ€x F(y, x)
Every student reads some book βˆ€s (S(s) β†’ βˆƒb (B(b) ∧ R(s, b)))
There is a book every student reads βˆƒb (B(b) ∧ βˆ€s (S(s) β†’ R(s, b)))

The last two differ only in quantifier order, and they say different things. English often leaves this order ambiguous: "Every student reads a book" can mean either one. Logic forces you to choose.

Typical ambiguities and traps

  • "All … are not …": "All politicians are not honest" can mean βˆ€x (Pol β†’ Β¬Honest) or Β¬βˆ€x (Pol β†’ Honest). State which.
  • "Any" behaves like βˆ€ in negative contexts ("not any" = "none") and like βˆƒ in questions ("is there any?").
  • "A" and "the": "A dog barked" is existential; "The dog barked" suggests exactly one dog.
  • Mass nouns and time: "Sometimes" and "always" need a time variable.
  • Implied domain: "Everyone" means every person; add Person(x) if the domain also contains other things.

Check your translation: a mini-lab

The method above is easy to remember and hard to apply fast, so practice by pairing each English sentence with a formula and a witness model.

Python Two readings of one sentence

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The two readings disagree in this world, so the English sentence alone does not determine its truth value.

Common mistakes

  • Using ∧ after βˆ€ (claims everything is a student).
  • Using β†’ after βˆƒ (true if anything is not a student).
  • Reading "only" in the wrong direction.
  • Forgetting equality for "at most" and "exactly".
  • Skipping the legend; always define your predicates.

Check your understanding

Quick check Β· 4 questions

of 4 answered You scored / 4 Β· perfect!

  1. 1. How do you formalize 'Some student passed'?

    Restricted existentials use conjunction.
  2. 2. 'Only students passed' is formalized as...

    Whoever passed must be a student: P implies S.
  3. 3. Which needs equality to express?

    Counting statements compare objects with = to say they are the same or different.
  4. 4. 'A unless B' is best formalized as...

    If B does not hold then A holds, which is equivalent to A ∨ B.

Summary

  • Choose a domain, predicates and a legend, then place quantifiers in English order.
  • βˆ€ goes with β†’, βˆƒ goes with ∧; "no" is βˆ€ with a negated predicate.
  • "Only" reverses the implication; counting needs equality.
  • English quantifier order is often ambiguous; logic makes the choice explicit.
  • Test translations on small models.

Next: Predicate Equivalences and Inference Rules