6.2 Introduction

6.2.1 Definition

We denote the set of (syntactic representations of) statements as a subset of the finite bit-strings . Then is the set of (syntactic representations of) proof strings.

Every statement is either true or false. The truth function assigns to each it’s truth value . This function defines the meaning, the semantics of objects in .

An element is either a (valid) proof for a statement or it is not. This can be defined via a verification function , where means that is a valid proof for statement .

Note that we consider in this chapter, without strong loss of generality. We simply define syntactically wrong statements as being false.

6.1 Proof system

A proof system is a quadruple as above.

6.2 Soundness

A proof system as above is sound if no false statement has a proof. For all for which there exists a with , we have .

6.3 Completeness

A proof system is complete if every true statement has a proof. For all with , there exists a such that .

Soundness and Completeness

Completeness: If the statement is true, there is a proof.

Soundness: If there is a proof, the statement is true.

One often requires that the proof function be efficiently computable. A proof system is useless if verification is infeasible.

6.2.3 Discussion

While proof verification should generally be fast / easy, proof generation is a hard problem.

A proof system is always restricted to a certain type of mathematical statement.

While a proof system can exist for one type of statement (ex: “There is a solution to this sudoku.” or “This prime is factorisable”) for which the proof is a straightforward construction, the negation might have no proof system (ex: “There is no solution to …“).

6.2.4 Proof Systems in Computer Science

The predicate defines the set of strings that correspond to true statements. This set of strings is called a formal language. Every such set also conversely defines a predicate .

6.3 General Concepts in Logic

The goal of logic is to provide a specific proof system with which we can express a very large class of mathematical statements in . Note however that it’s never possible to create a proof system that captures all such statements, especially self referential statements.

A logic is defined by the syntax and semantics. In logic, consists of one or more formulas. A proof consists of a derivation or deduction which applies a certain sequence of syntactic steps. These steps follow rules, which define a calculus.

A rule in general has some placeholders which an interpretation fixes to some specific values.

6.3.2 Syntax

6.4 Syntax

The syntax of a logic defines an alphabet (of allowed symbols) and specifies which strings in are formulas (i.e. syntactically correct).

In propositional logic, we have and as symbols for example, combined with and … These then take on a value in a certain domain associated to the symbol.

6.3.3 Semantics

6.5 Semantics

The semantics of a logic defines (among other things) a function , which assigns to each formula a subset of the indices. If , then the symbol is said to occur in .

Note that the same symbol can occur free in one place and unfree in another.

6.6 Interpretation

An interpretation consists of a set of , a domain (a set of possible values) for each symbol in , and a function that assigns to each symbol in a value in the associated domain.

Often the domain is defined in terms of the universe where a symbol can be a function, predicate or element of .

Empty Universe

Note that the universe cannot be empty and it’s also not necessarily a set, as there are restrictions on what those can be by Zermelo-Fränkel.

6.7 Suitability

An interpretation is suitable for a formula if it assigns a value to all symbols occuring free in .

6.8 Truth value under interpretation

The semantics of a logic also defines a function assigning to each formula and each interpretation suitable for a truth value in . In treatments of logic one often writes instead of and calls the truth value of under interpretation .

6.9 Model

A (suitable) interpretation for which a formula is true, (i.e. ) is called a model for and one also write More generally, for a set of formulas, a (suitable) interpretation for which all are true is called a model for denoted as If is not a model for one writes .

Note that is equivalent to and .

Example: If a structure fulfills all group axioms, we say , thus it is a group.

6.3.5 Satisfiability, Tautology, Consequence, Equivalence

6.10 Satisfiability

A formula (or a set ) is called satisfiable if there exists a model for and unsatisfiable otherwise. The symbol is used for an unsatisfiable formula.

6.11 Tautology

A formula is called a tautology or valid if it is true for every suitable interpretation. The symbol is used. We can also write this as: "".

6.12 Logic Consequence

A formula is a logical consequence of a formula (or a set ) denoted if every interpretation suitable for both and which is a model for is also a model for .

Written otherwise: .

6.13 Equivalent

Two formulas and are equivalent, denoted if every interpretation suitable for both and yields the same truth value for and , i.e.e if each one is a logical consequence of the other:

A set of formulas can be interpreted as the conjunction (AND) of all formulas in , since is a model for if and only if it is a model for all formulas in : is .

6.14 Tautology

If is a tautology one also write . If it’s unsatisfiable it can be written as .

Note that we’ll also use later. If this means that is unsatisfiable, as the empty set cannot be made true under any interpretation (it has no literals to set to true).

6.3.6 Logical Operators and

6.15 NOT, AND, OR

If and are formulas, then also , and are formulas.

Note that is a disjunction while is a conjunction. Because the operators are associative, formulas can be dropped in an informal setting.

