Predicate Logic

What is second order predicate logic?

Second order predicate logic lets you quantify over properties and relations, not just objects. Learn how it differs from first order logic, with examples.

On this page
  1. Second order predicate logic in brief
  2. First order and second order compared
  3. Example: the induction axiom
  4. Why the extra power has a cost
  5. Where second order logic shows up
  6. Second order in everyday AI
  7. Key takeaways

Second order predicate logic in brief

Second order predicate logic extends first order logic so that quantifiers can range over predicates, properties and relations, as well as over objects. That extra reach lets you say things first order logic cannot say in a single sentence, such as two objects are identical if they share every property. The extra power comes with a cost: under its standard meaning, second order logic has no complete proof system.

First order and second order compared

In first order logic, every variable stands for an object:

∀x (Human(x) → Mortal(x))

In second order logic, you can also quantify over properties. The statement “there is a property that Socrates has and Plato lacks” is:

∃P (P(socrates) ∧ ¬P(plato))

Here P is a variable that stands for a property, or predicate.

Second order logic can also compare objects by their properties:

∀x ∀y (∀P (P(x) ↔ P(y)) → x = y)

This says that if two things have exactly the same properties, they are the same thing. First order logic cannot express this as a single sentence.

Example: the induction axiom

Arithmetic gives a clear case. Mathematical induction says that if a property holds for 0, and holding for any number n implies holding for n + 1, then the property holds for every natural number.

In first order logic, induction is a schema: a separate axiom for each property that can be written as a formula. That means infinitely many axioms.

In second order logic, induction is a single axiom:

∀P ((P(0) ∧ ∀n (P(n) → P(n + 1))) → ∀n P(n))

This single axiom pins down the natural numbers up to structure. Any two structures that satisfy it are the same. First order axioms cannot do this. They also have nonstandard models, with extra elements that do not behave like ordinary numbers.

Why the extra power has a cost

Second order logic has trade-offs. These apply under the standard meaning, where predicate variables range over every possible set of objects.

  • No complete proof system. No set of rules derives every valid second order statement, and no mechanical procedure could do so. This is closely tied to Gödel’s incompleteness theorems.
  • Compactness fails. Compactness says that if every finite part of a set of sentences has a model, the whole set has one. First order logic has this property, and second order logic does not.
  • The Löwenheim–Skolem theorem fails in its usual form. This basic result about first order logic does not carry over to second order logic.

Because of these costs, most automated reasoning in AI uses first order logic or fragments of it. Higher-order logics appear in proof assistants, which use computers to check mathematical proofs, and in some specification languages.

Where second order logic shows up

  • Mathematics and foundations. Second order logic is used to describe structures, such as the natural numbers, uniquely.
  • Proof assistants. Some use higher-order logic, which builds on the same ideas.
  • Philosophy. Some philosophers object that second order logic quietly commits you to sets or properties. W. V. Quine argued that it is really set theory in disguise.

Second order in everyday AI

Second order logic is rarely used directly in AI systems. Most knowledge bases, logic programming systems and theorem provers work with first order logic, because it is better understood and easier to automate. For the form used most in AI, see first order predicate logic in artificial intelligence examples.

Key takeaways

  • Second order logic quantifies over predicates and relations as well as objects.
  • It can state identity by shared properties and pin down the natural numbers with one induction axiom.
  • Under standard semantics it has no complete proof system, so it is less practical for automated reasoning.

The complete guide to predicate logic

First-Order Predicate Logic in Artificial Intelligence With Examples
Read the guide

Keep exploring

Guides from other topics

All topics →