Logic-based Program Verification Decidability of Propositional and - - PowerPoint PPT Presentation

logic based program verification
SMART_READER_LITE
LIVE PREVIEW

Logic-based Program Verification Decidability of Propositional and - - PowerPoint PPT Presentation

Logic-based Program Verification Decidability of Propositional and First-Order Logic. First-Order Theories. Theory of Equality M ad alina Era scu Tudor Jebelean Research Institute for Symbolic Computation, Johannes Kepler University,


slide-1
SLIDE 1

Logic-based Program Verification

Decidability of Propositional and First-Order Logic. First-Order Theories. Theory of Equality M˘ ad˘ alina Era¸ scu Tudor Jebelean

Research Institute for Symbolic Computation, Johannes Kepler University, Linz, Austria {merascu,tjebelea}@risc.jku.at

November 20, 2013

slide-2
SLIDE 2

Outline

Preliminaries Decidability of PL and FOL First-Order Theories Theory of Equality (TEUF). Congruence Closure Algorithm for TQFEUF

slide-3
SLIDE 3

Outline

Preliminaries Decidability of PL and FOL First-Order Theories Theory of Equality (TEUF). Congruence Closure Algorithm for TQFEUF

slide-4
SLIDE 4

The Decision Problem of Formulas

The decision problem for a given formula φ is to determine whether φ is valid/satisfiable. A procedure for the decision problem is sound if when it returns “Valid”/“Satisfiable”, the input formula is indeed valid/satisfiable. A procedure for the decision problem is complete if

  • 1. it always terminates, and
  • 2. it returns “Valid”/“Satisfiable” when the input formula is indeed

valid/satisfiable. A procedure is called a decision procedure for the theory T (e.g. propositional logic, first-order logic, other theories to be discussed later) if it is sound and complete with respect to every formula of T. A theory is decidable iff there is a decision procedure for it.

slide-5
SLIDE 5

The Decision Problem of Formulas

The decision problem for a given formula φ is to determine whether φ is valid/satisfiable. A procedure for the decision problem is sound if when it returns “Valid”/“Satisfiable”, the input formula is indeed valid/satisfiable. A procedure for the decision problem is complete if

  • 1. it always terminates, and
  • 2. it returns “Valid”/“Satisfiable” when the input formula is indeed

valid/satisfiable. A procedure is called a decision procedure for the theory T (e.g. propositional logic, first-order logic, other theories to be discussed later) if it is sound and complete with respect to every formula of T. A theory is decidable iff there is a decision procedure for it.

slide-6
SLIDE 6

The Decision Problem of Formulas

The decision problem for a given formula φ is to determine whether φ is valid/satisfiable. A procedure for the decision problem is sound if when it returns “Valid”/“Satisfiable”, the input formula is indeed valid/satisfiable. A procedure for the decision problem is complete if

  • 1. it always terminates, and
  • 2. it returns “Valid”/“Satisfiable” when the input formula is indeed

valid/satisfiable. A procedure is called a decision procedure for the theory T (e.g. propositional logic, first-order logic, other theories to be discussed later) if it is sound and complete with respect to every formula of T. A theory is decidable iff there is a decision procedure for it.

slide-7
SLIDE 7

The Decision Problem of Formulas

The decision problem for a given formula φ is to determine whether φ is valid/satisfiable. A procedure for the decision problem is sound if when it returns “Valid”/“Satisfiable”, the input formula is indeed valid/satisfiable. A procedure for the decision problem is complete if

  • 1. it always terminates, and
  • 2. it returns “Valid”/“Satisfiable” when the input formula is indeed

valid/satisfiable. A procedure is called a decision procedure for the theory T (e.g. propositional logic, first-order logic, other theories to be discussed later) if it is sound and complete with respect to every formula of T. A theory is decidable iff there is a decision procedure for it.

slide-8
SLIDE 8

The Decision Problem of Formulas