Implication

stands for as a notational coonvention. Similarly stands for .

6.16 Semantics of Propositional Logic

  1. if and only if and .
  2. if and only if or .
  3. if and only if

6.1 Basic Equivalences

For any formulas F, G, and H we have:

  1. and (idempotence)
  2. and (commutativity)
  3. and (associativity)
  4. and (absorption)
  5. (distributive law)
  6. (distributive law)
  7. (double negation)
  8. and (de Morgan’s rules)
  9. and (tautology rules)
  10. and (unsatisfiability rules)
  11. and

6.3.7 Logical Consequences vs. Unsatisfiability

6.2 Tautology

A formula is a tautology if and only if is unsatisfiable.

6.3 Tautology Equivalences

The following three statements are equivalent:

  1. is a tautology
  2. is unsatisfiable.

This lemma is very important for the resolution calculus! The fact that is equivalent to is unsatisfiable makes the resolution calculus powerful enough to also show implications.

6.3.8 Theorems and Theories

An axiom is a statement taken as true in a theory. Theorems are the statements which follow from these axioms ().

If a theorem follows from the empty set of axioms , then it’s a tautology. This means that it’s a theorem in any theory!

6.4 Logical Calculi

A well defined set of rules for manipulating formulas (the syntactic objects) is called a calculus. There are also calculi, in which more complex objects are manipulated. There is a trade-off between simplicity (which makes proving soundness easier) and versatility (which makes the calculus more complete).

6.4.2 Hilbert-Style Calculi

In a Hilbert-style calculus, the syntactic objects being manipulated are formulas.

6.17 Derivation (or inference) rule

A derivation or inverence rules is a rule for deriving a formula from a set of formulas (called the precondition or premises). We write if can be derived from the set by rule . Formally a derivation rule is a relation from the power set of the set of formulas to the set of formulas, and the symbol can be understood as the relation symbol.

Derivation is a purely syntactic concept!

6.18 Application of a derivation rule

The application of a derivation rule to a set of formulas means:

  1. Select a subset of such that for some formula .
  2. Add to the set (i.e., replace by ).

6.19 Logical Calculus

A (logical) calculus is a finite set of derivation rules: .

6.20 Derivation

A derivation of a formula from a set of formulas in a calculus is a finite sequence (of some length ) of applications of rules in , leading to . More precisely, we have

  • for , where for some and for some and where
  • . We write if there is a derivation of from in the calculus .

A derivation rule is usually defined on the basis of placeholders for more complex formulas: can be instantiated with .

6.4.3 Soundness and Completeness of a Calculus

For a calculus to make sense, the syntactic concept of derivation should be similar to the semantic concept of logical consequence.

6.21 Correctness

A derivation rule is correct if for every set of formulas and every formula , implies :

6.22 Correctness (or soundness) of a Calculus

A calculus is sound or correct if for every set of formulas and every formula , if can be derived from then is also a logical consequence of : is complete if for every and , if is a logical consequence of then can also be derived from :

Hence, it’s sound and complete if . It’s sound if and only if every rule itself is correct.

Note that to denote a tautology in a calculus, you write , as it can be derived from the empty set of formulas.

6.4.4 Some Derivation Rules

These rules are valid in propositional logic, and any logic which contains propositional logic.

All equivalences from Lemma 6.1 can be used as derivation rules.

Other rules in PL

These rules are also valid in PL, they capture logical consequences.

  • (modus ponens)
  • (case distinction)

Note that such rules aren’t necessarily independent (i.e. they can be circularly derived).

To begin a derivation, we may use any tautology, such as .

6.4.5 Derivations from Assumptions

If in a sound calculus one can derive from the set of formulas (), then one has proved that is a tautology and thus that .

One could also extend the calculus by the new derivation .

6.5 Propositional Logic

6.5.1 Syntax

6.23 Syntax of Propositional Logic

An atomic formula is a symbol of the form , with . A formula is defined as follows:

  • An atomic formula is a formula.
  • If and are formulas, then also , , .

Note that this is a recursive definition.

6.5.2 Semantics

In propositional logic, the free symbols of a formula are all the atomic formulas. In propositional logic an interpretation is called a truth assignment, which assigns a truth value to all free symbols.

6.24 Semantics of Propositional Logic

For a set of atomic formulas, an interpretation called truth assignment, is a function . A truth assignment is suitable for a formula if it contains all atomic formulas appearing in . The semantics are defined as such:

  1. for any atomic formula .
  2. if and only if and .
  3. if and only if or .
  4. if and only if

6.5.3 Brief Discussion of General Logic Concepts

Two formulas and are equivalent if their functions (truth tables) are equivalent.

