Write predicates as Python-style boolean expressions in a variable, e.g. x % 2 == 0,
over a finite domain like 1,2,3,4,5 or 1..20.
Loading examples...
What is Predicate Logic?
Predicate logic extends propositional logic with quantifiers (∀ for "for all", ∃ for "there exists") so statements can reason about entire classes of objects, not just fixed true/false facts.
How Does This Calculator Work?
Enter a quantified statement using ∀ (for all) or ∃ (there exists) together with a predicate, then evaluate it or check equivalence. The tool walks through what the quantifier means for the given domain.
Common Formulas & Rules
Predicate: a statement P(x) whose truth depends on the value substituted for x, e.g. P(x): "x is even."
Universal quantifier (∀x, P(x)): true when P(x) holds for every x in the domain.
Existential quantifier (∃x, P(x)): true when P(x) holds for at least one x in the domain.
Negating quantifiers: ¬(∀x, P(x)) is equivalent to ∃x, ¬P(x), and vice versa.
Nested quantifiers: order matters — ∀x∃y P(x,y) is generally not the same as ∃y∀x P(x,y).
Worked Example
Let P(x): "x > 0" over the domain of all integers. The statement ∀x, P(x) is false (x = -1 is a counterexample), while ∃x, P(x) is true (e.g. x = 1 works). Negating the first statement gives ∃x, ¬P(x) — "there exists an integer that is not positive" — which correctly matches our counterexample.
How to translate English into predicate logic
A translation is easiest if you follow the same five steps every time.
Fix the domain. Decide what the variable ranges over: people, integers, students in a class.
Name the predicates. Turn each property into a predicate such as Dog(x) or Mentors(m, s).
Pick the quantifier from the wording. “Every” and “all” suggest ∀; “some”, “there is” and “at least one” suggest ∃; “no” means ¬∃, or equivalently ∀ with a negated predicate.
Choose the connective. ∀ normally pairs with → and ∃ normally pairs with ∧.
Test it. Negate the formula, or try it on a small domain, and see whether it says what the sentence says.
English
Predicate logic
Every dog barks
∀x (Dog(x) → Barks(x))
Some cat is black
∃x (Cat(x) ∧ Black(x))
No student failed
∀x (Student(x) → ¬Failed(x))
Every student has a mentor
∀s ∃m Mentors(m, s)
Exactly one prime is even
∃!x (Prime(x) ∧ Even(x))
Open the Translation Examples tab for more, then check a formula of your own in the Quantifier Evaluator. For example, with domain 1..10 and predicate x % 2 == 0, ∃ is true and ∀ is false.
To translate your own sentence automatically, try the predicate logic translator. This page is the predicate logic calculator; for truth tables of statements without quantifiers, use the logic calculator.
Study guide: Predicate Logic
Written for students learning this topic for the first time. Last updated October 2026.
Overview
Propositional logic cannot say “every student passed” or “some integer is a perfect square”, because it treats each statement as indivisible. Predicate logic adds variables, predicates (properties such as P(x): “x is even”), and quantifiers that say how many members of a domain satisfy a predicate.
A predicate alone is neither true nor false. “x > 3” becomes a statement only once you fix a domain and bind the variable: “for all x in {4, 5, 6}, x > 3” is true. Choosing the domain and the quantifier order correctly is most of the skill.
Key ideas explained
Universal and existential quantifiers
∀x P(x) is true when P holds for every element of the domain, and ∃x P(x) when it holds for at least one. ∃!x P(x) means exactly one. Over a finite domain, ∀ behaves like a long AND and ∃ like a long OR, which is a useful mental model and is exactly how a program can evaluate them.
Free and bound variables
In ∀x (x + y > 0) the variable x is bound by the quantifier and y is free, so the truth of the formula depends on y. A proposition has no free variables.
Negating quantifiers
¬∀x P(x) ≡ ∃x ¬P(x) and ¬∃x P(x) ≡ ∀x ¬P(x). Negation flips the quantifier and negates the predicate. For nested quantifiers, work from the outside in: ¬∀x ∃y R(x,y) ≡ ∃x ∀y ¬R(x,y).
Order of nested quantifiers
Over the integers, ∀x ∃y (x + y = 0) is true (take y = −x), but ∃y ∀x (x + y = 0) is false, since no single y works for every x. Swapping two quantifiers of different kinds changes the meaning; swapping two of the same kind does not.
Worked examples
Evaluating quantifiers over a finite domain
Problem. Domain {1, 2, 3, 4, 5, 6}, P(x): “x is even”. Evaluate ∀x P(x), ∃x P(x), and ∃!x P(x).
The even elements are 2, 4 and 6.
∀x P(x) fails because 1 is a counterexample.
∃x P(x) holds because 2 works.
∃!x P(x) fails because three elements satisfy P, not exactly one.
Answer. ∀ is false, ∃ is true, ∃! is false.
Why quantifier order matters
Problem. Domain {1, 2, 3}. Compare ∀x ∃y (x + y = 4) with ∃y ∀x (x + y = 4).
For the first, x = 1 pairs with y = 3, x = 2 with y = 2, and x = 3 with y = 1. Every x has a partner.
For the second, y would have to be 3 for x = 1 and 2 for x = 2 at the same time, which is impossible.
Answer. The first statement is true and the second is false.
Enter these same values in the calculator above and compare each step with the working shown here.
Common mistakes to avoid
Writing ∀x (Dog(x) ∧ Bark(x)) for “all dogs bark”. That says everything is a barking dog. The correct form is ∀x (Dog(x) → Bark(x)).
Writing ∃x (Cat(x) → Black(x)) for “some cat is black”. That is true whenever anything is not a cat. Use ∃x (Cat(x) ∧ Black(x)).
Negating the predicate but forgetting to flip the quantifier.
Ignoring the domain: ∃x (x² = 2) is true over the reals and false over the integers.
Where this shows up in computer science
SQL's EXISTS and NOT EXISTS, and relational calculus, are quantifiers over table rows.
Formal specifications state invariants and preconditions with ∀ and ∃.
The ε–δ definition of a limit depends on the exact order of nested quantifiers.
Test yourself
Try each question before opening the answer.
Negate ∀x ∃y (y > x).
∃x ∀y (y ≤ x).
Translate “Some student likes every course”, using Likes(s, c).
∃s ∀c Likes(s, c).
Over the domain {1, 2, 3}, is ∃!x (x² = 4) true?
Yes. Only x = 2 gives 4, since 1² = 1 and 3² = 9.
Frequently asked questions
What's the difference between ∀ and ∃?
∀x P(x) means P(x) is true for every x in the domain ("for all"). ∃x P(x) means P(x) is true for at least one x ("there exists"). Negating one gives the other with the predicate negated.
How do you negate a quantified statement?
¬(∀x, P(x)) is equivalent to ∃x, ¬P(x), and ¬(∃x, P(x)) is equivalent to ∀x, ¬P(x). In words: "not all" becomes "there exists one that isn't", and vice versa.
Does the order of nested quantifiers matter?
Yes. ∀x∃y P(x,y) generally means something different from ∃y∀x P(x,y). The first says "for every x, some y works" (y can depend on x); the second says "some single y works for every x".
How do I translate a sentence into predicate logic?
Choose the domain, name the predicates, pick ∀ for words like “every” or “all” and ∃ for “some” or “there is”, then connect predicates with → under ∀ and with ∧ under ∃. The translation guide on this page walks through five examples.
How is a predicate logic calculator different from a logic calculator?
A logic calculator works with propositions that are simply true or false and produces truth tables. A predicate logic calculator evaluates statements with quantifiers over a domain, such as ∀x P(x), which truth tables alone cannot express.
We use cookies for essential site functionality and, where enabled, for ads (Google AdSense) and analytics
(Google Analytics). See our Privacy Policy for details.