Week S2.1. Intro to Predicate Logic

 

Basic Elements of First-Order Logic

Propositional logic is not flexible as each propositional statement is in some way indivisible / atomic, they cannot be decomposed into the elements they refer to.

Example: Problems with Propositional Logic

Consider a system where:

  • : all friends of Max are friends of John
  • : Paul is a friend of Max
  • : Paul is a friend of John

We cannot represent a system in which follows from and because in this propositional logic, for this specific case, we have that .

In propositional logic, all models of , are models of . But the truth value of does not depend on the truth values of and , as there is no link between them. For this reason, we cannot derive from and .

Objects / Individuals & Domain

Predicate

A predicate is a building block of statements in first-order logic, it is used to assert a property of an object or a relationship between objects.

Link to original

Atomic formula

Applying a predicate to one or more terms creates an atom, which is also a simple formula of this language, called an atomic formula.

Link to original

Monadic Predicate

A monadic (or unary) predicate can be used to give a property to a single individual (denoted by a term), the notation has the form:

Examples:

  • - The car is yellow.
  • - 29 is prime.
Link to original

Polyadic Predicate

A polyadic predicate can be used to assign a relation to an ordered list of individuals, the notation has the form:

where is an -place (or, otherwise -ary) predicate.

is the Arity of the predicate.

Examples:

  • : divides (with no remainder)
  • : Helsinki is in Finland
Link to original

Function (FOL)

A function symbol is used to specify an individual by means of one or more other individuals. The notation, for an -ary function symbol is:

Examples:

  • is the square root of .
  • is .
Link to original

Equality (FOL)

In first-order logic, we can use an equality operator () to state that two objects equal to one another.

We use the notation:

This also forms an atomic formula.

Examples of use:

Link to original

Variables and Quantifiers

Terms, predicates, and functions cannot encode statements which refer to potentially unknown or unnamed objects. For these sorts of statements, we introduce symbols that are placeholders for unnamed objects.

Variables

Variable (Predicate Logic)

A variable is a term which does not refer to a fixed individual but is free to change what it refers to over the whole range of available individuals.

Example use of variables:

  • : is a person.
  • : is a student at .
Link to original

Quantifiers

Quantification

Quantification is a means of expressing statements which do not refer to any named individuals.

Link to original

Existential Quantifier

Existential quantifier

The existential quantification of for a particular domain, denoted by , is the proposition that "there exists a value for $x$ in the domain such that $P(x)$ is true".

  • The truth value of might change when domain changes.
  • Domain must always be specified when used.

For example, take is "":

  • If the domain is all integers, then it is true.
    • We simply need to give one example, such as then is true.
  • If the domain is the positive integers, then it is false.

To say “(at least one) car is yellow”, we write that for some , is yellow:

In general, the notation for existential quantifiers is $(\exists x)(\phi)$, where $\phi$ is a formula in which $x$ and possible other variables may appear..

Link to original

Examples:

  • : Some boy likes Jane.
  • : Jane likes some boy.
  • : No-one likes Jane.
  • : Someone does not like anyone.

Universal Quantifier

Universal quantifier

The universal quantification of for a particular domain, denoted by , is the proposition "$P(x)$ is true for all values of $x$ from the domain". $\forall$ means "For all".

  • The truth value of might change if domain changes.
  • Domain must always be specified when universal quantifier is used.

For example, take is "":

  • For the domain of positive integers, .
  • For the domain of all integers, .

To say “Everyone does not like Jane”, we write that for every , does not like Jane:

In general, the notation for universal quantifiers is $(\forall x)(\phi)$ where $\phi$ is a formula in which $x$ and possible other variables may appear.

Link to original

Examples:

  • : Every boy does not like Jane.
  • : Not everyone likes Jane.
  • : Everyone who likes Bob, likes Mary.
  • : Everyone is liked by each person that they like.

Mixing Quantifiers

You can mix different types of quantifiers together:

  • : Everyone studies at some university.
  • : Every university has at least one student.
  • : Everyone studies in at most one university.

Scope of quantifiers

Consider the quantified formula where is a quantifier (either or ) and is a formula.

Scope (Quantifiers)

Given , scope of a quantifier is .

Link to original

Bound Variable (Quantifiers)

Given , the occurrence of the variable immediately after the quantifier symbol is said to be bound.

All occurrences of the variables in , are said to be bound.

Link to original

Free Variable (Quantifiers)

An occurrence of a variable that is not bound is said to be free.

Link to original

Sentence (Quantifiers)

A formula without free variables is called a sentence.

Link to original

Examples of Scope
  1. The scope of is . The first two occurrences of are bound, where the third occurrence of is free. The occurrence of is free.
  2. The scope of is . All occurrences of are bound. Occurrence of is free.
  3. The scope of is . The scope of is . All occurrences of variables are bound.

Solving the initial example: “problems with propositional logic”

If we go back to our three initial statements:

  • : all friends of Max are friends of John
  • : Paul is a friend of Max
  • : Paul is a friend of John

We can encode them in a first-order logic language:

  • : in FOL, this can be derived from first two statements.

To solve this, we need to formally define the semantics of logic and notion of logical consequence in FOL.

Formal Definition of FOL language syntax

The language of a first-order logic is characterized by the terms, functions, predicates, quantifiers, and so on.

Different meanings can be associated with a sequence of symbols, hence different semantics can be associated with a first-order language, two of them are: Classical and Herbrand semantics. These two semantics are different but similar, and under some circumstances equivalent.

Classical Semantics