if the function table of contains a for at least all arguments for which the function table of contains a .

6.5.4 Normal Forms

Literal 6.25

A literal is an atomic formula or the negation of an atomic formula.

6.26 CNF

A formula is in conjunctive normal form (CNF) if it is a conjunction of disjunctions of literals, i.e. of the form:

6.27 DNF

A formula is in disjunctive normal form (DNF) if it is a disjunction of conjunctions of literals, i.e. of the form:

6.4 Equivalent to CNF, DNF

Every formula is equivalent to a formula in CNF and also to a formula in DNF.

The proof is constructive, the method of which is exam-relevant.

Find a CNF formula from the truth table

For every row of the function table evaluating to , one takes the disjunction of the literals as follows:

  • If in the row one takes
  • If in the row one takes Then one takes the conjunction of all these rows.

This works because is exactly if every single disjunction is true, which is the case by construction.

Find a DNF formula from the truth table

For every row of the function table evaluating to , one takes the conjunction of the literals as follows:

  • If in the row one takes
  • If in the row one takes Then one takes the disjunction of all these rows.

This works because is exactly if one of the rows is , which is the case by construction.

Note that we can also use the basic equivalences of PL to carry out the transformation to CNF or DNF.

Uniqueness

The CNF or DNF forms are not unique!

6.5.5 The Resolution Calculus

The resolution calculus consists of a single rule. It allows us to prove that a set of formulas is unsatisfiable.

Clause

A clause is a set of literals.

Example: is a clause. The empty set is a clause.

6.29 Formula to clause

The set of clauses associated to a formula in CNF, denoted as , is the set

Note that we denote the set of clauses for a formula with .

6.29

The set of clauses associated with a set of formulas is the union of their clause sets:

A clause stands for the disjunction of it’s literals. It’s thus only satisfied if one of it’s literals evaluates to true. Likewise, the set of clauses is the conjunction, it’s only satisfied if every clause within is satisfied.

