All Topics  
First-order logic

 

   Email Print
   Bookmark   Link






 

First-order logic



 
 
First-order logic (FOL) is a formal deductive system
Deductive system

A deductive system consists of the axioms and rules of inference that can be used to formal proof the theorems of the system.Such a deductive system is intended to preserve deduction qualities in the formula s that are expressed in the system....
 used in mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, philosophy
Philosophy

Philosophy is the study of general problems concerning matters such as existence, knowledge, truth, beauty, justice, validity, mind, and language....
, linguistics
Linguistics

Linguistics is the science study of natural language. Linguistics encompasses a number of sub-fields. An important topical division is between the study of language structure and the study of Meaning ....
, and computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
. It goes by many names, including: first-order predicate calculus (FOPC), the lower predicate calculus, the language of first-order logic or predicate logic
Predicate logic

In mathematical logic, predicate logic is the generic term for symbolic formal systems like first-order logic, second-order logic, many-sorted logic or infinitary logic....
. Unlike natural languages such as English
English language

English is a West Germanic language that originated in Anglo-Saxon England and has lingua franca status in many parts of the world as a result of the military, economic, scientific, political and cultural influence of the British Empire in the 18th, 19th and early 20th centuries and that of the United States from the mid 20th century onwa...
, FOL uses a wholly unambiguous formal language
Formal language

A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....
 interpreted by mathematical structures. FOL is a system of deduction
Deduction

Deduction can refer to one of the following usages: lower price on something* Deductive reasoning, inference in which the conclusion is of no greater generality than the premises...
 that extends propositional logic by allowing quantification
Quantification

Quantification has two distinct meanings. In mathematics and empirical science, it refers to human acts, known as counting and measuring that map human sense observations and experiences into element s of some Set of numbers....
 over individuals of a given domain of discourse
Domain of discourse

The domain of discourse, sometimes called the universe of discourse, logical discourse, or simply discourse, is an analytic tool used in deductive logic, especially predicate logic....
.






Discussion
Ask a question about 'First-order logic'
Start a new discussion about 'First-order logic'
Answer questions from other users
Full Discussion Forum



Encyclopedia


First-order logic (FOL) is a formal deductive system
Deductive system

A deductive system consists of the axioms and rules of inference that can be used to formal proof the theorems of the system.Such a deductive system is intended to preserve deduction qualities in the formula s that are expressed in the system....
 used in mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, philosophy
Philosophy

Philosophy is the study of general problems concerning matters such as existence, knowledge, truth, beauty, justice, validity, mind, and language....
, linguistics
Linguistics

Linguistics is the science study of natural language. Linguistics encompasses a number of sub-fields. An important topical division is between the study of language structure and the study of Meaning ....
, and computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
. It goes by many names, including: first-order predicate calculus (FOPC), the lower predicate calculus, the language of first-order logic or predicate logic
Predicate logic

In mathematical logic, predicate logic is the generic term for symbolic formal systems like first-order logic, second-order logic, many-sorted logic or infinitary logic....
. Unlike natural languages such as English
English language

English is a West Germanic language that originated in Anglo-Saxon England and has lingua franca status in many parts of the world as a result of the military, economic, scientific, political and cultural influence of the British Empire in the 18th, 19th and early 20th centuries and that of the United States from the mid 20th century onwa...
, FOL uses a wholly unambiguous formal language
Formal language

A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....
 interpreted by mathematical structures. FOL is a system of deduction
Deduction

Deduction can refer to one of the following usages: lower price on something* Deductive reasoning, inference in which the conclusion is of no greater generality than the premises...
 that extends propositional logic by allowing quantification
Quantification

Quantification has two distinct meanings. In mathematics and empirical science, it refers to human acts, known as counting and measuring that map human sense observations and experiences into element s of some Set of numbers....
 over individuals of a given domain of discourse
Domain of discourse

The domain of discourse, sometimes called the universe of discourse, logical discourse, or simply discourse, is an analytic tool used in deductive logic, especially predicate logic....
. For example, it can be stated in FOL "Every individual has the property P".

While propositional logic deals with simple declarative propositions, first-order logic additionally covers predicate
Predicate (logic)

Sometimes it is inconvenient or impossible to describe a set by listing all of its elements. Another useful way to define a set is by specifying a property that the elements of the set have in common....
s and quantification. Take for example the following sentences: "Socrates is a man", "Plato is a man". In propositional logic these will be two unrelated propositions, denoted for example by p and q. In first-order logic however, both sentences would be connected by the same property: Man(x), where Man(x) means that x is a man. When x=Socrates we get the first proposition, p, and when x=Plato we get the second proposition, q. Such a construction allows for a much more powerful logic when quantifiers are introduced, such as "for every x...", for example, "for every x, if Man(x), then...". Without quantifiers, every valid argument in FOL is valid in propositional logic, and vice versa.

A first-order theory consists of a set of axiom
Axiom