The decision problem for a given formula φ is to determine whether φ is valid/satisfiable. A procedure for the decision problem is sound if when it returns “Valid”/“Satisfiable”, the input formula is indeed valid/satisfiable. A procedure for the decision problem is complete if

  • 1. it always terminates, and
  • 2. it returns “Valid”/“Satisfiable” when the input formula is indeed

valid/satisfiable. A procedure is called a decision procedure for the theory T (e.g. propositional logic, first-order logic, other theories to be discussed later) if it is sound and complete with respect to every formula of T. A theory is decidable iff there is a decision procedure for it.

slide-9
SLIDE 9

Outline

Preliminaries Decidability of PL and FOL First-Order Theories Theory of Equality (TEUF). Congruence Closure Algorithm for TQFEUF

slide-10
SLIDE 10

Decidability of PL and FOL

Questions

◮ Is propositional logic (PL) decidable? If so, give example of decision

procedures

◮ Yes! (truth table, resolution, DPLL) ◮ Is first-order logic (FOL) decidable? If so, give example of decision

procedures.

◮ FOL is undecidable (Church & Turing): there does not exist a

decision procedure/algorithm for deciding if a FOL formula F is valid/satisfiable.

◮ FOL is semi-decidable: there is a procedure that halts and says

“yes” if F is indeed valid/satisfiable.

slide-11
SLIDE 11

Decidability of PL and FOL

Questions

◮ Is propositional logic (PL) decidable? If so, give example of decision

procedures

◮ Yes! (truth table, resolution, DPLL) ◮ Is first-order logic (FOL) decidable? If so, give example of decision

procedures.

◮ FOL is undecidable (Church & Turing): there does not exist a

decision procedure/algorithm for deciding if a FOL formula F is valid/satisfiable.

◮ FOL is semi-decidable: there is a procedure that halts and says

“yes” if F is indeed valid/satisfiable.

slide-12
SLIDE 12

Decidability of PL and FOL

Questions

◮ Is propositional logic (PL) decidable? If so, give example of decision

procedures

◮ Yes! (truth table, resolution, DPLL) ◮ Is first-order logic (FOL) decidable? If so, give example of decision

procedures.

◮ FOL is undecidable (Church & Turing): there does not exist a

decision procedure/algorithm for deciding if a FOL formula F is valid/satisfiable.

◮ FOL is semi-decidable: there is a procedure that halts and says

“yes” if F is indeed valid/satisfiable.

slide-13
SLIDE 13

Decidability of PL and FOL

Questions

◮ Is propositional logic (PL) decidable? If so, give example of decision

procedures

◮ Yes! (truth table, resolution, DPLL) ◮ Is first-order logic (FOL) decidable? If so, give example of decision

procedures.

◮ FOL is undecidable (Church & Turing): there does not exist a

decision procedure/algorithm for deciding if a FOL formula F is valid/satisfiable.

◮ FOL is semi-decidable: there is a procedure that halts and says

“yes” if F is indeed valid/satisfiable.

slide-14
SLIDE 14

Decidability of PL and FOL

Questions

◮ Is propositional logic (PL) decidable? If so, give example of decision

procedures

◮ Yes! (truth table, resolution, DPLL) ◮ Is first-order logic (FOL) decidable? If so, give example of decision

procedures.

◮ FOL is undecidable (Church & Turing): there does not exist a

decision procedure/algorithm for deciding if a FOL formula F is valid/satisfiable.

◮ FOL is semi-decidable: there is a procedure that halts and says

“yes” if F is indeed valid/satisfiable.

slide-15
SLIDE 15

Decidability of PL and FOL

Questions

◮ Is propositional logic (PL) decidable? If so, give example of decision

procedures

◮ Yes! (truth table, resolution, DPLL) ◮ Is first-order logic (FOL) decidable? If so, give example of decision

procedures.

◮ FOL is undecidable (Church & Turing): there does not exist a

decision procedure/algorithm for deciding if a FOL formula F is valid/satisfiable.

◮ FOL is semi-decidable: there is a procedure that halts and says

“yes” if F is indeed valid/satisfiable.

