First-order logic (FOL) is a type of logical language. It is the most expressive language that has a somewhat “appropriate” automated inference procedure, called resolution. FOL must be defined with the following components:

  • A set of variables. These represent objects in the domain.
  • A set of function symbols. These map objects to other objects (like sit(John, chair)).
    • 0-ary function symbols are called constant symbols.
  • A set of predicate (relation) symbols. These evaluate to true/false and are defined over terms.

From here, we make a few more definitions:

  • Terms denote any expression that represents an element in the universe. These are constructed with variables and functions. For example: x, 5, f(g(x, y)).
  • Atomic formulas are predicate symbols applied to terms. These are the simplest well-formed formula that can have a truth value. Predicates form atomic symbols. These denote properties and relations that hold about the elements in the universe.
    • The “atomic” comes from a lack of logical symbols (AND, OR) in the formulas.
    • is true in if objects assigned to are related to each other by .
  • Formulas are expressions that evaluate to true or false. These themselves can be atomic formulas or built from atomic formulas using logical operators.
    • We can create complex assertions by composing atomic formulas.
    • Their truth is dependent on the truth of the atomic formulas in them.

A set of function and predicate symbols is called a first-order vocabulary. Note that variables are not part of the vocabulary. We can construct this set recursively:

  • Base: Every variable is a term.
  • Recursion: If is an -ary function symbol in and are -terms, then is a -term.
    • So long as we have a function symbol with variables, then the number of terms we can generate is infinite.

The set of first-order -formulas (syntax) is defined recursively. We have two more operators than in propositional logic.

  • Atomic formulas: , where is an -ary predicate symbol in and are -terms.
  • Negation: , where is a -formula.
  • Conjunction: , where are -formulas.
  • Disjunction: , where are -formulas.
  • Implication: , where are -formulas.
  • Existential: , i.e., there exists some such that is true, where is a variable and is a -formula.
  • Universal: , where is a variable and is a -formula.

Conversion from natural language

Some basic representations:

  • Individuals/constants/0-ary functions: rain, snow, names (Tony, Mike, Nick).
  • Types: unary predicates
    • might indicate that is a skier.
  • Relationships: binary predicates
    • might indicate that likes .

Some tips:

  • For separate predicates, we can translate them separately, then combine them with a conjunction/disjunction/implication.
  • If the statement says “all” or “whatever”, that’s a good sign to use the universal operator.
  • “Is there an x that predicate?”, we can use .

Structures

Each FOL interpretation should:

  • Specify the objects in the world.
  • Settle which objects satisfy predicate .
  • Assigns to a function a mapping from objects to objects (assuming functions are always well-defined and single-valued).

Let be a first-order vocabulary. An -structure consists of the following:

  • A non-empty set called the universe (or domain) of discourse.
  • For each -ary predicate symbol , an associated relation . is called the extension or interpretation of the predicate symbol in .
  • For each -ary function symbol , an associated function . is called the extension or interpretation of the function symbol in .
    • If , then is a constant symbol and is simply an element of .

is essentially a world configuration.

Sometimes, our formula may only be satisfied for certain variables in the domain. In this case, we must assign the objects. Let be a structure and be a set of variables. An object assignment for is a mapping from variables in to the universe of .

However, sometimes we must extend this to function symbols (imagine a nested function . The extension of is defined recursively:

  • For every variable , .
  • For every function symbol .

For an -formula , (i.e., satisfies under , or is a model of under ) is defined recursively on the structure of as follows, assuming are -formulas:

    • A predicate symbol applied to terms is satisfied if the tuple of values assigned to those terms belong to the interpretation of in the model .
    • An equality is satisfied if both terms evaluate to the same value in the assignment.
    • Negation is satisfied if the formula being negated is not satisfied.
    • A disjunction (OR) is satisfied if at least one of the disjuncts is satisfied.
    • A conjunction (AND) is satisfied if both conjuncts are satisfied.
    • A universal quantification is satisfied if the formula is satisfied for every possible value in the domain.
    • An existential quantification is satisfied if the formula is satisfied for at least one value in the domain.

A structure satisfies (a set of sentences), denoted by if for every sentence , . If , we say is a model of . We say that is satisfiable if there is a structure such that .

For a set of sentences , a sentence is a logical consequence of (denoted by ) iff for every structure , if , then . Alternatively, then there is no such that , i.e., is unsatisfiable.

An occurrence of in is bounded (is “quantified”) iff it is in a sub-formula of of the form or . Basically, a variable is bound if it appears within the scope of a quantifier ( or ) that uses the same variable. The quantifier “binds” the variable, similar to how a parameter in a function definition binds the parameter name to values passed to the function. Otherwise the occurrence is free. For example, the in is free, but the in the other and are bounded by the existential quantifier :

A formula is closed if it contains no free occurrence of a variable. A closed formula is called a sentence. If and agree on the free variables of , then iff . If is a sentence (no free variables), then is irrelevant and we omit mention of and simply write .