Classical semantics is usually adopted in mathematical logics.

Link to original

Herbrand Semantics

Herbrand semantics is usually adopted in relational database theory and applications.

Link to original

Syntax of FOL

Vocabulary (Predicate Logic)

A vocabulary (signature) is a collection of:

  • a non-empty set of constants (symbols).
  • a possible empty set of functions (symbols), each of them associated with an integer .
  • a possibly empty set of predicates (or relations), each of them associated with an integer .
Link to original

Alphabet (Predicate Logic)

Given a vocabulary , the alphabet of a first-order language over is a set of symbols comprising:

  • a countably infinite set of variables (with super and subscripts)
  • : the Boolean values true and false
  • : the logical connectives
  • : the quantifiers’ symbols
  • : the equality symbol;
  • : the parentheses
  • : the comma
  • all the constant, predicate, and function, symbols (with their associated arity) from
Link to original

Expression (Predicate Logic)

An expression of a first-order language is any finite sequence of symbols of the alphabet of the language.

is set of all expressions that can be built by the symbols in the alphabet .

Link to original

Since no constraint is imposed over how symbols can be arranged in expressions, many expressions can be nonsensical so we need to select some expressions that make sense for us, e.g. .

Terms (Predicate Logic)

The -terms of a first-order language over are the expressions from defined via the following rules:

  • every variable is a -term
  • every constant in is a -term
  • if the expressions are -therms and is an -ary function in , then the expression is also a -term
Link to original

Formulas (Predicate Logic)

Given a vocabulary , the -formulas of a first-order language over are expressions from defined by the following rules:

  • and are -formulas
  • if and are -terms, then is also a -formula (an atomic formula)
  • if are -terms and is an -ary predicate in , then the atom is also a -formula (also an atomic formula)
  • if is a -formula, then is also a -formula
  • if and are -formulas, then are also -formulas
  • if is a variable and is a -formula and are also -formulas
Link to original

First-order Language

The first-order (or predicate logic) language over the vocabulary , denoted by , is the set of all expressions over that are moreover -formulas.

Link to original

Interpretations for FOL formulas

Semantic of FOL

We have seen how FOL formulas are written, we now need to be able to evaluate whether a FOL formula is true or false, this is the semantic of FOL.

Link to original

Similarly to propositional logic, the truth-value of a FOL formula depends onthe truth-values assigned to its “components”.

Interpretation (Predicate Logic)

An interpretation for a first-order logic language consists of a non-empty domain of objects, over which the variables may range, together with an assignment of a meaning to the predicate, constants, functions, and symbols.

Link to original

Example: Importance of Domain

Consider the formula , where the symbol "" is interpreted as the usual sum operation and the symbol "" is interpreted as the object “number ”.

If the domain in the interpretation is the set of natural numbers, then the formula is false in the interpretation. If the domain in the interpretation is the set of rational numbers, then the formula is true in the interpretation.

Hence, the domain in the interpretation can make a difference in the truth value of a formula.

Example: Importance of interpreting predicates

Consider the formula and an interpretation with domain (the set of natural numbers). If the binary predicate is interpreted as “successor”, i.e. is true whenever is the successor of in , we have and as true, whereas and are false.

Otherwise if we interpret it as the “predecessor”, is true when is the predecessor of in then the opposite is true. Hence, different interpretations of the predicates can make a difference in the truth table of a formula.

Satisfaction of a formula

Satisfaction of a formula

Let be a -formula of a first-order language , and let be an interpretation for . The interpretation satisfies the formula , denoted by , based on the following inductive rules:

  • at all times and never .
  • For terms, and , and are interpreted in as the same object in the domain.
  • For an -ary predicate and terms , is true in .
  • For a formula , does not hold.
  • For formulas and , and .
  • For formulas and , or .
  • For formulas and , .
  • For formulas and , .
  • For a variable and a formula , for all objects , . For a of finite size, equals .
  • For a variable and a formula , for all objects . For a of finite size, equals .

Notation: in the formulas above, denotes the formula obtained from in which all free occurrences of are substituted for the object .

Link to original

Model (Predicate Logic)

If satisfies , is said to be a model of . If does not satisfy , it can be denoted by .

For an interpretation and a formula , we can also write and to say that satisfies and does not satisfy respectively.

Link to original

Satisfiable (Predicate Logic)

A formula is satisfiable if it admits a model, e.g. this formula is a contradiction: .

Link to original

Unsatisfiable (Predicate Logic)

A formula is unsatisfiable (contradiction) if it does not admit any model, e.g. this formula is a tautology: .

Link to original

Valid (Predicate Logic)

A formula is valid (tautology) if it is satisfied by all interpretations, e.g. this formula is a tautology: .

Link to original

Example: Truth-value of a formula 1

Consider the formula for the following interpretations:

InterpretationEvaluationExplanation



There is no witness, shown by counter-examples for each of the possible choices of : and



The witness is , as for this specific choice of there is no counter-example on .

Example: Truth-value of a formula 2

Consider the interpretations below where symbols , and are interpreted in the usual way for different mathematical operations. And consider as the constant symbol interpreted as the number zero.

Say whether the following formulas are true or not depending on the domain of interpretation.

Formula

Logical consequence

An interpretation is a model of the set of -formulas, denoted by for all .

A set of -formulas is satisfiable admits a model.

The -formula is a logical consequence of a set of of -formulas, denoted by every model of is also a model of .

or means that is valid because all interpretations are models of the empty set .

Two -formulas and are logically equivalent, denoted by and .