In traditional logic, an axiom or postulate is a proposition that is not proved or demonstrated but considered to be either self-evidence, or subject to necessary decision....
s (usually finite or recursively enumerable) and the statements deducible from them given the underlying deducibility relation. Usually what is meant by 'first-order theory' is some set of axioms together with those of a complete (and sound) axiomatization of first-order logic, closed under the rules of FOL. (Any such system FOL will give rise to the same abstract deducibility relation, so we needn't have a fixed axiomatic system in mind.) A first-order language has sufficient expressive power to formalize two important mathematical theories: Zermelo–Fraenkel (ZFC)
Zermelo–Fraenkel set theory

Zermelo?Fraenkel set theory with the axiom of choice, commonly abbreviated ZFC, is the standard form of axiomatic set theory and as such is the most common foundations of mathematics....
 set theory and (first-order) Peano arithmetic. A first-order language cannot, however, categorically express the notion of countability
Countable set

In mathematics, a countable set is a Set with the same cardinality as some subset of the set of natural numbers. The term was originated by Georg Cantor; it stems from the fact that the natural numbers are often called counting numbers....
 even though it is expressible in the first-order theory ZFC under the intended interpretation
Intended interpretation

One who constructs a formal system usually has in mind from the outset some interpretation of this system. While this intended interpretation can have no explicit indication in the deductive system --since these rules must be strictly formal --the author's intention respecting interpretation naturally affects his choice of the formal grammar...
 of the symbolism of ZFC. Such ideas can be expressed categorically with second-order logic
Second-order logic

In logic and mathematics second-order logic is an extension of first-order logic, which itself is an extension of propositional logic. Second-order logic is in turn extended by higher-order logic and type theory....
.

Why is first-order logic needed?


Propositional logic is not adequate for formalizing valid arguments that rely on the internal structure of the propositions involved. To see this, consider the valid syllogistic
Syllogism

A syllogism, or logical appeal, , is a kind of logical argument in which one proposition is Inference from two others of a certain form....
 argument:
  • All men are mortal
  • Socrates is a man
  • Therefore, Socrates is mortal


which upon translation into propositional logic yields:
  • A
  • B
  • C
(taking to mean "therefore").

According to propositional logic, this translation is invalid: Propositional logic validates arguments according to their structure, and nothing in the structure of this translated argument (C follows from A and B, for arbitrary A, B, C) suggests that it is valid. A translation that preserves the intuitive (and formal) validity of the argument must take into consideration the deeper structure of propositions, such as the essential notions of predication and quantification. Propositional logic deals only with truth-functional validity: any assignment of truth-values to the variables of the argument should make either the conclusion true or at least one of the premises false. Clearly we may (uniformly) assign truth values to the variables of the above argument such that A, B are both true but C is false. Hence the argument is truth-functionally invalid. On the other hand, it is impossible to (uniformly) assign truth values to the argument "A follows from (A and B)" such that (A and B) is true (hence A is true and B is true) and A false.

In contrast, this argument can be easily translated into first-order logic:
(Where "" means "for all x", "" means "implies", means "Socrates is a man", and means "Socrates is mortal".) In plain English, this states that
  • for all x, if x is a man then x is mortal
  • Socrates is a man
  • therefore Socrates is mortal


FOL (First Order Logic) can also express the existence of something ( ), as well as predicates ("functions" that are true or false) with more than one parameter. For example, "there is someone who can be fooled every time" can be expressed as: Where "" means "there exists (an) x", "" means "and", and means "(person) x can be fooled (at time) y".

Variables in first-order logic and in propositional logic


Every propositional formula can be translated into an essentially equivalent first-order formula by replacing each propositional variable with a nullary predicate. For example, the formula: can be translated into , where P, Q and R are predicates of arity zero.

While variables in the propositional logics are used to represent propositions that can be true or false, variables in first-order logic represent objects the formula is referring to. In the example above, the variable x in is intended to indicate an arbitrary element of the human race, not a proposition that can be true or false.

Defining first-order logic

A predicate calculus consists of
  • formation rules (i.e. recursive
    Recursion

    Recursion, in mathematics and computer science, is a method of defining Function in which the function being defined is applied within its own definition....
     definitions for forming well-formed formula
    Well-formed formula

    In computer science and mathematical logic, a well-formed formula or simply formula is a symbol or string of symbols that is generated by the formal grammar of a formal language....
    s).
  • a proof theory, made of:
    • transformation rules (i.e. inference rule
      Rule of inference

      In logic, a rule of inference is a function from sets of formulae to formulae. The argument is called the premise set and the value the conclusion....
      s for deriving theorems).
    • axioms (possibly countably infinitely
      Countable set

      In mathematics, a countable set is a Set with the same cardinality as some subset of the set of natural numbers. The term was originated by Georg Cantor; it stems from the fact that the natural numbers are often called counting numbers....
       many) or axiom schemata.
  • a semantics, telling which interpretation of the symbol makes the formula true.


The axioms considered here are logical axioms which are part of classical FOL. It is important to note that FOL can be formalized in many equivalent ways; there is nothing canonical about the axioms and rules of inference given in this article. There are infinitely many equivalent formalizations all of which yield the same theorems and non-theorems, and all of which have equal right to the title 'FOL'.

FOL is used as the basic "building block" for many mathematical theories. FOL provides several built-in rules, such as the axiom (if P(x) is true for every x then P(x) is true for every x). Additional non-logical axioms are added to produce specific first-order theories based on the axioms of classical FOL; these theories built on FOL are called classical first-order theories. One example of a classical first-order theory is Peano arithmetic, which adds the axiom (i.e. for every x there exists y such that y=x+1, where Q(x,y) is interpreted as "y=x+1"). This additional axiom is a non-logical axiom; it is not part of FOL, but instead is an axiom of the theory (an axiom of arithmetic rather than of logic). Axioms of the latter kind are also called axioms of first-order theories. The axioms of first-order theories are not regarded as truths of logic per se, but rather as truths of the particular theory that usually has associated with it an intended interpretation of its non-logical symbols. (See an analogous idea at logical versus non-logical symbol
Non-logical symbol

In logic, the formal languages used to create expressions consist of symbols which can be broadly divided into logical constants and variables. The constants of a language can further be divided into logical constant and non-logical symbols ....
s.) Thus, the proposition is an axiom (hence is true) in the theory of Peano arithmetic, with the interpretation of the relation Q(x,y) as "y=x+1", and may be false in other theories or with another interpretation of the relation Q(x,y). Classical FOL does not have associated with it an intended interpretation of its non-logical vocabulary (except arguably a symbol denoting identity, depending on whether one regards such a symbol as logical). Classical set-theory is another example of a first-order theory (a theory built on FOL).

Syntax of first-order logic


Symbols

The terms and formulas of first-order logic are strings of symbols. As for all formal language
Formal language

A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....
s, the nature of the symbols themselves is outside the scope of formal logic; it is best to think of them as letters and punctuation symbols. The alphabet (set of all symbols of the language) is divided into the non-logical symbols and the logical symbols. The latter are the same, and have the same meaning, for all applications.

Non-logical symbols
The non-logical symbols represent predicates (relations), functions and constants on the domain. For a long time it was standard practice to use a fixed, infinite set of non-logical symbols for all purposes. A more recent practice is to use different non-logical symbols according to the application one has in mind. Therefore it has become necessary to name the set of all non-logical symbols used in a particular application. It is now known as the signature.

Traditional approach The traditional approach is to have only one, infinite, set of non-logical symbols (one signature) for all applications. Consequently, under the traditional approach there is only one language of first-order logic. This approach is still common, especially in philosophically oriented books.

  1. For every integer n = 0 we have the n-ary
    Arity

    In logic, mathematics, and computer science, the arity of a function or operation is the number of arguments or operands that the function takes. The arity of a relation is the number of domains in the corresponding Cartesian product....
    , or n-place, predicate symbols. Because they represent relations
    Relation (mathematics)

    In mathematics , a relation is a property that assigns truth values to combinations of k first-order logic. Typically, the property describes a possible connection between the components of a k-tuple....
     between n elements, they are also called relation symbols. For each arity n we have an infinite supply of them:
    Pn0, Pn1, Pn2, Pn3, …
  2. For every integer n = 0 infinitely many n-ary function symbols:
    fn0, fn1, fn2, fn3, …


Application-specific signatures In modern mathematical treatments of first-order logic, the signature varies with the applications. Typical signatures in mathematics are or just for group
Group

Group can refer to:...
s, or for ordered field
Ordered field

In mathematics, an ordered field is a field together with a total ordering of its elements that agrees in a certain sense with the field operations....
s. There are no restrictions on the number of non-logical symbols. The signature can be empty
Empty set

In mathematics, and more specifically set theory, the empty set is the unique Set having no members. Some axiomatic set theories assure that the empty set exists by including an axiom of empty set; in other theories, its existence can be deduced....
, finite, or infinite, even uncountable. Uncountable signatures occur for example in modern proofs of the Löwenheim-Skolem theorem (upward part).

Every non-logical symbol is of one of the following types.
  1. A set of predicate symbols (or relation symbols) each with some valence (or arity
    Arity

    In logic, mathematics, and computer science, the arity of a function or operation is the number of arguments or operands that the function takes. The arity of a relation is the number of domains in the corresponding Cartesian product....
    , number of its arguments) = 0, which are often denoted by uppercase letters P, Q, R,... .
    • Relations of valence 0 can be identified with propositional variable
      Propositional variable

      In mathematical logic, a propositional variable is a variable which can either be true or false. Propositional variables are the basic building-blocks of propositional formulas, used in propositional logic and higher logics....
      s. For example, P, which can stand for any statement.
    • For example, P(x) is a predicate variable of valence 1. It can stand for "x is a man", for example.
    • Q(x,y) is a predicate variable of valence 2. It can stand for "x is greater than y" in arithmetic or "x is the father of y", for example.
    • By using functions (see below), it is possible to dispense with all predicate variables with valence larger than one. For example, "x>y" (a predicate of valence 2, of the type Q(x,y)) can be replaced by a predicate of valence 1 about the ordered pair
      Ordered pair

      In mathematics, an ordered pair is a collection of two distinguishable objects, one being the first coordinate system , and the other being the second coordinate ....
       (x,y).
  2. A set of function symbols, each of some valence = 0, which are often denoted by lowercase letters f, g, h,... .
    • Function symbols of valence 0 are called constant symbols, and are often denoted by lowercase letters at the beginning of the alphabet a, b, c,... .
    • Examples: f(x) may stand for "the father of x". In arithmetic
      Arithmetic

      Arithmetic or arithmetics is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple day-to-day counting to advanced science and business calculations....
      , it may stand for "-x". In set theory
      Set theory

      Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
      , it may stand for "the power set
      Power set

      In mathematics, given a Set S, the power set of S, written , P, ℘ or Power set#Representing subsets as functions, is the set of all subsets of S....
       of x". In arithmetic
      Arithmetic

      Arithmetic or arithmetics is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple day-to-day counting to advanced science and business calculations....
      , f(x,y) may stand for "x+y". In set theory
      Set theory

      Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
      , it may stand for "the union of x and y". The symbol a may stand for Socrates. In arithmetic
      Arithmetic

      Arithmetic or arithmetics is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple day-to-day counting to advanced science and business calculations....
      , it may stand for 0. In set theory
      Set theory

      Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
      , such a constant may stand for the empty set
      Empty set

      In mathematics, and more specifically set theory, the empty set is the unique Set having no members. Some axiomatic set theories assure that the empty set exists by including an axiom of empty set; in other theories, its existence can be deduced....
      .
    • One can in principle dispense entirely with functions of arity > 2 and predicates of arity > 1 if there is a function symbol of arity 2 representing an ordered pair
      Ordered pair

      In mathematics, an ordered pair is a collection of two distinguishable objects, one being the first coordinate system , and the other being the second coordinate ....
       (or predicate symbols of arity 2 representing the projection relations of an ordered pair). The pair or projections need to satisfy the natural axioms.
    • One can in principle dispense entirely with functions and constants. For example, instead of using a constant one may use a predicate (interpreted as ), and replace every predicate such as with . A function such as will similarly be replaced by a predicate (interpreted as ).


We can recover the traditional approach by considering the following signature:


Logical symbols
Besides logical connective
Logical connective

In logic, two sentences may be joined by means of a logical connective to form a compound sentence. The truth-value of the compound is uniquely determined by the truth-values of the simpler sentences....
s such as , , , and , the logical symbols include quantifiers, and variable
Variable

A variable is a symbol that stands for a value that may vary; the term usually occurs in opposition to constant, which is a symbol for a non-varying value, i.e....
s.
  1. An infinite set of variables, often denoted by lowercase letters at the end of the alphabet x, y, z,... .
  2. Symbols denoting logical operators (or connectives):
    • The unary operator (logical not).
    • Binary operators (logical and) and (logical or).
    • Binary operators (logical conditional) and (logical biconditional
      Logical biconditional

      In logic and mathematics, logical biconditional is a logical operator connecting two statements to assert, p Iff q where p is a hypothesis and q is a logical consequence ....
      ).
  3. Symbols denoting quantifiers: (universal quantification
    Universal quantification

    In predicate logic, universal quantification formalizes the notion that something is true for everything, or every relevant thing.The resulting statement is a universally quantified statement, and we have universally quantified over the predicate....
    , typically read as "for all") and (existential quantification
    Existential quantification

    In predicate logic, an existential quantification is the predication of a property or relation to at least one member of the domain. In laymen's terms, it simply refers to something....
    , typically read as "there exists").
  4. Left and right parenthesis: ( and ). There are many different conventions about where to put parentheses; for example, one might write x or (x). Sometimes one uses colons or full stops instead of parentheses to make formulas unambiguous. One interesting but rather unusual convention is "Polish notation
    Polish notation

    Polish notation, also known as prefix notation, is a form of notation for logic, arithmetic, and algebra. Its distinguishing feature is that it places operators to the left of their operands....
    ", where one omits all parentheses, and writes , , and so on in front of their arguments rather than between them. Polish notation is compact and elegant, but rare because it is hard for humans to read it.
  5. An identity symbol (or equality symbol) =. Syntactically it behaves like a binary predicate.


Variations First-order logic as described here is often called first-order logic with identity, because of the presence of an identity symbol = with special semantics. In first-order logic without identity this symbol is omitted.

There are numerous minor variations that may define additional logical symbols:
  • Sometimes the truth constants T for "true" and F for "false" are included. Without any such logical operators of valence 0 it is not possible to express these two constants otherwise without using quantifiers.
  • Sometimes the Sheffer stroke
    Sheffer stroke

    The Sheffer stroke, written "|" or "?", in the subject matter of boolean functions or propositional calculus, denotes a logical operation that is equivalent to the logical negation of the logical conjunction operation, expressed in ordinary language as "not both"....
     (P | Q, aka NAND) is included as a logical symbol.
  • The exclusive-or operator "xor" is another logical connective that can occur as a logical symbol.
  • Sometimes it is useful to say that "P(x) holds for exactly one x", which can be expressed as x P(x). This notation, called uniqueness quantification
    Uniqueness quantification

    In mathematics and logic, the phrase "there is one and only one" is used to indicate that exactly one object with a certain property exists. In mathematical logic, this sort of quantification is known as uniqueness quantification or unique existential quantification....
    , may be taken to abbreviate a formula such as x (P(x) y (P(y) (x = y))).


Not all logical symbols as defined above need occur. For example:
  • Since ( x)f can be expressed as (( x)( f)), and ( x)f can be expressed as (( x)( f)), one of the two quantifiers and can be dropped.
  • Since f? can be expressed as (( f) ( ?)), and f? can be expressed as (( f) ( ?)), either or can be dropped. In other words, it is sufficient to have or as the only logical connectives among the logical symbols.
  • Similarly, it is sufficient to have or just the Sheffer stroke as the only logical connectives.


There are also some frequently used variants of notation:
  • Some books and papers use the notation f ? for f ?. This is especially common in proof theory where is easily confused with the sequent arrow.
  • ~f is sometimes used for f, f & ? for f ?.
  • There is a wealth of alternative notations for quantifiers; e.g., x f may be written as (x)f. This latter notation is common in texts on recursion theory.


Formation rules

The formation rules define the terms and formulas of first order logic. When terms and formulas are represented as strings of symbols, these rules can be used to write a formal grammar
Formal grammar

In formal language theory, grammars, also called formal grammars or generative grammars, are a formalism used to describe formal languages – i.e....
 for terms and formulas. The concept of free variable is used to define the sentences as a subset of the formulas.

Terms
The set of terms
Term (mathematics)

The word term is from the Latin terminus which literally means "boundary line, limit", from the Proto-Indo-European root "peg, post, boundary"....
  is recursively defined by the following rules:
  1. Any variable is a term.
  2. Any expression f(t1,...,tn) of n arguments (where each argument ti is a term and f is a function symbol of valence n) is a term.
  3. Closure clause: Nothing else is a term. For example, predicates are not terms.


Formulas
The set of well-formed formula
Well-formed formula

In computer science and mathematical logic, a well-formed formula or simply formula is a symbol or string of symbols that is generated by the formal grammar of a formal language....
s (usually called wffs or just formulas) is recursively defined by the following rules:
  1. Simple and complex predicates If P is a relation of valence n and a1, ..., an are terms then P(a1,...,an) is a well-formed formula. If equality is considered part of logic, then (a1 = a2) is a well-formed formula. All such formulas are said to be atomic
    Atomic formula

    In mathematical logic, an atomic formula is a formula with no deeper propositional structure, that is, a formula that contains no logical connectives or equivalently a formula that has no strict subformulas....
    .
  2. Inductive Clause I: If f is a wff, then f is a wff.
  3. Inductive Clause II: If f and ? are wffs, then (f ?) is a wff.
  4. Inductive Clause III: If f is a wff and x is a variable, then x f is a wff.
  5. Closure Clause: Nothing else is a wff.


For example, x y (P(f(x)) (P(x) Q(f(y),x,z))) is a well-formed formula, if f is a function of valence 1, P a predicate of valence 1 and Q a predicate of valence 3. x x is not a well-formed formula.

In Computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
 terminology, a formula implements a built-in "boolean" type, while a term implements all other types.

Example

In mathematics the language of ordered abelian groups has one constant 0, one unary function −, one binary function +, and one binary relation =. So:
  • x, y are atomic terms
  • +(x, y), +(x, +(y, −(z))) are terms, usually written as x + y, x + yz
  • =(+(x, y), 0), =(+(x, +(y, −(z))), +(x, y)) are atomic formulas, usually written as x + y = 0, x + y - z = x + y,
  • (x y =( +(x, y), z)) (x =(+(x, y), 0)) is a formula, usually written as (x y x + y = z) (x x + y = 0).


Additional syntactic concepts


Free and Bound Variables


In a formula, a variable may occur free or bound. Intuitively, a variable is free in a formula if it is not quantified: in , variable x is free while y is bound.

  1. Atomic formulas If f is an atomic formula then x is free
    Free variables and bound variables

    In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a free variable is a notation that specifies places in an expression where First-order_logic#Substitution may take place....
     in f if and only if x occurs in f.
  2. Inductive Clause I: x is free in f if and only if x is free in f.
  3. Inductive Clause II: x is free in (f ?) if and only if x is free in either f or ?.
  4. Inductive Clause III: x is free in y f if and only if x is free in f and x is a different symbol than y.
  5. Closure Clause: x is bound in f if and only if x occurs in f and x is not free in f.


For example, in x y (P(x) Q(x,f(x),z)), x and y are bound variables, z is a free variable, and w is neither because it does not occur in the formula.

Freeness and boundness can be also specialized to specific occurrences of variables in a formula. For example, in , the first occurrence of x is free while the second is bound. In other words, the x in is free while the in is bound.

Substitution


If t is a term and f is a formula possibly containing the variable x, then f[t/x] is the result of replacing all free instances of x by t in f.

This replacement results in a formula that logically follows the original one provided that no free variable of t becomes bound in this process. If some free variable of t becomes bound, then to substitute t for x it is first necessary to change the names of bound variables of f to something other than the free variables of t.

To see why this condition is necessary, consider the formula f given by y y = x ("x is maximal"). If t is a term without y as a free variable, then f[t/x] just means t is maximal. However if t is y, the formula f[y/x] is y y = y which does not say that y is maximal. The problem is that the free variable y of t (=y) became bound when we substituted y for x in f[y/x]. The intended replacement can be obtained by renaming the bound variable y of f to something else, say z, so that the formula is then z z = y. Forgetting this condition is a notorious cause of errors.

Proof theory


Inference rules


An inference rule
Rule of inference

In logic, a rule of inference is a function from sets of formulae to formulae. The argument is called the premise set and the value the conclusion....
 is a function from sets of (well-formed) formulas, called premises, to sets of formulas called conclusions. In most well-known deductive systems, inference rules take a set of formulas to a single conclusion. (Notice this is true even in the case of most sequent calculi
Sequent calculus

In proof theory and mathematical logic, the sequent calculus is a widely known proof calculus for first-order logic . The term "sequent calculus" applies both to a family of formal systems sharing a certain style of formal inference, and to its individual members, of which the first, and best known, is known under the name LK, distingui...
.)

Inference rules are used to prove theorem
Theorem

In mathematics, a theorem is a statement Mathematical proof on the basis of previously accepted or established statements such as axioms.In formal mathematical logic, the concept of a theorem may be taken to mean a formula that can be formal proof according to the deductive system of a fixed formal system....
s, which are formulas provable in or members of a theory. If the premises of an inference rule are theorems, then its conclusion is a theorem as well. In other words, inference rules are used to generate "new" theorems from "old" ones--they are theoremhood preserving. Systems for generating theories are often called predicate calculi. These are described in a section below.

An important inference rule, modus ponens
Modus ponens

In classical logic, modus ponendo ponens is a valid, simple argument form sometimes referred to as affirming the antecedent or the law of detachment....
, states that if f and f ? are both theorems, then ? is a theorem. This can be written as following;
if and , then
where indicates is provable in theory T. There are deductive systems (known as Hilbert-style deductive systems) in which modus ponens is the sole rule of inference; in such systems, the lack of other inference rules is offset with an abundance of logical axiom schemes.

A second important inference rule is Universal Generalization
Generalization (logic)

Generalization is an rule of inference of predicate calculus which states that:"Generalization" can be abbreviated as GEN. The inference rule can be summarized as the sequentbut this gives rise to an important restriction: the Deduction theorem cannot be applied to it to deriveThis formula is wrong because x has an unbound instance...
. It can be stated as
if , then
Which reads: if f is a theorem, then "for every x, f" is a theorem as well. The similar-looking schema is not sound, in general, although it does however have valid instances, such as when x does not occur free in f (see Generalization (logic)
Generalization (logic)

Generalization is an rule of inference of predicate calculus which states that:"Generalization" can be abbreviated as GEN. The inference rule can be summarized as the sequentbut this gives rise to an important restriction: the Deduction theorem cannot be applied to it to deriveThis formula is wrong because x has an unbound instance...
).

Axioms


Here follows a description of the axioms of first-order logic. As explained above, a given first-order theory has further, non-logical axioms. The following logical axioms characterize a predicate calculus for this article's example of first-order logic.

For any theory, it is of interest to know whether the set of axioms can be generated by an algorithm, or if there is an algorithm which determines whether a well-formed formula is an axiom.

If there is an algorithm to generate all axioms, then the set of axioms is said to be recursively enumerable.

If there is an algorithm which determines after a finite number of steps whether a formula is an axiom or not, then the set of axioms is said to be recursive
Recursive set

In computability theory, a Set of natural numbers is called recursive, computable or decidable if there is an algorithm which terminates after a finite amount of time and correctly decides whether or not a given number belongs to the set....
 or decidable. In that case, one may also construct an algorithm to generate all axioms: this algorithm simply builds all possible formulas one by one (with growing length), and for each formula the algorithm determines whether it is an axiom.

Axioms of first-order logic are always decidable. However, in a first-order theory non-logical axioms are not necessarily such.

Quantifier axioms

Quantifier axioms change according to how the vocabulary is defined, how the substitution procedure works, what the formation rules are and which inference rules are used. Here follows a specific example of these axioms

  • PRED-1:
  • PRED-2:
  • PRED-3:
  • PRED-4:
These are actually axiom schema
Axiom schema

In mathematical logic, an axiom schema generalizes the notion of axiom.An axiom schema is a well-formed formula in the language of an axiomatic system, in which one or more schematic variables appear....
ta: the expression W stands for any wff in which x is not free, and the expression Z(x) stands for any wff with the additional convention that Z(t) stands for the result of substitution of the term t for x in Z(x). Thus this is a recursive set
Recursive set

In computability theory, a Set of natural numbers is called recursive, computable or decidable if there is an algorithm which terminates after a finite amount of time and correctly decides whether or not a given number belongs to the set....
 of axioms.

Another axiom, , for Z in which x does not occur free, is sometimes added.

Equality and its axioms
There are several different conventions for using equality (or identity) in first-order logic. This section summarizes the main ones. The various conventions all give essentially the same results with about the same amount of work, and differ mainly in terminology. Book 1 of Euclid's elements
Euclid's Elements

Euclid's Elements is a mathematics and geometry treatise consisting of 13 books written by the Greek mathematics Euclid in Alexandria circa 300 BC....
 gives the rules for equality in essentially the same form as below.

  • The most common convention for equality is to include the equality symbol as a primitive logical symbol, and add the axioms for equality to the axioms for first-order logic. The equality axioms are


x = x (reflexivity) x = y ? f(...,x,...) = f(...,y,...) for any function f x = y ? (P(...,x,...) ? P(...,y,...)) for any relation P (Leibniz's law)

where P is a metavariable ranging over wffs of the object language. Leibniz's law is sometimes called "the principle of substitutivity", "the indiscernibility of identicals", or "the replacement property". The above forms are axiom schema
Axiom schema

In mathematical logic, an axiom schema generalizes the notion of axiom.An axiom schema is a well-formed formula in the language of an axiomatic system, in which one or more schematic variables appear....
ta: they specify an infinite set of axioms of the above forms, called their instances. Notice that the second schema involving the function symbol f is (equivalent to) a special case of the last schema, namely x = y ? (f(...,x,...) = z ? f(...,y,...) = z). From the above axioms both symmetry and transitivity for equality follow. Moreover, by the symmetry of equality, the right hand side of the last schema (Leibniz's law) could be strengthened to a biconditional.


  • If a theory has a binary formula A(x,y) which satisfies reflexivity and Leibniz's law, the theory is said to have equality, or to be a theory with equality. It may not have all instances of the above schemata as axioms, but rather as derivable theorems. For example, an inconsistent first-order theory (say whose only axiom is p & ~p) is a theory with identity, since every open formula in two free variables trivially satisfies reflexivity and Leibniz's law.


  • In theories with no function symbols and a finite number of relations, it is possible to define equality in terms of the relations, by defining the two terms s and t to be equal if any relation is unchanged by changing s to t in any argument.
For example, in set theory with one relation , we may define s = t to be an abbreviation for x (s x t x) x (x s x t). This definition of equality then automatically satisfies the axioms for equality. In this case, one should replace the usual axiom of extensionality
Axiom of extensionality

In axiomatic set theory and the branches of logic, mathematics, and computer science that use it, the axiom of extensionality, or axiom of extension, is one of the axioms of Zermelo-Fraenkel set theory....
, , by , i.e. if x and y have the same elements, then they belong to the same sets.
  • In some theories it is possible to give ad hoc definitions of equality. For example, in a theory of partial orders with one relation = we could define s = t to be an abbreviation for s = t t = s.


Semantics


Interpretations

In logic and mathematics, an interpretation (also mathematical interpretation, logico-mathematical interpretation, or commonly a model) gives meaning to an artificial or formal language by assigning a denotation to all non-logical constants in that language or in a sentence of that language.

For a given formal language L, or a sentence F of L, an interpretation assigns a denotation to each non-logical constant occurring in L or F. To individual constants it assigns individuals (from some universe of discourse); to predicates of degree 1 it assigns properties (more precisely sets) ; to predicates of degree 2 it assigns binary relations of individuals; to predicates of degree 3 it assigns ternary relations of individuals, and so on; and to sentential letters it assigns truth-values.

More precisely, an interpretation of a formal language L or of a sentence F of L, consists of a non-empty domain D (i.e. a non-empty set) as the universe of discourse together with an assignment that associates with each n-ary operation or function symbol of L or of F an n-ary operation with respect to D (i.e. a function from into ); with each n-ary predicate of L or of F an n-ary relation among elements of D and (optionally) with some binary predicate I of L, the identity relation among elements of D.

In this way an interpretation provides meaning or semantic values to the terms or formulae of the language. The study of the interpretations of formal languages is called formal semantics. In mathematical logic an interpretation is a mathematical object that contains the necessary information for an interpretation in the former sense.

The symbols used in a formal language include variables, logical-constants, quantifiers and punctuation symbols as well as the non-logical constants. The interpretation of a sentence or language therefore depends on which non-logical constants it contains. Languages of the sentential (or propositional) calculus are allowed sentential symbols as non-logical constants. Languages of the first order predicate calculus allow in addition predicate symbols and operation or function symbols.

Models


A model is a pair , where D is a set of elements called the domain while I is an interpretation of the elements of a signature (functions, and predicates).

  • the domain D is a set of elements;
  • the interpretation I is a function that assigns something to constants, functions and predicates:
    • each function symbol f of arity n is assigned a function I(f) from to
    • each predicate symbol P of arity n is assigned a relation I(P) over or, equivalently, a function from to


The following is an intuitive explanation of these elements.

The domain D is a set of "objects" of some kind. Intuitively, a first-order formula is a statement about objects; for example, states the existence of an object x such that the predicate P is true where referred to it. The domain is the set of considered objects. As an example, one can take to be the set of integer numbers.

The model also includes an interpretation of the signature. Since the elements of the signature are function symbols and predicate symbols, the interpretation gives the "value" of functions and predicates.

The interpretation of a function symbol is a function. For example, the function symbol of arity 2 can be interpreted as the function that gives the sum of its arguments. In other words, the symbol is associated with the function I(f) of addition in this interpretation. In particular, the interpretation of a constant is a function from the one-element set D0 to D, which can be simply identified with an object in D. For example, an interpretation may assign the value to the constant .

The interpretation of a predicate of arity n is a set of n-tuples of elements of the domain. This means that, given an interpretation, a predicate, and n elements of the domain, one can tell whether the predicate is true over those elements and according to the given interpretation. As an example, an interpretation I(P) of a predicate P of arity two may be the set of pairs of integers such that the first one is less than the second. According to this interpretation, the predicate P would be true if its first argument is less than the second.

Evaluation


A formula evaluates to true or false given a model and an interpretation of the value of the variables. Such an interpretation associates every variable to a value of the domain.

The evaluation of a formula under a model and an interpretation of the variables is defined from the evaluation of a term under the same pair. Note that the model itself contains an interpretation (which evaluates functions, and predicates); we additionally have, separated from the model, an interpretation

  • every variable is associated its value according to ;
  • a term is associated the value given by the interpretation of the function and the interpretation of the terms: if are the values associated to , the term is associated the value ; recall that is the interpretation of f, and so is a function from to D.


The interpretation of a formula is given as follows.

  • a formula is associated the value true or false depending on whether , where are the evaluation of the terms and is the interpretation of , which by assumption is a subset of
  • a formula in the form or is evaluated in the obvious way
  • a formula is true according to M and if there exists an evaluation of the variables that only differs from regarding the evaluation of x and such that A is true according to the model M and the interpretation
  • a formula is true according to M and if A is true for every pair composed by the model M and an interpretation that differs from only on the value of x


If a formula does not contain free variables, then the evaluation of the variables does not affect its truth. In other words, in this case F is true according to M and if and only if is true according to M and a different interpretation of the variables .

Validity and satisfiability


A model M satisfies a formula F if this formula is true according to M and every possible evaluation of its variables. A formula is valid if it is true in every possible model and interpretation of the variables.

A formula is satisfiable if there exists a model and an interpretation of the variables that satisfy the formula.

Predicate calculus

First-order predicate calculi properly extend propositional calculi. (For simplicity, by a predicate calculus we always mean one that is sound and complete with respect to classical model theory.) They suffice for formalizing many mathematical theories, such as arithmetic and number theory. If a propositional calculus is defined with a suitable set of axioms (or axiom schemata) and the single rule of inference modus ponens
Modus ponens

In classical logic, modus ponendo ponens is a valid, simple argument form sometimes referred to as affirming the antecedent or the law of detachment....
 (this can be done in many ways), then a predicate calculus can be defined from it by adding the inference rule "universal generalization". As axioms and rules for the predicate calculus with equality we take:

  • all tautologies of the propositional calculus;
  • the quantifier axioms, given above;
  • the above axioms for equality;
  • modus ponens;
  • universal generalization.


Call this calculus QC for quantificational calculus. (PC is generally reserved for propositional calculus rather than predicate calculus.) A sentence is defined to be provable (demonstrable) in the calculus if it can be derived from the axioms of the predicate calculus by repeatedly applying its inference rules. In other words:
  • all axioms of the calculus are provable (in the calculus);
  • if the premises of an inference rule are provable, then so is the conclusion.


If T is a set of formulas and φ a single formula, we define a derivation of φ from T (in the calculus), in symbols (we often omit the subscript), as a list of formulas such that and each either is an axiom; follows from previous (possibly j = k) by a rule of inference.

If then for some finite we have . The fact that a sentence is always provable from a finite set of sentences, if it is provable from any set at all, is a consequence of the fact that every derivation in the system is a finite list of formulas. Notice that provability is a special case of derivability from the empty set of premises. In this sense, each calculus K gives rise to a derivability relation . Since we are taking 'predicate calculus' to mean one that is sound and complete with respect to classical model theory, each calculus gives rise to the same derivability relation (taken extensionally).

Mere inspection of the calculus leaves it unclear whether it has not left out some valid formula as derivable or sound rule (also in the derived or admissible
Admissible rule

In logic, a rule of inference is admissible in a formal system if the set of theorems of the system is closed under the rule. The concept of an admissible rule was introduced by Paul Lorenzen ....
 sense). Gödel's completeness theorem
Gödel's completeness theorem

G?del's completeness theorem is a fundamental theorem in mathematical logic that establishes a correspondence between semantic truth and syntactic Provability logic in first-order logic....
 assures us that this is not a problem: any statement true in all models (semantically true) is provable in our calculus.

There are many different (but equivalent) ways to define provability. The above definition is typical for a "Hilbert style" calculus, which has many axioms but very few rules of inference. By contrast, a "Gentzen style" predicate calculus
Sequent calculus

In proof theory and mathematical logic, the sequent calculus is a widely known proof calculus for first-order logic . The term "sequent calculus" applies both to a family of formal systems sharing a certain style of formal inference, and to its individual members, of which the first, and best known, is known under the name LK, distingui...
 has few axioms but many rules of inference.

Provable identities

The following sentences can be called "identities" because the main connective in each is the biconditional
Logical biconditional

In logic and mathematics, logical biconditional is a logical operator connecting two statements to assert, p Iff q where p is a hypothesis and q is a logical consequence ....
. They are all provable in FOL, and are useful when manipulating the quantifiers: (where must not occur free in ) (where must not occur free in )

Derived rules of inference


The following (truth-preserving) rules of inference may be derived in first-order logic.

(If c is a variable, then it must not be previously quantified in P(x)) (there must be no free instance of x in P(c))

Metalogical theorems of first-order logic


Some important metalogical theorems are listed below in bulleted form. What they roughly mean is that a sentence is valid if and only if it is provable. Furthermore, one can construct a program which works as follows: if a sentence is provable, the program will always answer "provable" after some unknown, possibly very large, amount of time. If a sentence is not provable, the program may run forever. In the latter case, we will not know whether the sentence is provable or not, since we cannot tell whether the program is about to answer or not. In other words, the validity of sentences is semidecidable
Decidability (logic)

In logic, the term decidable refers to the existence of an effective method for determining membership in a set of formulas. Logical systems such as propositional logic are decidable if membership in their set of logical validity formulas can be effectively determined....
.

One may construct an algorithm which will determine in finite number of steps whether a sentence is provable (a decidable
Decidability (logic)

In logic, the term decidable refers to the existence of an effective method for determining membership in a set of formulas. Logical systems such as propositional logic are decidable if membership in their set of logical validity formulas can be effectively determined....
 algorithm) only for simple classes of first-order logic.

  1. The decision problem for validity is recursively enumerable; in other words, there is a Turing machine
    Turing machine

    Turing machines are basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm....
     that when given any sentence as input, will halt if and only if the sentence is valid (true in all models).
    • As Gödel's completeness theorem
      Gödel's completeness theorem

      G?del's completeness theorem is a fundamental theorem in mathematical logic that establishes a correspondence between semantic truth and syntactic Provability logic in first-order logic....
       shows, any valid formula is provable. Conversely, assuming consistency of the logic, any provable formula is valid.
    • The Turing machine can be one which generates all provable formulas in the following manner: for a finite or recursively enumerable set
      Recursively enumerable set

      In computability theory, traditionally called recursion theory, a set S of natural numbers is called recursively enumerable, computably enumerable, semidecidable, provable or Turing-recognizable if:...
       of axioms, such a machine can be one that generates an axiom, then generates a new provable formula by application of axioms and inference rules already generated, then generates another axiom, and so on. Given a sentence as input, the Turing machine simply goes on and generates all provable formulas one by one, and will halt if it generates the sentence.
  2. Unlike propositional logic, first-order logic is undecidable
    Decidability (logic)

    In logic, the term decidable refers to the existence of an effective method for determining membership in a set of formulas. Logical systems such as propositional logic are decidable if membership in their set of logical validity formulas can be effectively determined....
     (although semidecidable), provided that the language has at least one predicate of valence at least 2 other than equality. This means that there is no decision procedure that determines whether an arbitrary formula is valid or not. Because there is a Turing machine as described above, the undecidability is related to the unsolvability of the Halting problem
    Halting problem

    In computability theory , the halting problem is a decision problem which can be stated as follows: given a description of a computer program and a finite input, decide whether the program finishes running or will run forever, given that input....
    : there is no algorithm which determines after a finite number of steps whether the Turing machine will ever halt for a given sentence as its input, hence whether the sentence is provable. This result was established independently by Church
    Alonzo Church

    Alonzo Church was an United States mathematician and list of logicians who made major contributions to mathematical logic and the foundations of theoretical computer science....
     and Turing
    Alan Turing

    Alan Mathison Turing, Order of the British Empire, Fellow of the Royal Society was a British mathematician, logician and Cryptanalysis....
    .
  3. Monadic predicate logic (i.e., predicate logic with only predicates of one argument and no functions) is decidable.
  4. The Bernays–Schönfinkel class
    Bernays–Schönfinkel class

    The Bernays?Sch?nfinkel class of formulas, named after Paul Bernays and Moses Sch?nfinkel, is a decidable fragment of first-order logic formulas....
     of first-order formulas is also decidable.


Translating natural language to first-order logic

Concepts expressed in natural language must be "translated" to first-order logic (FOL) before FOL can be used to address them, and there are a number of potential pitfalls in this translation. In FOL, means "p, or q, or both", that is, it is inclusive. In English, the word "or" is sometimes inclusive (e.g, "cream or sugar?"), but sometimes it is exclusive (e.g., "coffee or tea?" is usually intended to mean one or the other, not both). Similarly, the English word "some" may mean "at least one, possibly all", but other times it may mean "not all, possibly none". The English word "and" should sometimes be translated as "or" (e.g., "men and women may apply").

Limitations of first-order logic


All mathematical notations have their strengths and weaknesses; here are a few such issues with first-order logic.

Difficulty in characterizing finiteness or countability


It follows from the Löwenheim–Skolem theorem
Löwenheim–Skolem theorem

In mathematical logic, the L?wenheim?Skolem theorem states that if a countable first-order theory has an infinite model, then for every infinite cardinal number ? it has a model of size ?....
 that it is not possible to define finiteness or countability in a first-order language. That is, there is no first-order formula f(x) such that for any model M, M is a model of f iff the extension of f in M is finite (or in the other case, countable). In first-order logic without identity the situation is even worse, since no first-order formula f(x) can define "there exist n elements satisfying f" for some fixed finite cardinal n. A number of properties not definable in first-order languages are definable in stronger languages. For example, in first-order logic one cannot assert the least-upper-bound
Supremum

In mathematics, given a subset S of a partially ordered set T, the supremum of S, if it exists, is the greatest element of T that is greater than or equal to each element of S....
 property for sets of real number
Real number

In mathematics, the real numbers may be described informally in several different ways. The real numbers include both rational numbers, such as 42 and −23/129, and irrational numbers, such as pi and the square root of two; or, a real number can be given by an infinite decimal representation, such as 2.4871773339...., where the digits co...
s, which states that every bounded, nonempty set of real numbers has a supremum
Supremum

In mathematics, given a subset S of a partially ordered set T, the supremum of S, if it exists, is the greatest element of T that is greater than or equal to each element of S....
; A second-order logic
Second-order logic

In logic and mathematics second-order logic is an extension of first-order logic, which itself is an extension of propositional logic. Second-order logic is in turn extended by higher-order logic and type theory....
 is needed for that.

Difficulty representing if-then-else


Oddly enough, FOL with equality (as typically defined) does not include or permit defining an if-then-else predicate or function if(c,a,b), where "c" is a condition expressed as a formula, while a and b are either both terms or both formulas, and its result would be "a" if c is true, and "b" if it is false. The problem is that in FOL, both predicates and functions can only accept terms ("non-booleans") as parameters, but the "obvious" representation of the condition is a formula ("boolean"). This is unfortunate, since many mathematical functions are conveniently expressed in terms of if-then-else, and if-then-else is fundamental for describing most computer programs.

Mathematically, it is possible to redefine a complete set of new functions that match the formula operators, but this is quite clumsy. A predicate if(c,a,b) can be expressed in FOL if rewritten as (or, equivalently, ), but this is clumsy if the condition c is complex. Many extend FOL to add a special-case predicate named "if(condition, a, b)" (where a and b are formulas) and/or function "ite(condition, a, b)" (where a and b are terms), both of which accept a formula as the condition, and are equal to "a" if condition is true and "b" if it is false. These extensions make FOL easier to use for some problems, and make some kinds of automatic theorem-proving easier. Others extend FOL further so that functions and predicates can accept both terms and formulas at any position.

Typing (Sorts)


FOL does not include types (sorts) into the notation itself, other than the difference between formulas ("booleans") and terms ("non-booleans"). Some argue that this lack of types is a great advantage , but many others find advantages in defining and using types (sorts), such as helping reject some erroneous or undesirable specifications. Those who wish to indicate types must provide such information using the notation available in FOL. Doing so can make such expressions more complex, and can also be easy to get wrong.

Single-parameter predicates can be used to implement the notion of types where appropriate. For example, in: , the predicate could be considered a kind of "type assertion" (that is, that must be a man). Predicates can also be used with the "exists" quantifier to identify types, but this should usually be done with the "and" operator instead, e.g.: ("there exists something that is both a man and is mortal"). It is easy to write , but this would be equivalent to ("there is something that is not a man, and/or there exists something that is mortal"), which is usually not what was intended. Similarly, assertions can be made that one type is a subtype of another type, e.g.: ("for all , if is a man, then is a mammal").

Graph reachability cannot be expressed


Many situations can be modeled as a graph
Directed graph

A directed graph or digraph is a pair G= of:* a Set V, whose element are called vertices or nodes,* a set A of ordered pairs of vertices, called arcs, directed edges, or arrows....
 of nodes and directed connections (edges). For example, validating many systems requires showing that a "bad" state cannot be reached from a "good" state, and these interconnections of states can often be modelled as a graph. However, it can be proved that connectedness cannot be fully expressed in predicate logic. In other words, there is no predicate-logic formula and as its only predicate symbol (of arity 2) such that holds in an interpretation if and only if the extension of in describes a connected graph: that is, connected graphs cannot be axiomatized.

Note that given a binary relation encoding a graph, one can describe in terms of a conjunction of first order formulas, and write a formula which is satisfiable if and only if is connected.

Comparison with other logics


  • Typed first-order logic allows variables and terms to have various types (or sorts). If there are only a finite number of types, this does not really differ much from first-order logic, because one can describe the types with a finite number of unary predicates and a few axioms. Sometimes there is a special type O of truth values, in which case formulas are just terms of type O.
  • First-order logic with domain conditions adds domain conditions (DCs) to classical first-order logic, enabling the handling of partial functions; these conditions can be proven "on the side" in a manner similar to PVS
    Prototype Verification System

    PVS, or the Prototype Verification System, is a specification language integrated with support tools and a theorem prover.It was developed at the Computer Science Laboratory of SRI International, California, USA....
    's type correctness conditions. It also adds if-then-else to keep definitions and proofs manageable (they became too complex without them).
  • The SMT-LIB Standard defines a language used by many research groups for satisfiability modulo theories; the full logic is based on FOL with equality, but adds sorts (types), if-then-else for terms and formulas (ite and if.. then.. else..), a let construct for terms and formulas (let and flet), and a distinct construct declaring a set of listed values as distinct. Its connectives are not, implies, and, or, xor, and iff.
  • Weak second-order logic allows quantification over finite subsets.
  • Monadic second-order logic allows quantification over subsets, that is, over unary predicates.
  • Second-order logic
    Second-order logic

    In logic and mathematics second-order logic is an extension of first-order logic, which itself is an extension of propositional logic. Second-order logic is in turn extended by higher-order logic and type theory....
     allows quantification over subsets and relations, that is, over all predicates. For example, the axiom of extensionality
    Axiom of extensionality

    In axiomatic set theory and the branches of logic, mathematics, and computer science that use it, the axiom of extensionality, or axiom of extension, is one of the axioms of Zermelo-Fraenkel set theory....
     can be stated in second-order logic as x = y =def P (P(x) ? P(y)). The strong semantics of second-order logic give such sentences a much stronger meaning than first-order semantics.
  • Higher-order logic
    Higher-order logic

    In mathematics, higher-order logic is distinguished from first-order logic in a number of ways.One of these is the type of Free variables and bound variables appearing in quantifications; in first-order logic, roughly speaking, it is forbidden to quantify over Predicate s....
    s
    allows quantification over higher types than second-order logic permits. These higher types include relations between relations, functions from relations to relations between relations, etc.
  • Intuitionistic first-order logic
    Intuitionistic logic

    Intuitionistic logic, or constructivist logic, is the symbolic logic system originally developed by Arend Heyting to provide a formal basis for Luitzen Egbertus Jan Brouwer's programme of intuitionism....
     uses intuitionistic rather than classical propositional calculus; for example, ¬¬f need not be equivalent to f. Similarly, first-order fuzzy logics
    T-norm fuzzy logics

    T-norm fuzzy logics are a family of non-classical logics, informally delimited by having a semantics which takes the real unit interval [0, 1] for the system of truth values and functions called t-norms for permissible interpretations of logical conjunction....
     are first-order extensions of propositional fuzzy logics rather than classical logic.
  • Modal logic
    Modal logic

    A modal logic is any system of mathematical logic#Formal logic that attempts to deal with notions of possibility and necessity. Traditionally, there are three "modes" or "moods" or "modalities" of the Copula to be, namely, Logical possibility, probability, and Necessary_and_sufficient_conditions#Necessary_conditions....
     has extra modal operators with meanings which can be characterised informally as, for example "it is necessary that f" and "it is possible that f".
  • In monadic predicate calculus
    Monadic predicate calculus

    In logic, the monadic predicate calculus is the fragment of predicate calculus in which all predicate are unary operator , and there are no function letters....
     predicates are restricted to having only one argument.
  • Infinitary logic
    Infinitary logic

    An infinitary logic is a logic that allows infinitely long Proposition and/or infinitely long Mathematical proof. Some infinitary logics may have different properties from those of standard first-order logic....
     allows infinitely long sentences. For example, one may allow a conjunction or disjunction of infinitely many formulas, or quantification over infinitely many variables. Infinitely long sentences arise in areas of mathematics including topology
    Topology

    Topology is a major area of mathematics that has emerged through the development of concepts from geometry and set theory, such as those of space, dimension, shape, transformation and others....
     and model theory
    Model theory

    In mathematics, model theory is the study of mathematical Structure such as Group , fields, graph , or even models of set theory, using tools from mathematical logic....
    .
  • First-order logic with extra quantifiers has new quantifiers Qx,..., with meanings such as "there are many x such that ...". Also see branching quantifier
    Branching quantifier

    In logic a branching quantifier is a partial orderingof quantifiers for Q?. In classical logic, quantifier prefixes are linearly ordered such that the value of a variable ym bound by a quantifier Qm depends on the value of the variables...
    s and the plural quantifier
    Plural quantification

    In mathematics and mathematical logic, plural quantification is the theory that an individual variable x may take on plural, as well as singular values....
    s of George Boolos
    George Boolos

    George Stephen Boolos was a philosopher and a mathematical logician who taught at the Massachusetts Institute of Technology....
     and others.
  • Predicate Logic with Definitions (PLD, or D-logic) modifies FOL by formally adding syntactic definitions as a type of value (in addition to formulas and terms); these definitions can be used inside terms and formulas.
  • Independence-friendly logic
    Independence-friendly logic

    Independence-friendly logic , proposed by Jaakko Hintikka and Gabriel Sandu, aims at being a more natural and intuitive alternative to classical first-order logic ....
      is characterized by branching quantifier
    Branching quantifier

    In logic a branching quantifier is a partial orderingof quantifiers for Q?. In classical logic, quantifier prefixes are linearly ordered such that the value of a variable ym bound by a quantifier Qm depends on the value of the variables...
    s, which allow one to express independence between quantified variables.


Most of these logics are in some sense extensions of FOL: they include all the quantifiers and logical operators of FOL with the same meanings. Lindström showed that FOL has no extensions (other than itself) that satisfy both the compactness theorem
Compactness theorem

In mathematical logic, the compactness theorem states that a set of first-order predicate calculus sentences has a model theory, iff every finite subset of it has a model....
 and the downward Löwenheim–Skolem theorem
Löwenheim–Skolem theorem

In mathematical logic, the L?wenheim?Skolem theorem states that if a countable first-order theory has an infinite model, then for every infinite cardinal number ? it has a model of size ?....
. A precise statement of Lindström's theorem
Lindström's theorem

In mathematical logic, Lindstr?m's theorem states that first-order logic is the strongest logic having both the compactness theorem and the L?wenheim-Skolem_theorem....
 requires a few technical conditions that the logic is assumed to satisfy; for example, changing the symbols of a language should make no essential difference to which sentences are true.

Algebraizations

Three ways of eliminating quantified variables from FOL, and that do not involve replacing quantifiers with other variable binding term operators, are known:
  • Cylindric algebra
    Cylindric algebra

    The notion of cylindric algebra, invented by Alfred Tarski, arises naturally in the Algebraic logic of first-order logic. This is comparable to the role Boolean algebra s play for propositional logic....
    , by Alfred Tarski
    Alfred Tarski

    Alfred Tarski was a Poles logician and mathematician. Educated in the Warsaw School of Mathematics and philosophy, he emigrated to the USA in 1939, and taught and did research in mathematics at the University of California, Berkeley, from 1942 until his death....
     and his coworkers;
  • Polyadic algebra, by Paul Halmos
    Paul Halmos

    Paul Richard Halmos was a Hungary-born Jewish United States mathematician who made fundamental advances in the areas of probability theory, statistics, operator theory, ergodic theory, functional analysis , and mathematical logic....
    ;
  • Predicate functor logic
    Predicate functor logic

    In mathematical logic, predicate functor logic is one of several ways to express first-order logic by purely algebraic means, i.e., without quantifications....
    , mainly due to Willard Quine
    Willard Van Orman Quine

    Willard Van Orman Quine , was an American analytic philosophy and logician. From 1930 until his death 70 years later, Quine was affiliated in some way with Harvard University, first as a student, then as a professor of philosophy and a teacher of mathematics, and finally as an emeritus elder statesman who published or revised seven books in...
    .
These algebra
Algebra

Algebra is a branch of mathematics concerning the study of structure , relation , and quantity. Together with geometry, mathematical analysis, combinatorics, and number theory, algebra is one of the main branches of mathematics....
s:
  • Are all proper extensions of the two-element Boolean algebra
    Two-element Boolean algebra

    In mathematics and abstract algebra, the two-element Boolean algebra is the Boolean algebra whose underlying set B is the Boolean domain....
    , and thus are lattices
    Lattice (order)

    In mathematics, a lattice is a partially ordered set in which subsets of any two elements have a unique supremum and an infimum . Lattices can also be characterized as algebraic structures satisfying certain Axiom identity ....
    ;
  • Do for FOL what Lindenbaum-Tarski algebra does for sentential logic;
  • Allow results from abstract algebra
    Abstract algebra

    Abstract algebra is the subject area of mathematics that studies algebraic structures, such as group , ring , field , module , vector spaces, and algebra over a field....
    , universal algebra
    Universal algebra

    Universal algebra is the field of mathematics that studies algebraic structures themselves, not examples of algebraic structures.For instance, rather than take particular groups as the object of study, in universal algebra one takes "the theory of groups" as an object of study....
    , and order theory
    Order theory

    Order theory is a branch of mathematics that studies various kinds of binary relations that capture the intuitive notion of ordering, providing a framework for saying when one thing is "less than" or "precedes" another....
     to be brought to bear on FOL.


Tarski and Givant (1987) show that the fragment of FOL that has no atomic sentence
Atomic sentence

Molecular sentence which is a sentence comprised of atomic sentences also redirects here.In Logic, Sentence are those strings of words or symbols which are either true or false....
 lying in the scope of more than three quantifiers, has the same expressive power as relation algebra
Relation algebra

In mathematics, a relation algebra is a residuated Boolean algebra supporting an involution unary operation called converse. The motivating example of a relation algebra is the algebra 2X? of all binary relations on a set X, with R?S interpreted as the usual Composition of relations....
. This fragment is of great interest because it suffices for Peano arithmetic and most axiomatic set theory, including the canonical ZFC
Zermelo–Fraenkel set theory

Zermelo?Fraenkel set theory with the axiom of choice, commonly abbreviated ZFC, is the standard form of axiomatic set theory and as such is the most common foundations of mathematics....
. They also prove that FOL with a primitive ordered pair
Ordered pair

In mathematics, an ordered pair is a collection of two distinguishable objects, one being the first coordinate system , and the other being the second coordinate ....
 is equivalent to a relation algebra with two ordered pair projection functions.

Automation

Theorem proving for first-order logic is one of the most mature subfields of automated theorem proving
Automated theorem proving

Automated theorem proving or automated deduction, currently the most well-developed subfield of automated reasoning , is the mathematical proof of mathematical theorems by a computer program....
. The logic is expressive enough to allow the specification of arbitrary problems, often in a reasonably natural and intuitive way. On the other hand, it is still semidecidable, and a number of sound and complete calculi have been developed, enabling fully automated systems. In 1965 J. Alan Robinson
J. Alan Robinson

John Alan Robinson is a philosopher , mathematician and computer scientist. He is University Professor Emeritus at Syracuse University, United States....
 achieved an important breakthrough with his resolution
Resolution (logic)

In mathematical logic and automated theorem proving, resolution is a rule of inference leading to a Reductio ad absurdum theorem-proving technique for sentences in propositional logic and first-order logic....
 approach; to prove a theorem it tries to refute the negated theorem, in a goal-directed way, resulting in a much more efficient method to automatically prove theorems in FOL. More expressive logics, such as higher-order and modal logics, allow the convenient expression of a wider range of problems than first-order logic, but theorem proving for these logics is less well developed.

A modern and particularly disruptive new technology is that of SMT solvers
Satisfiability Modulo Theories

In computer science, Satisfiability Modulo Theories problem is a decision problem for logical formulas with respect to combinations of background Theory expressed in classical first-order logic with equality....
, which add arithmetic and propositional support to the powerful classes of SAT solvers.

See also

  • Automated theorem proving
    Automated theorem proving

    Automated theorem proving or automated deduction, currently the most well-developed subfield of automated reasoning , is the mathematical proof of mathematical theorems by a computer program....
  • Cylindric algebra
    Cylindric algebra

    The notion of cylindric algebra, invented by Alfred Tarski, arises naturally in the Algebraic logic of first-order logic. This is comparable to the role Boolean algebra s play for propositional logic....
  • Gödel's completeness theorem
    Gödel's completeness theorem

    G?del's completeness theorem is a fundamental theorem in mathematical logic that establishes a correspondence between semantic truth and syntactic Provability logic in first-order logic....
  • Gödel's incompleteness theorems
    Gödel's incompleteness theorems

    In mathematical logic, G?del's incompleteness theorems, proved by Kurt G?del in 1931, are two theorems stating inherent limitations of all but the most trivial formal systems for arithmetic of mathematical interest....
  • List of first-order theories
    List of first-order theories

    In mathematical logic, a first-order logic is given by a set of axioms in somelanguage. This entry lists some of the more common examples used in model theory and some of their properties....
  • List of rules of inference
    List of rules of inference

    This is a list of Rule of inference, logical laws that relate to mathematical formulae....
  • Mathematical logic
    Mathematical logic

    Mathematical logic is a subfield of mathematics and logic with close connections to computer science and philosophical logic. The field includes the mathematical study of logic and the applications of formal logic to other areas of mathematics....
  • Predicate functor logic
    Predicate functor logic

    In mathematical logic, predicate functor logic is one of several ways to express first-order logic by purely algebraic means, i.e., without quantifications....
  • Table of logic symbols
    Table of logic symbols

    In logic, a set of symbols is commonly used to express logical representation. As logicians are familiar with these symbols, they are not explained each time they are used....
  • Algebra of sets
    Algebra of sets

    The algebra of sets develops and describes the basic properties and laws of Set , the set-theoretic operations of union , intersection , and complement and the binary relation of set equality and set subset....
  • Alloy (specification language)
    Alloy (specification language)

    In computer science and software engineering, the Alloy specification language is a declarative language for expressing complex structural constraints and behavior in a software system....


External links

  • Stanford Encyclopedia of Philosophy
    Stanford Encyclopedia of Philosophy

    The Stanford Encyclopedia of Philosophy is a Open access online encyclopedia of philosophy maintained by Stanford University. The SEP was initially developed with U.S....
    : " -- by Stewart Shapiro. Covers syntax, model theory, and metatheory for first-order logic in the natural deduction style.
  • , by P.D. Magnus, covers formal semantics and proof theory for first-order logic.
  • : an ongoing online project to reconstruct mathematics as a huge first-order theory, using first-order logic and the axiomatic set theory ZFC
    Zermelo–Fraenkel set theory

    Zermelo?Fraenkel set theory with the axiom of choice, commonly abbreviated ZFC, is the standard form of axiomatic set theory and as such is the most common foundations of mathematics....
    . Principia Mathematica
    Principia Mathematica

    The Principia Mathematica is a 3-volume work on the foundations of mathematics, written by Alfred North Whitehead and Bertrand Russell and published in 1910?1913....
     modernized and done right.
  • Podnieks, Karl.
  • Cambridge Mathematics Tripos Notes : " -- Notes typeset by John Fremlin. The notes cover part of a past Cambridge Mathematics Tripos course taught to undergraduates students (usually) within their third year. The course is entitled "Logic, Computation and Set Theory" and covers Ordinals and cardinals, Posets and zorn’s Lemma, Propositional logic, Predicate logic, Set theory and Consistency issues related to ZFC and other set theories.