slide-16
SLIDE 16

Outline

Preliminaries Decidability of PL and FOL First-Order Theories Theory of Equality (TEUF). Congruence Closure Algorithm for TQFEUF

slide-17
SLIDE 17

First-Order Theories

Motivation:

◮ Reasoning in applications domains, e.g. software, hardware,

necessitates various notions (numbers, lists, arrays, memory, etc.) which can be formalized using FOL.

◮ While FOL is undecidable, validity in particular theories or fragments

  • f theories interesting for verification is sometimes decidable and

even efficiently decidable.

slide-18
SLIDE 18

First-Order Theories

Motivation:

◮ Reasoning in applications domains, e.g. software, hardware,

necessitates various notions (numbers, lists, arrays, memory, etc.) which can be formalized using FOL.

◮ While FOL is undecidable, validity in particular theories or fragments

  • f theories interesting for verification is sometimes decidable and

even efficiently decidable.

slide-19
SLIDE 19

First-Order Theories

Motivation:

◮ Reasoning in applications domains, e.g. software, hardware,

necessitates various notions (numbers, lists, arrays, memory, etc.) which can be formalized using FOL.

◮ While FOL is undecidable, validity in particular theories or fragments

  • f theories interesting for verification is sometimes decidable and

even efficiently decidable.

slide-20
SLIDE 20

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-21
SLIDE 21

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-22
SLIDE 22

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-23
SLIDE 23

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-24
SLIDE 24

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-25
SLIDE 25

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-26
SLIDE 26

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-27
SLIDE 27

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-28
SLIDE 28

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-29
SLIDE 29

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-30
SLIDE 30

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-31
SLIDE 31

First-Order Theories

A first-order theory T is defined by:

  • 1. signature Σ: set of constant, function, predicate symbols
  • 2. a set of axioms A: closed set of FOL formulas in which only

constant, function, and predicate symbols of Σ appear. A formula F is closed if it does not contain any free variables. A Σ-formula F is valid in T (T-valid), if every interpretation I that satisfies the axioms of T, I | = A for every A ∈ A, (1) also satisfies F : I | = F. We also write T | = F (F is T-valid). The theory T consists of all (closed) formulas that are T-valid. An interpretation satisfying (1) is a T-interpretation. A Σ-formula F is satisfiable in T (T-satisfiable), if there is a T-interpretation I that satisfies F. A theory T is complete if for every closed Σ-formula F, T | = F or T | = ¬F. A theory is consistent if there is at least one T-interpretation. A fragment of a theory is a syntactically-restricted subset of formulas of the theory.

slide-32
SLIDE 32

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-33
SLIDE 33

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-34
SLIDE 34

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-35
SLIDE 35

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-36
SLIDE 36

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-37
SLIDE 37

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-38
SLIDE 38

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-39
SLIDE 39

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-40
SLIDE 40

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-41
SLIDE 41

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-42
SLIDE 42

TEUF

This theory is sometimes referred to as the theory of equality with uninterpreted functions (EUF). Signature: ΣE = {=, a, b, c, ..., f , g, h, ..., P, Q, R, ...} a, b, c,... – constants, f , g, h,... – function symbols, P,Q,R,... – predicate symbols The predicate = is interpreted via the following axioms:

  • 1. ∀

x x = x

(reflexivity)

  • 2. ∀

x,y x = y

= ⇒ y = x (symmetry) 3. ∀

x,y,z x = y ∧ y = z

= ⇒ x = z (transitivity)

  • 4. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ f (¯ x) = f (¯ y) (function congruence), where n is a positive integer and f is an n-ary function symbol

  • 5. ∀

¯ x,¯ y

n

  • i=1

xi = yi

  • =

⇒ P(¯ x) = P(¯ y) (function congruence), where n is a positive integer and P is an n-ary predicate symbol We have

  • 1. = is an equivalence relation
  • 2. = is a congruence relation
slide-43
SLIDE 43

TEUF (cont’d)