Emptyset

  • The empty clause (formula with no literals) corresponds to an unsatisfiable formula.
  • The empty set of clauses corresponds to a tautology (trivially satisfiable as vacuously true.

Note on empty sets:

  1. From you can derive everything (false implies both true and false), thus the empty clause set is a tautology.
  2. If you can derive (false) from something, it has to be false: .
  3. The tautology is the neutral element of which explains why the empty clause set is a tautology: the conjunction of nothing gives .
  4. On the other hand, is the neutral element of the disjunction , thus the empty clause is unsatisfiable.

Note that since CNF forms are not unique, there are also many equivalent clause sets. Conversely, one clause set corresponds to many equivalent formulas, which can be seen as a canonical formula.

6.30 Resolvent

A clause is resolvent of clauses and if there is a literal such that , , and

One operation at once

The resolution calculus doesn’t allow removing two complementary literals at once! The derivation is wrong and illegal! Indeed for , this is true.

Resolution step

Given a set of clauses, a resolution step takes two clauses and , computes a resolvent , and adds to :

6.5 Soundness

The resolution calculus is sound, i.e. if , then .

Proof Idea If models the set then it makes at least one literal in both true. We distinguish:

  • then (as we it has ) has at least one other literal that evaluates to true. Therefore the union is also true.
  • WLOG

6.6 Unsatisfiable

A set of formulas is unsatisfiable if and only if .

Proof:

  1. The soundness follows from Lemma 6.5.
  2. The other direction (completeness regarding unsatisfiability), that if is unsatisfiable we need a derivation of can be shown constructively by induction.
    1. There is only a single unsatisfiable set of clauses for literals: .
    2. We can remove / from all formulas, producing two sets /.
    3. We can now produce a derivation to if it’s unsatisfiable by the I.H.
    4. By simply adding back in the literals , we get two derivations from .
      1. If by chance we didn’t use a clause with or the negation in it, then we have a derivation for already.
      2. Otherwise, we get a derivation for and one for , which resolves.
      3. Done.

Prove Logical Consequence in Resolution Calculus

If we want to prove that , then we show that . This works by Lemma 6.3.

6.6 Predicate Logic

Propositional logic is embedded into predicate logic as a special case. We extend it by the concept of predicates.

6.6.1 Syntax

6.31 Syntax of Predicate Logic

  • A variable symbol is of the form with .
  • A function symbol is of the form with where denotes the number of arguments (the arity) of the function. Function symbols for are called constants
  • A predicate symbol is of the form with , where denotes the number of arguments of the predicate.
  • A term is defined inductively: A variable is a term, and if is a term. For one writes no parenthesis.
  • A formula is defined inductively:
    • For any and if are terms, then is a formula, called an atomic formula.
    • If and are formulas, then , , are formulas (From propositional logic)
    • If is a formula, then for any , and are formulas.

is called the universal quantifier, is the existential quantifier.

A formula constructed like this corresponds naturally to a tree where the leaves correspond to terms and the inner nodes to operators and quantifiers.

6.6.2 Free Variables and Variable Substitution

6.32 Bound and Free Variables

Every occurence of a variable in a formula is either bound or free. If a variable occurs in a (sub-)formula of the form or then it is bound, otherwise it is free. A formula is closed if it contains no free variables.

Important the same variable can occur both bound and free in a formula. We can then replace all occurrences of the bound variable with another letter:

6.33 Substitution

For a formula , a variable and a term , denotes the formula obtained from by substituting every free occurence of by .

6.6.3 Semantics

Interpretation of Predicate Logic

An interpretation or structure is a tuple where:

  • is a non-empty universe (which is not the same as a set)
  • is a function assigning to each function symbol (in a certain subset of all function symbols) a function, where for -ary function symbol , is a function . Thus (function from free symbol to functions on )
  • is a function assigning to each predicate symbol (in a certain subset of predicate symbols) a function, where for a -ary predicate symbol , is a function ()
  • is a function assigning to each variable symbol (in a certain subset of all variable symbols) a value in . .

One writes instead of for notational convenience (and , and ).

6.35 Suitability

An interpretation is suitable for a formula if it defines all function symbols, predicate symbols and freely occurring variables of .

Semantics

For an interpretation we define the value (in ) of terms and the truth value of formulas under that structure.

  • The value of a term is defined recursively as follows:
    • If is a variable, i.e. , then
    • If is of the form for terms and a -ary function symbol , then . For this definition, we also allow a term to be a fixed element of .
  • The truth value of a formula is defined recursively by Definition 6.16 and:
    • If is of the form then
    • If is of the form or , then let for in be the same structure as , except that is overwritten by (i.e. ):

Note that as mentioned before, nested variables and quantifiers need not be distinct.

Note also that the equality symbol is not allowed.

6.6.5 Some Basic Equivalences involving Quantifiers

6.7

For any formulas , , and , where does not occur free in , we have

  1. ;
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7. ;
  8. ;
  9. ;
  10. .

IMPORTANT Note that quantifier order matters for nested variables. is not equivalent to ! You are allowed to do this when they’re not nested

6.8 Sub-Formulas

If one replaces a sub-formula of a formula by an equivalent (to ) formula , then the resulting formula is equivalent to .

6.6.6 Substitution of Bound Variables

The name of a bound variable carries no semantic meaning and can be replaced.

6.9 Bound substitution

For a formula in which does not occur, we have:

6.37 Rectified Form

A formula in which no variable occurs both as a bound and as a free variable and in which all variables appearing after the quantifiers are distinct is said to be in rectified form.

By appropriately renaming quantified variables one can transform any formula into an equivalent rectified form.

6.6.7 Normal Forms

6.38 Prenex Form

A formula of thee form where the are arbitrary quantifiers and is a formula free of quantifiers is said to be in prenex form.

Note that as stated before, quantifier order matters here!

Examples:

  • becomes Note that the order of matters here, because they appear together in predicate
  • , the order of does not matter, as they don’t appear together.

6.10 Prenex

For every formula there is an equivalent formula in prenex form.

First one rectifies the formula (rename all bound occurrences clashing with free variables) and then uses the equivalences in 6.7 to move up all quantifiers in the tree.

(Extra from Lecture) Skolem Normal Form

See notes from Shivi: Skolem Normal Form

We can also transform all formula into a prenex form with only universal quantifiers. The formula is then not equivalent, but only equivalent with respect to satisfiability (equisatisfiable).

This transformation to Skolem Normal Form works by replacing all variables bound to an by a function whose arguments are the universally quantified variables that preceed it.

This makes sense because:

  • If the is the first quantifier in the formula, then it doesn’t depend on anything, and we can just replace it by a constant function that always returns the for which our formula is true:
  • Otherwise this makes sense as the that satisfies the clearly depends on the value of .

6.6.8 Derivation Rules

6.11 Universal Instantiation

For any formula and any term we have

We can eliminate the quantifier by replacing the x by one specific . As is true for all , this holds for the free variable .

6.6.9 Example Theorem and Interpretations

6.12

is a tautology.

It’s also equivalent to .

We can interpret it in different ways to illustrate paradoxes:

6.13 Russel's paradox

There exists no set that contains all sets that do not contain themselves, i.e. is not a set.

6.14 Uncountability

The set is uncountable. This can be seen when interpreted as: Every enumeration of elements of does not contain all elements of .

6.15 Uncomputable

There are uncomputable functions .

6.16 Uncomputable function

The function assigning to each the complement of what program outputs on input is uncomputable.