Is TE decidable? Is quantifier-free TE decidable? Without quantifiers, free variables and constants play the same role. Example: Prove that F is TE valid where F : ⇐ ⇒ a = b ∧ b = c = ⇒ g[f [a], b] = g[f [c], a] Goal: decision procedure for satisfiability of quantifier - free theory of equality (QFEUF)

slide-44
SLIDE 44

TEUF (cont’d)

Is TE decidable? Is quantifier-free TE decidable? Without quantifiers, free variables and constants play the same role. Example: Prove that F is TE valid where F : ⇐ ⇒ a = b ∧ b = c = ⇒ g[f [a], b] = g[f [c], a] Goal: decision procedure for satisfiability of quantifier - free theory of equality (QFEUF)

slide-45
SLIDE 45

TEUF (cont’d)

Is TE decidable? Is quantifier-free TE decidable? Without quantifiers, free variables and constants play the same role. Example: Prove that F is TE valid where F : ⇐ ⇒ a = b ∧ b = c = ⇒ g[f [a], b] = g[f [c], a] Goal: decision procedure for satisfiability of quantifier - free theory of equality (QFEUF)

slide-46
SLIDE 46

TEUF (cont’d)

Is TE decidable? Is quantifier-free TE decidable? Without quantifiers, free variables and constants play the same role. Example: Prove that F is TE valid where F : ⇐ ⇒ a = b ∧ b = c = ⇒ g[f [a], b] = g[f [c], a] Goal: decision procedure for satisfiability of quantifier - free theory of equality (QFEUF)

slide-47
SLIDE 47

TEUF (cont’d)

Is TE decidable? Is quantifier-free TE decidable? Without quantifiers, free variables and constants play the same role. Example: Prove that F is TE valid where F : ⇐ ⇒ a = b ∧ b = c = ⇒ g[f [a], b] = g[f [c], a] Goal: decision procedure for satisfiability of quantifier - free theory of equality (QFEUF)

slide-48
SLIDE 48

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-49
SLIDE 49

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-50
SLIDE 50

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-51
SLIDE 51

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-52
SLIDE 52

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-53
SLIDE 53

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-54
SLIDE 54

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-55
SLIDE 55

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-56
SLIDE 56

Relations

Let S be a set and R a binary relation over S. For two elements s1, s2 ∈ S, either s1Rs2 or ¬(s1Rs2). The relation R is an equivalence relation if it is

  • 1. reflexive:

s∈S sRs

  • 2. symmetric:

s1,s2∈S s1Rs2 =

⇒ s2Rs1

  • 3. transitive:

s1,s2,s3∈S s1Rs2 ∧ s2Rs3 =

⇒ s1Rs3 The relation R is a congruence relation if

  • 1. 1 – 3 hold
  • 2. for any n-ary function f ,

¯ s,¯ t

n

  • i=1

siRti

  • =

⇒ f (¯ s)Rf (¯ t)

slide-57
SLIDE 57

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-58
SLIDE 58

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-59
SLIDE 59

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-60
SLIDE 60

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-61
SLIDE 61

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-62
SLIDE 62

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-63
SLIDE 63

Relations (cont’d)

Let R be a equivalence relation over the set S. The equivalence class of s ∈ S under R is the set [s]R

def

= {s′ ∈ S : sRs′} If R is a congruence relation over S, then [s]R is the congruence class of s. A partition P of S is a set of subsets of S that is

  • 1. total:

S′∈P

S′

  • = S
  • 2. disjoint:

S1,S2∈P S1 = S2 =

⇒ S1 ∩ S2 = ∅ The quotient S/R of S by the equivalence (congruence) relation R is a partition of S: it is a set of equivalence (congruence) classes S/R = {[s]R : s ∈ S}.

slide-64
SLIDE 64

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-65
SLIDE 65

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-66
SLIDE 66

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-67
SLIDE 67

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-68
SLIDE 68

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-69
SLIDE 69

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-70
SLIDE 70

Relations (cont’d)

Let R1 and R2 be two binary relations over set S. R1 is a refinement of R2, or R1 ≺ R2, if ∀

s1,s2∈S s1R1s2 =

⇒ s1R2s2. In other words, R1 refines R2. Viewing the relations as sets of pairs, R1 ≺ R2 iff R1 ⊆ R2. Examples

◮ Let S = a, b, R1 : aR1b, R2 : aR2b, bR2b. Then R1 ≺ R2. ◮ Let S be a set.

Relation R1 : sR1s : s ∈ S induced by the partition P1 : s : s ∈ S; Relation R2 : sR2t : s, t ∈ S induced by the partition P2 : S. Then R1 ≺ R2.

slide-71
SLIDE 71

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-72
SLIDE 72

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-73
SLIDE 73

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-74
SLIDE 74

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-75
SLIDE 75

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-76
SLIDE 76

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-77
SLIDE 77

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-78
SLIDE 78

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-79
SLIDE 79

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-80
SLIDE 80

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-81
SLIDE 81

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-82
SLIDE 82

Relations (cont’d)

The equivalence closure RE of the binary relation R over S is the equivalence relation such that

◮ R refines RE: R ≺ RE; ◮ for all other equivalence relations R′ such that R ≺ R′, either

R′ = RE or RE ≺ R′ In other words, RE is the “smallest” equivalence relation that “covers” R. The congruence closure RC of R is the “smallest” congruence relation that “covers” R. Examples If S = {a, b, c, d} and R = {aRb, bRc, dRd}, then

◮ aRb, bRc, dRd ∈ RE since R ⊆ RE ◮ aRa, bRb, cRc ∈ RE by reflexivity ◮ bRa, cRb ∈ RE by symmetry; ◮ aRc ∈ RE by transitivity; ◮ cRa ∈ RE by symmetry

Hence, RE = {aRb, bRa, aRa, bRb, bRc, cRb, cRc, aRc, cRa, dRd}.

slide-83
SLIDE 83

Relations (cont’d)

The subterm set SF of Σ-formula F is the set that contains precisely the subterms of F. Example: Let F : ⇐ ⇒ f [a, b] = a ∧ f [f [a, b], b] = a. Then SF = {a, b, f [a, b], f [f [a, b], b]}.

slide-84
SLIDE 84

Relations (cont’d)

The subterm set SF of Σ-formula F is the set that contains precisely the subterms of F. Example: Let F : ⇐ ⇒ f [a, b] = a ∧ f [f [a, b], b] = a. Then SF = {a, b, f [a, b], f [f [a, b], b]}.

slide-85
SLIDE 85

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-86
SLIDE 86

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-87
SLIDE 87

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-88
SLIDE 88

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-89
SLIDE 89

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-90
SLIDE 90

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-91
SLIDE 91

Congruence Closure Algorithm for TQFEUF

Given ΣE - formula F F : ⇐ ⇒ s1 = t1 ∧ ... ∧ sm = tm ∧ sm+1 = tm+1 ∧ ... ∧ sn = tn with subterm set SF. F is TE - satisfiable iff there exists a congruence relation over SF such that

◮ for each i ∈ {1, ..., m}, si ∼ ti; ◮ for each i ∈ {m + 1, ..., n}, si ∼ ti.

Congruence Closure Algorithm (Naive Version)

  • 1. Construct the congruence closure ∼ of

{s1 = t1, ..., sm = tm}

  • ver the subterm set SF. Then

∼| = s1 = t1 ∧ ... ∧ sm = tm

  • 2. If si ∼ ti for any i ∈ {m + 1, ..., n}, return unsatisfiable.
  • 3. Otherwise, ∼|

= F, so return satisfiable.

slide-92
SLIDE 92

Congruence Closure Algorithm for TQFEUF (cont’d)

Examples: Determine if the following formulas are satisfiable or not

  • 1. F1 : ⇐

⇒ f [a, b] = a ∧ f [f [a, b], b] = a

  • 2. F2 : ⇐

⇒ f [x] = f [y] ∧ x = y