First-Order Theorem Proving and Vampire Laura Kov acs (Chalmers - - PowerPoint PPT Presentation

first order theorem proving and vampire
SMART_READER_LITE
LIVE PREVIEW

First-Order Theorem Proving and Vampire Laura Kov acs (Chalmers - - PowerPoint PPT Presentation

First-Order Theorem Proving and Vampire Laura Kov acs (Chalmers University of Technology) Andrei Voronkov (The University of Manchester) Outline Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy


slide-1
SLIDE 1

First-Order Theorem Proving and Vampire

Laura Kov´ acs (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

slide-2
SLIDE 2

Outline

Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination Equality

slide-3
SLIDE 3

First-Order Logic: Exercises

Which of the following statements are true?

slide-4
SLIDE 4

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
slide-5
SLIDE 5

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
slide-6
SLIDE 6

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
slide-7
SLIDE 7

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
  • 4. First-order logic is decidable.
slide-8
SLIDE 8

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
  • 4. First-order logic is decidable.
  • 5. In first-order logic you can use quantifiers over sets.
slide-9
SLIDE 9

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
  • 4. First-order logic is decidable.
  • 5. In first-order logic you can use quantifiers over sets.
  • 6. One can axiomatise integers in first-order logic;
slide-10
SLIDE 10

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
  • 4. First-order logic is decidable.
  • 5. In first-order logic you can use quantifiers over sets.
  • 6. One can axiomatise integers in first-order logic;
  • 7. Compactness is the following property: a set of formulas having

arbitrarily large finite models has an infinite model;

slide-11
SLIDE 11

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
  • 4. First-order logic is decidable.
  • 5. In first-order logic you can use quantifiers over sets.
  • 6. One can axiomatise integers in first-order logic;
  • 7. Compactness is the following property: a set of formulas having

arbitrarily large finite models has an infinite model;

  • 8. Having proofs is good.
slide-12
SLIDE 12

First-Order Logic: Exercises

Which of the following statements are true?

  • 1. First-order logic is an extension of propositional logic;
  • 2. First-order logic is NP-complete.
  • 3. First-order logic is PSPACE-complete.
  • 4. First-order logic is decidable.
  • 5. In first-order logic you can use quantifiers over sets.
  • 6. One can axiomatise integers in first-order logic;
  • 7. Compactness is the following property: a set of formulas having

arbitrarily large finite models has an infinite model;

  • 8. Having proofs is good.
  • 9. Vampire is a first-order theorem prover.
slide-13
SLIDE 13

Future and Our Motivation

  • 1. Theorem proving will remain central in software verification and

program analysis. The role of theorem proving in these areas will be growing.

  • 2. Theorem provers will be used by a large number of users who do

not understand theorem proving and by users with very elementary knowledge of logic.

  • 3. Reasoning with both quantifiers and theories will remain the

main challenge in practical applications of theorem proving (at least) for the next decade.

  • 4. Theorem provers will be used in reasoning with very large
  • theories. These theories will appear in knowledge mining and

natural language processing.

slide-14
SLIDE 14

Future and Our Motivation

  • 1. Theorem proving will remain central in software verification and

program analysis. The role of theorem proving in these areas will be growing.

  • 2. Theorem provers will be used by a large number of users who do

not understand theorem proving and by users with very elementary knowledge of logic.

  • 3. Reasoning with both quantifiers and theories will remain the

main challenge in practical applications of theorem proving (at least) for the next decade.

  • 4. Theorem provers will be used in reasoning with very large
  • theories. These theories will appear in knowledge mining and

natural language processing.

slide-15
SLIDE 15

Future and Our Motivation

  • 1. Theorem proving will remain central in software verification and

program analysis. The role of theorem proving in these areas will be growing.

  • 2. Theorem provers will be used by a large number of users who do

not understand theorem proving and by users with very elementary knowledge of logic.

  • 3. Reasoning with both quantifiers and theories will remain the

main challenge in practical applications of theorem proving (at least) for the next decade.

  • 4. Theorem provers will be used in reasoning with very large
  • theories. These theories will appear in knowledge mining and

natural language processing.

slide-16
SLIDE 16

Future and Our Motivation

  • 1. Theorem proving will remain central in software verification and

program analysis. The role of theorem proving in these areas will be growing.

  • 2. Theorem provers will be used by a large number of users who do

not understand theorem proving and by users with very elementary knowledge of logic.

  • 3. Reasoning with both quantifiers and theories will remain the

main challenge in practical applications of theorem proving (at least) for the next decade.

  • 4. Theorem provers will be used in reasoning with very large
  • theories. These theories will appear in knowledge mining and

natural language processing.

slide-17
SLIDE 17

First-Order Theorem Proving. Example

Group theory theorem: if a group satisfies the identity x2 = 1, then it is commutative.

slide-18
SLIDE 18

First-Order Theorem Proving. Example

Group theory theorem: if a group satisfies the identity x2 = 1, then it is commutative. More formally: in a group “assuming that x2 = 1 for all x prove that x · y = y · x holds for all x, y.”

slide-19
SLIDE 19

First-Order Theorem Proving. Example

Group theory theorem: if a group satisfies the identity x2 = 1, then it is commutative. More formally: in a group “assuming that x2 = 1 for all x prove that x · y = y · x holds for all x, y.” What is implicit: axioms of the group theory. ∀x(1 · x = x) ∀x(x−1 · x = 1) ∀x∀y∀z((x · y) · z = x · (y · z))

slide-20
SLIDE 20

Formulation in First-Order Logic

∀x(1 · x = x) Axioms (of group theory): ∀x(x−1 · x = 1) ∀x∀y∀z((x · y) · z = x · (y · z)) Assumptions: ∀x(x · x = 1) Conjecture: ∀x∀y(x · y = y · x)

slide-21
SLIDE 21

In the TPTP Syntax

The TPTP library (Thousands of Problems for Theorem Provers), http://www.tptp.org contains a large collection of first-order problems. For representing these problems it uses the TPTP syntax, which is understood by all modern theorem provers, including Vampire.

slide-22
SLIDE 22

In the TPTP Syntax

The TPTP library (Thousands of Problems for Theorem Provers), http://www.tptp.org contains a large collection of first-order problems. For representing these problems it uses the TPTP syntax, which is understood by all modern theorem provers, including Vampire. In the TPTP syntax this group theory problem can be written down as follows: %---- 1 * x = 1 fof(left identity,axiom, ! [X] : mult(e,X) = X). %---- i(x) * x = 1 fof(left inverse,axiom, ! [X] : mult(inverse(X),X) = e). %---- (x * y) * z = x * (y * z) fof(associativity,axiom, ! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z))). %---- x * x = 1 fof(group of order 2,hypothesis, ! [X] : mult(X,X) = e). %---- prove x * y = y * x fof(commutativity,conjecture, ! [X] : mult(X,Y) = mult(Y,X)).

slide-23
SLIDE 23

Running Vampire of a TPTP file

is easy: simply use vampire <filename>

slide-24
SLIDE 24

Running Vampire of a TPTP file

is easy: simply use vampire <filename> One can also run Vampire with various options, some of them will be explained later. For example, save the group theory problem in a file group.tptp and try vampire --thanks ReRiSE group.tptp

slide-25
SLIDE 25

Outline

Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination Equality

slide-26
SLIDE 26

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol.

slide-27
SLIDE 27

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol. Variable names start with upper-case letters.

slide-28
SLIDE 28

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol. Variable names start with upper-case letters.

◮ Terms: variables, constants, and expressions f(t1, . . . , tn), where f is a

function symbol of arity n and t1, . . . , tn are terms.

slide-29
SLIDE 29

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol. Variable names start with upper-case letters.

◮ Terms: variables, constants, and expressions f(t1, . . . , tn), where f is a

function symbol of arity n and t1, . . . , tn are terms. Terms denote domain (universe) elements (objects).

slide-30
SLIDE 30

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol. Variable names start with upper-case letters.

◮ Terms: variables, constants, and expressions f(t1, . . . , tn), where f is a

function symbol of arity n and t1, . . . , tn are terms. Terms denote domain (universe) elements (objects).

◮ Atomic formula: expression p(t1, . . . , tn), where p is a predicate symbol

  • f arity n and t1, . . . , tn are terms.
slide-31
SLIDE 31

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol. Variable names start with upper-case letters.

◮ Terms: variables, constants, and expressions f(t1, . . . , tn), where f is a

function symbol of arity n and t1, . . . , tn are terms. Terms denote domain (universe) elements (objects).

◮ Atomic formula: expression p(t1, . . . , tn), where p is a predicate symbol

  • f arity n and t1, . . . , tn are terms. Formulas denote properties of domain

elements.

◮ All symbols are uninterpreted, apart from equality =.

slide-32
SLIDE 32

First-Order Logic and TPTP

◮ Language: variables, function and predicate (relation) symbols. A

constant symbol is a special case of a function symbol. Variable names start with upper-case letters.

◮ Terms: variables, constants, and expressions f(t1, . . . , tn), where f is a

function symbol of arity n and t1, . . . , tn are terms. Terms denote domain (universe) elements (objects).

◮ Atomic formula: expression p(t1, . . . , tn), where p is a predicate symbol

  • f arity n and t1, . . . , tn are terms. Formulas denote properties of domain

elements.

◮ All symbols are uninterpreted, apart from equality =.

FOL TPTP ⊥, ⊤ $false, $true ¬F ˜F F1 ∧ . . . ∧ Fn F1 & ... & Fn F1 ∨ . . . ∨ Fn F1 | ... | Fn F1 → Fn F1 => Fn (∀x1) . . . (∀xn)F ! [X1,...,Xn] : F (∃x1) . . . (∃xn)F ? [X1,...,Xn] : F

slide-33
SLIDE 33

More on the TPTP Syntax

%---- 1 * x = x fof(left identity,axiom,( ! [X] : mult(e,X) = X )). %---- i(x) * x = 1 fof(left inverse,axiom,( ! [X] : mult(inverse(X),X) = e )). %---- (x * y) * z = x * (y * z) fof(associativity,axiom,( ! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z)) )). %---- x * x = 1 fof(group of order 2,hypothesis, ! [X] : mult(X,X) = e ). %---- prove x * y = y * x fof(commutativity,conjecture, ! [X,Y] : mult(X,Y) = mult(Y,X) ).

slide-34
SLIDE 34

More on the TPTP Syntax

◮ Comments;

%---- 1 * x = x fof(left identity,axiom,( ! [X] : mult(e,X) = X )). %---- i(x) * x = 1 fof(left inverse,axiom,( ! [X] : mult(inverse(X),X) = e )). %---- (x * y) * z = x * (y * z) fof(associativity,axiom,( ! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z)) )). %---- x * x = 1 fof(group of order 2,hypothesis, ! [X] : mult(X,X) = e ). %---- prove x * y = y * x fof(commutativity,conjecture, ! [X,Y] : mult(X,Y) = mult(Y,X) ).

slide-35
SLIDE 35

More on the TPTP Syntax

◮ Comments; ◮ Input formula names;

%---- 1 * x = x fof(left identity,axiom,( ! [X] : mult(e,X) = X )). %---- i(x) * x = 1 fof(left inverse,axiom,( ! [X] : mult(inverse(X),X) = e )). %---- (x * y) * z = x * (y * z) fof(associativity,axiom,( ! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z)) )). %---- x * x = 1 fof(group of order 2,hypothesis, ! [X] : mult(X,X) = e ). %---- prove x * y = y * x fof(commutativity,conjecture, ! [X,Y] : mult(X,Y) = mult(Y,X) ).

slide-36
SLIDE 36

More on the TPTP Syntax

◮ Comments; ◮ Input formula names; ◮ Input formula roles (very important);

%---- 1 * x = x fof(left identity,axiom,( ! [X] : mult(e,X) = X )). %---- i(x) * x = 1 fof(left inverse,axiom,( ! [X] : mult(inverse(X),X) = e )). %---- (x * y) * z = x * (y * z) fof(associativity,axiom,( ! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z)) )). %---- x * x = 1 fof(group of order 2,hypothesis, ! [X] : mult(X,X) = e ). %---- prove x * y = y * x fof(commutativity,conjecture, ! [X,Y] : mult(X,Y) = mult(Y,X) ).

slide-37
SLIDE 37

More on the TPTP Syntax

◮ Comments; ◮ Input formula names; ◮ Input formula roles (very important); ◮ Equality

%---- 1 * x = x fof(left identity,axiom,( ! [X] : mult(e,X) = X )). %---- i(x) * x = 1 fof(left inverse,axiom,( ! [X] : mult(inverse(X),X) = e )). %---- (x * y) * z = x * (y * z) fof(associativity,axiom,( ! [X,Y,Z] : mult(mult(X,Y),Z) = mult(X,mult(Y,Z)) )). %---- x * x = 1 fof(group of order 2,hypothesis, ! [X] : mult(X,X) = e ). %---- prove x * y = y * x fof(commutativity,conjecture, ! [X,Y] : mult(X,Y) = mult(Y,X) ).

slide-38
SLIDE 38

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]
slide-39
SLIDE 39

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas;

slide-40
SLIDE 40

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus

slide-41
SLIDE 41

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus

slide-42
SLIDE 42

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus

slide-43
SLIDE 43

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus

slide-44
SLIDE 44

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus ◮ Proof by refutation, generating and simplifying inferences, unused formulas . . .

slide-45
SLIDE 45

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus ◮ Proof by refutation, generating and simplifying inferences, unused formulas . . .

slide-46
SLIDE 46

Proof by Vampire (Slightliy Modified)

Refutation found. Thanks to Tanya!

  • 203. $false [subsumption resolution 202,14]
  • 202. sP1(mult(sK,sK0)) [backward demodulation 188,15]
  • 188. mult(X8,X9) = mult(X9,X8) [superposition 22,87]
  • 87. mult(X2,mult(X1,X2)) = X1 [forward demodulation 71,27]
  • 71. mult(inverse(X1),e) = mult(X2,mult(X1,X2)) [superposition 23,20]
  • 27. mult(inverse(X2),e) = X2 [superposition 22,10]
  • 23. mult(inverse(X4),mult(X4,X5)) = X5 [forward demodulation 18,9]
  • 22. mult(X0,mult(X0,X1)) = X1 [forward demodulation 16,9]
  • 20. e = mult(X0,mult(X1,mult(X0,X1))) [superposition 11,12]
  • 18. mult(e,X5) = mult(inverse(X4),mult(X4,X5)) [superposition 11,10]
  • 16. mult(e,X1) = mult(X0,mult(X0,X1)) [superposition 11,12]
  • 15. sP1(mult(sK0,sK)) [inequality splitting 13,14]
  • 14. ˜sP1(mult(sK,sK0)) [inequality splitting name introduction]
  • 13. mult(sK,sK0) != mult(sK0,sK) [cnf transformation 8]
  • 12. e = mult(X0,X0) (0:5) [cnf transformation 4]
  • 11. mult(mult(X0,X1),X2)=mult(X0,mult(X1,X2))[cnf transformation 3]
  • 10. e = mult(inverse(X0),X0) [cnf transformation 2]
  • 9. mult(e,X0) = X0 [cnf transformation 1]
  • 8. mult(sK,sK0) != mult(sK0,sK) [skolemisation 7]
  • 7. ? [X0,X1] : mult(X0,X1) != mult(X1,X0) [ennf transformation 6]
  • 6. ˜! [X0,X1] : mult(X0,X1) = mult(X1,X0) [negated conjecture 5]
  • 5. ! [X0,X1] : mult(X0,X1) = mult(X1,X0) [input]
  • 4. ! [X0] : e = mult(X0,X0)[input]
  • 3. ! [X0,X1,X2] : mult(mult(X0,X1),X2) = mult(X0,mult(X1,X2)) [input]
  • 2. ! [X0] : e = mult(inverse(X0),X0) [input]
  • 1. ! [X0] : mult(e,X0) = X0 [input]

◮ Each inference derives a formula from zero or more other formulas; ◮ Input, preprocessing, new symbols introduction, superposition calculus ◮ Proof by refutation, generating and simplifying inferences, unused formulas . . .

slide-47
SLIDE 47

Statistics

Version: Vampire 3 (revision 2038) Termination reason: Refutation Active clauses: 14 Passive clauses: 28 Generated clauses: 124 Final active clauses: 8 Final passive clauses: 6 Input formulas: 5 Initial clauses: 6 Splitted inequalities: 1 Fw subsumption resolutions: 1 Fw demodulations: 32 Bw demodulations: 12 Forward subsumptions: 53 Backward subsumptions: 1 Fw demodulations to eq. taut.: 6 Bw demodulations to eq. taut.: 1 Forward superposition: 41 Backward superposition: 28 Self superposition: 4 Memory used [KB]: 255 Time elapsed: 0.005 s

slide-48
SLIDE 48

Vampire

◮ Completely automatic: once you started a proof attempt, it can

  • nly be interrupted by terminating the process.
slide-49
SLIDE 49

Vampire

◮ Completely automatic: once you started a proof attempt, it can

  • nly be interrupted by terminating the process.

◮ Champion of the CASC world-cup in first-order theorem proving:

won CASC 28 times.

slide-50
SLIDE 50

Main applications

◮ Software and hardware verification; ◮ Static analysis of programs; ◮ Query answering in first-order knowledge bases (ontologies); ◮ Theorem proving in mathematics, especially in algebra;

slide-51
SLIDE 51

Main applications

◮ Software and hardware verification; ◮ Static analysis of programs; ◮ Query answering in first-order knowledge bases (ontologies); ◮ Theorem proving in mathematics, especially in algebra; ◮ Verification of cryptographic protocols; ◮ Retrieval of software components; ◮ Reasoning in non-classical logics; ◮ Program synthesis;

slide-52
SLIDE 52

Main applications

◮ Software and hardware verification; ◮ Static analysis of programs; ◮ Query answering in first-order knowledge bases (ontologies); ◮ Theorem proving in mathematics, especially in algebra; ◮ Verification of cryptographic protocols; ◮ Retrieval of software components; ◮ Reasoning in non-classical logics; ◮ Program synthesis; ◮ Writing papers and giving talks at various conferences and

schools . . .

slide-53
SLIDE 53

What an Automatic Theorem Prover is Expected to Do

Input:

◮ a set of axioms (first order formulas) or clauses; ◮ a conjecture (first-order formula or set of clauses).

Output:

◮ proof (hopefully).

slide-54
SLIDE 54

Proof by Refutation

Given a problem with axioms and assumptions F1, . . . , Fn and conjecture G,

  • 1. negate the conjecture;
  • 2. establish unsatisfiability of the set of formulas F1, . . . , Fn, ¬G.
slide-55
SLIDE 55

Proof by Refutation

Given a problem with axioms and assumptions F1, . . . , Fn and conjecture G,

  • 1. negate the conjecture;
  • 2. establish unsatisfiability of the set of formulas F1, . . . , Fn, ¬G.

Thus, we reduce the theorem proving problem to the problem of checking unsatisfiability.

slide-56
SLIDE 56

Proof by Refutation

Given a problem with axioms and assumptions F1, . . . , Fn and conjecture G,

  • 1. negate the conjecture;
  • 2. establish unsatisfiability of the set of formulas F1, . . . , Fn, ¬G.

Thus, we reduce the theorem proving problem to the problem of checking unsatisfiability. In this formulation the negation of the conjecture ¬G is treated like any other formula. In fact, Vampire (and other provers) internally treat conjectures differently, to make proof search more goal-oriented.

slide-57
SLIDE 57

General Scheme (simplified)

◮ Read a problem; ◮ Determine proof-search options to be used for this problem; ◮ Preprocess the problem; ◮ Convert it into CNF; ◮ Run a saturation algorithm on it, try to derive ⊥. ◮ If ⊥ is derived, report the result, maybe including a refutation.

slide-58
SLIDE 58

General Scheme (simplified)

◮ Read a problem; ◮ Determine proof-search options to be used for this problem; ◮ Preprocess the problem; ◮ Convert it into CNF; ◮ Run a saturation algorithm on it, try to derive ⊥. ◮ If ⊥ is derived, report the result, maybe including a refutation.

Trying to derive ⊥ using a saturation algorithm is the hardest part, which in practice may not terminate or run out of memory.

slide-59
SLIDE 59

Outline

Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination Equality

slide-60
SLIDE 60

Inference System

◮ inference has the form

F1 . . . Fn G , where n ≥ 0 and F1, . . . , Fn, G are formulas.

◮ The formula G is called the conclusion of the inference; ◮ The formulas F1, . . . , Fn are called its premises. ◮ An inference rule R is a set of inferences. ◮ Every inference I ∈ R is called an instance of R. ◮ An Inference system I is a set of inference rules. ◮ Axiom: inference rule with no premises.

slide-61
SLIDE 61

Inference System: Example

Represent the natural number n by the string | . . . |

  • n times

ε. The following inference system contains 6 inference rules for deriving equalities between expressions containing natural numbers, addition + and multiplication ·. ε = ε (ε) x = y |x = |y (|) ε + x = x (+1) x + y = z |x + y = |z (+2) ε · x = ε (·1) x · y = u y + u = z |x · y = z (·2)

slide-62
SLIDE 62

Derivation, Proof

◮ Derivation in an inference system I: a tree built from inferences

in I.

◮ If the root of this derivation is E, then we say it is a derivation of

E.

◮ Proof of E: a finite derivation whose leaves are axioms. ◮ Derivation of E from E1, . . . , Em: a finite derivation of E whose

every leaf is either an axiom or one of the expressions E1, . . . , Em.

slide-63
SLIDE 63

Examples

For example, ||ε + |ε = |||ε |||ε + |ε = ||||ε (+2) is an inference that is an instance (special case) of the inference rule x + y = z |x + y = |z (+2)

slide-64
SLIDE 64

Examples

For example, ||ε + |ε = |||ε |||ε + |ε = ||||ε (+2) is an inference that is an instance (special case) of the inference rule x + y = z |x + y = |z (+2) It has one premise ||ε + |ε = |||ε and the conclusion |||ε + |ε = ||||ε.

slide-65
SLIDE 65

Examples

For example, ||ε + |ε = |||ε |||ε + |ε = ||||ε (+2) is an inference that is an instance (special case) of the inference rule x + y = z |x + y = |z (+2) It has one premise ||ε + |ε = |||ε and the conclusion |||ε + |ε = ||||ε. The axiom ε + |||ε = |||ε (+1) is an instance of the rule ε + x = x (+1)

slide-66
SLIDE 66

Proof in this Inference System

Proof of ||ε · ||ε = ||||ε (that is, 2 · 2 = 4). ε · ||ε = ε (·1) ε + ε = ε (+1) |ε + ε = |ε (+2) ||ε + ε = ||ε (+2) |ε · ||ε = ||ε (·2) ε + ||ε = ||ε (+1) |ε + ||ε = |||ε (+2) ||ε + ||ε = ||||ε (+2) ||ε · ||ε = ||||ε (·2).

slide-67
SLIDE 67

Derivation in this Inference System

Derivation of ||ε · ||ε = |||||ε from ε + ||ε = |||ε (that is, 2 + 2 = 5 from 0 + 2 = 3). ε · ||ε = ε (·1) ε + ε = ε (+1) |ε + ε = |ε (+2) ||ε + ε = ||ε (+2) |ε · ||ε = ||ε (·2) ε + ||ε = |||ε |ε + ||ε = ||||ε (+2) ||ε + ||ε = |||||ε (+2) ||ε · ||ε = ||||ε (·2).

slide-68
SLIDE 68

Arbitrary First-Order Formulas

◮ A first-order signature (vocabulary): function symbols (including

constants), predicate symbols. Equality is part of the language.

◮ A set of variables. ◮ Terms are built using variables and function symbols. For

example, f(x) + g(x).

◮ Atoms, or atomic formulas are obtained by applying a predicate

symbol to a sequence of terms. For example, p(a, x) or f(x) + g(x) ≥ 2.

◮ Formulas: built from atoms using logical connectives ¬, ∧, ∨, →,

↔ and quantifiers ∀, ∃. For example, (∀x)x = 0 ∨ (∃y)y > x.

slide-69
SLIDE 69

Clauses

◮ Literal: either an atom A or its negation ¬A. ◮ Clause: a disjunction L1 ∨ . . . ∨ Ln of literals, where n ≥ 0.

slide-70
SLIDE 70

Clauses

◮ Literal: either an atom A or its negation ¬A. ◮ Clause: a disjunction L1 ∨ . . . ∨ Ln of literals, where n ≥ 0. ◮ Empty clause, denoted by : clause with 0 literals, that is, when

n = 0.

slide-71
SLIDE 71

Clauses

◮ Literal: either an atom A or its negation ¬A. ◮ Clause: a disjunction L1 ∨ . . . ∨ Ln of literals, where n ≥ 0. ◮ Empty clause, denoted by : clause with 0 literals, that is, when

n = 0.

◮ A formula in Clausal Normal Form (CNF): a conjunction of

clauses.

slide-72
SLIDE 72

Clauses

◮ Literal: either an atom A or its negation ¬A. ◮ Clause: a disjunction L1 ∨ . . . ∨ Ln of literals, where n ≥ 0. ◮ Empty clause, denoted by : clause with 0 literals, that is, when

n = 0.

◮ A formula in Clausal Normal Form (CNF): a conjunction of

clauses.

◮ A clause is ground if it contains no variables. ◮ If a clause contains variables, we assume that it implicitly

universally quantified. That is, we treat p(x) ∨ q(x) as ∀x(p(x) ∨ q(x)).

slide-73
SLIDE 73

Binary Resolution Inference System

The binary resolution inference system, denoted by BR is an inference system on propositional clauses (or ground clauses). It consists of two inference rules:

◮ Binary resolution, denoted by BR:

p ∨ C1 ¬p ∨ C2 C1 ∨ C2 (BR).

◮ Factoring, denoted by Fact:

L ∨ L ∨ C L ∨ C (Fact).

slide-74
SLIDE 74

Soundness

◮ An inference is sound if the conclusion of this inference is a

logical consequence of its premises.

◮ An inference system is sound if every inference rule in this

system is sound.

slide-75
SLIDE 75

Soundness

◮ An inference is sound if the conclusion of this inference is a

logical consequence of its premises.

◮ An inference system is sound if every inference rule in this

system is sound. BR is sound. Consequence of soundness: let S be a set of clauses. If can be derived from S in BR, then S is unsatisfiable.

slide-76
SLIDE 76

Example

Consider the following set of clauses {¬p ∨ ¬q, ¬p ∨ q, p ∨ ¬q, p ∨ q}. The following derivation derives the empty clause from this set: p ∨ q p ∨ ¬q p ∨ p (BR) p (Fact) ¬p ∨ q ¬p ∨ ¬q ¬p ∨ ¬p (BR) ¬p (Fact)

  • (BR)

Hence, this set of clauses is unsatisfiable.

slide-77
SLIDE 77

Can this be used for checking (un)satisfiability

  • 1. What happens when the empty clause cannot be derived from

S?

  • 2. How can one search for possible derivations of the empty

clause?

slide-78
SLIDE 78

Can this be used for checking (un)satisfiability

  • 1. Completeness.

Let S be an unsatisfiable set of clauses. Then there exists a derivation of from S in BR.

slide-79
SLIDE 79

Can this be used for checking (un)satisfiability

  • 1. Completeness.

Let S be an unsatisfiable set of clauses. Then there exists a derivation of from S in BR.

  • 2. We have to formalize search for derivations.

However, before doing this we will introduce a slightly more refined inference system.

slide-80
SLIDE 80

Selection Function

A literal selection function selects literals in a clause.

◮ If C is non-empty, then at least one literal is selected in C.

slide-81
SLIDE 81

Selection Function

A literal selection function selects literals in a clause.

◮ If C is non-empty, then at least one literal is selected in C.

We denote selected literals by underlining them, e.g., p ∨ ¬q

slide-82
SLIDE 82

Selection Function

A literal selection function selects literals in a clause.

◮ If C is non-empty, then at least one literal is selected in C.

We denote selected literals by underlining them, e.g., p ∨ ¬q Note: selection function does not have to be a function. It can be any

  • racle that selects literals.
slide-83
SLIDE 83

Binary Resolution with Selection

We introduce a family of inference systems, parametrised by a literal selection function σ. The binary resolution inference system, denoted by BRσ, consists of two inference rules:

◮ Binary resolution, denoted by BR

p ∨ C1 ¬p ∨ C2 C1 ∨ C2 (BR).

slide-84
SLIDE 84

Binary Resolution with Selection

We introduce a family of inference systems, parametrised by a literal selection function σ. The binary resolution inference system, denoted by BRσ, consists of two inference rules:

◮ Binary resolution, denoted by BR

p ∨ C1 ¬p ∨ C2 C1 ∨ C2 (BR).

◮ Positive factoring, denoted by Fact:

p ∨ p ∨ C p ∨ C (Fact).

slide-85
SLIDE 85

Completeness?

Binary resolution with selection may be incomplete, even when factoring is unrestricted (also applied to negative literals).

slide-86
SLIDE 86

Completeness?

Binary resolution with selection may be incomplete, even when factoring is unrestricted (also applied to negative literals). Consider this set of clauses: (1) ¬q ∨ r (2) ¬p ∨ q (3) ¬r ∨ ¬q (4) ¬q ∨ ¬p (5) ¬p ∨ ¬r (6) ¬r ∨ p (7) r ∨ q ∨ p

slide-87
SLIDE 87

Completeness?

Binary resolution with selection may be incomplete, even when factoring is unrestricted (also applied to negative literals). Consider this set of clauses: (1) ¬q ∨ r (2) ¬p ∨ q (3) ¬r ∨ ¬q (4) ¬q ∨ ¬p (5) ¬p ∨ ¬r (6) ¬r ∨ p (7) r ∨ q ∨ p It is unsatisfiable: (8) q ∨ p (6, 7) (9) q (2, 8) (10) r (1, 9) (11) ¬q (3, 10) (12)

  • (9, 11)

Note the linear representation of derivations (used by Vampire and many other provers). However, any inference with selection applied to this set of clauses give either a clause in this set, or a clause containing a clause in this set.

slide-88
SLIDE 88

Literal Orderings

Take any well-founded ordering ≻ on atoms, that is, an ordering such that there is no infinite decreasing chain of atoms: A0 ≻ A1 ≻ A2 ≻ · · · In the sequel ≻ will always denote a well-founded ordering.

slide-89
SLIDE 89

Literal Orderings

Take any well-founded ordering ≻ on atoms, that is, an ordering such that there is no infinite decreasing chain of atoms: A0 ≻ A1 ≻ A2 ≻ · · · In the sequel ≻ will always denote a well-founded ordering. Extend it to an ordering on literals by:

◮ If p ≻ q, then p ≻ ¬q and ¬p ≻ q; ◮ ¬p ≻ p.

slide-90
SLIDE 90

Literal Orderings

Take any well-founded ordering ≻ on atoms, that is, an ordering such that there is no infinite decreasing chain of atoms: A0 ≻ A1 ≻ A2 ≻ · · · In the sequel ≻ will always denote a well-founded ordering. Extend it to an ordering on literals by:

◮ If p ≻ q, then p ≻ ¬q and ¬p ≻ q; ◮ ¬p ≻ p.

Exercise: prove that the induced ordering on literals is well-founded too.

slide-91
SLIDE 91

Orderings and Well-Behaved Selections

Fix an ordering ≻. A literal selection function is well-behaved if

◮ If all selected literals are positive, then all maximal (w.r.t. ≻)

literals in C are selected. In other words, either a negative literal is selected, or all maximal literals must be selected.

slide-92
SLIDE 92

Orderings and Well-Behaved Selections

Fix an ordering ≻. A literal selection function is well-behaved if

◮ If all selected literals are positive, then all maximal (w.r.t. ≻)

literals in C are selected. In other words, either a negative literal is selected, or all maximal literals must be selected. To be well-behaved, we sometimes must select more than one different literal in a clause. Example: p ∨ p or p(x) ∨ p(y).

slide-93
SLIDE 93

Completeness of Binary Resolution with Selection

Binary resolution with selection is complete for every well-behaved selection function.

slide-94
SLIDE 94

Completeness of Binary Resolution with Selection

Binary resolution with selection is complete for every well-behaved selection function. Consider our previous example: (1) ¬q ∨ r (2) ¬p ∨ q (3) ¬r ∨ ¬q (4) ¬q ∨ ¬p (5) ¬p ∨ ¬r (6) ¬r ∨ p (7) r ∨ q ∨ p A well-behave selection function must satisfy:

  • 1. r ≻ q, because of (1)
  • 2. q ≻ p, because of (2)
  • 3. p ≻ r, because of (6)

There is no ordering that satisfies these conditions.

slide-95
SLIDE 95

End of Lecture 1

Slides for lecture 1 ended here . . .

slide-96
SLIDE 96

Outline

Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination Equality

slide-97
SLIDE 97

How to Establish Unsatisfiability?

Completess is formulated in terms of derivability of the empty clause from a set S0 of clauses in an inference system I. However, this formulations gives no hint on how to search for such a derivation.

slide-98
SLIDE 98

How to Establish Unsatisfiability?

Completess is formulated in terms of derivability of the empty clause from a set S0 of clauses in an inference system I. However, this formulations gives no hint on how to search for such a derivation. Idea:

◮ Take a set of clauses S (the search space), initially S = S0.

Repeatedly apply inferences in I to clauses in S and add their conclusions to S, unless these conclusions are already in S.

◮ If, at any stage, we obtain , we terminate and report

unsatisfiability of S0.

slide-99
SLIDE 99

How to Establish Satisfiability?

When can we report satisfiability?

slide-100
SLIDE 100

How to Establish Satisfiability?

When can we report satisfiability? When we build a set S such that any inference applied to clauses in S is already a member of S. Any such set of clauses is called saturated (with respect to I).

slide-101
SLIDE 101

How to Establish Satisfiability?

When can we report satisfiability? When we build a set S such that any inference applied to clauses in S is already a member of S. Any such set of clauses is called saturated (with respect to I). In first-order logic it is often the case that all saturated sets are infinite (due to undecidability), so in practice we can never build a saturated set. The process of trying to build one is referred to as saturation.

slide-102
SLIDE 102

Saturated Set of Clauses

Let I be an inference system on formulas and S be a set of formulas.

◮ S is called saturated with respect to I, or simply I-saturated, if for

every inference of I with premises in S, the conclusion of this inference also belongs to S.

◮ The closure of S with respect to I, or simply I-closure, is the

smallest set S′ containing S and saturated with respect to I.

slide-103
SLIDE 103

Inference Process

Inference process: sequence of sets of formulas S0, S1, . . ., denoted by S0 ⇒ S1 ⇒ S2 ⇒ . . . (Si ⇒ Si+1) is a step of this process.

slide-104
SLIDE 104

Inference Process

Inference process: sequence of sets of formulas S0, S1, . . ., denoted by S0 ⇒ S1 ⇒ S2 ⇒ . . . (Si ⇒ Si+1) is a step of this process. We say that this step is an I-step if

  • 1. there exists an inference

F1 . . . Fn F in I such that {F1, . . . , Fn} ⊆ Si;

  • 2. Si+1 = Si ∪ {F}.
slide-105
SLIDE 105

Inference Process

Inference process: sequence of sets of formulas S0, S1, . . ., denoted by S0 ⇒ S1 ⇒ S2 ⇒ . . . (Si ⇒ Si+1) is a step of this process. We say that this step is an I-step if

  • 1. there exists an inference

F1 . . . Fn F in I such that {F1, . . . , Fn} ⊆ Si;

  • 2. Si+1 = Si ∪ {F}.

An I-inference process is an inference process whose every step is an I-step.

slide-106
SLIDE 106

Property

Let S0 ⇒ S1 ⇒ S2 ⇒ . . . be an I-inference process and a formula F belongs to some Si. Then Si is derivable in I from S0. In particular, every Si is a subset of the I-closure of S0.

slide-107
SLIDE 107

Limit of a Process

The limit of an inference process S0 ⇒ S1 ⇒ S2 ⇒ . . . is the set of formulas

i Si.

slide-108
SLIDE 108

Limit of a Process

The limit of an inference process S0 ⇒ S1 ⇒ S2 ⇒ . . . is the set of formulas

i Si.

In other words, the limit is the set of all derived formulas.

slide-109
SLIDE 109

Limit of a Process

The limit of an inference process S0 ⇒ S1 ⇒ S2 ⇒ . . . is the set of formulas

i Si.

In other words, the limit is the set of all derived formulas. Suppose that we have an infinite inference process such that S0 is unsatisfiable and we use a sound and complete inference system.

slide-110
SLIDE 110

Limit of a Process

The limit of an inference process S0 ⇒ S1 ⇒ S2 ⇒ . . . is the set of formulas

i Si.

In other words, the limit is the set of all derived formulas. Suppose that we have an infinite inference process such that S0 is unsatisfiable and we use a sound and complete inference system. Question: does completeness imply that the limit of the process contains the empty clause?

slide-111
SLIDE 111

Fairness

Let S0 ⇒ S1 ⇒ S2 ⇒ . . . be an inference process with the limit S∞. The process is called fair if for every I-inference F1 . . . Fn F , if {F1, . . . , Fn} ⊆ S∞, then there exists i such that F ∈ Si.

slide-112
SLIDE 112

Completeness, reformulated

Theorem Let I be an inference system. The following conditions are equivalent.

  • 1. I is complete.
  • 2. For every unsatisfiable set of formulas S0 and any fair I-inference

process with the initial set S0, the limit of this inference process contains .

slide-113
SLIDE 113

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space

slide-114
SLIDE 114

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space given clause

slide-115
SLIDE 115

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space given clause candidate clauses

slide-116
SLIDE 116

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space given clause candidate clauses children

slide-117
SLIDE 117

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space children

slide-118
SLIDE 118

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space children

slide-119
SLIDE 119

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space

slide-120
SLIDE 120

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space given clause

slide-121
SLIDE 121

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space given clause candidate clauses

slide-122
SLIDE 122

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space given clause candidate clauses children

slide-123
SLIDE 123

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space children

slide-124
SLIDE 124

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space children

slide-125
SLIDE 125

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space

slide-126
SLIDE 126

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space

slide-127
SLIDE 127

Fair Saturation Algorithms: Inference Selection by Clause Selection

search space

MEMORY

slide-128
SLIDE 128

Saturation Algorithm

A saturation algorithm tries to saturate a set of clauses with respect to a given inference system. In theory there are three possible scenarios:

  • 1. At some moment the empty clause is generated, in this case

the input set of clauses is unsatisfiable.

  • 2. Saturation will terminate without ever generating , in this case

the input set of clauses in satisfiable.

  • 3. Saturation will run forever, but without generating . In this case

the input set of clauses is satisfiable.

slide-129
SLIDE 129

Saturation Algorithm in Practice

In practice there are three possible scenarios:

  • 1. At some moment the empty clause is generated, in this case

the input set of clauses is unsatisfiable.

  • 2. Saturation will terminate without ever generating , in this case

the input set of clauses in satisfiable.

  • 3. Saturation will run until we run out of resources, but without

generating . In this case it is unknown whether the input set is unsatisfiable.

slide-130
SLIDE 130

Saturation Algorithm

Even when we implement inference selection by clause selection, there are too many inferences, especially when the search space grows.

slide-131
SLIDE 131

Saturation Algorithm

Even when we implement inference selection by clause selection, there are too many inferences, especially when the search space grows. Solution: only apply inferences to the selected clause and the previously selected clauses.

slide-132
SLIDE 132

Saturation Algorithm

Even when we implement inference selection by clause selection, there are too many inferences, especially when the search space grows. Solution: only apply inferences to the selected clause and the previously selected clauses. Thus, the search space is divided in two parts:

◮ active clauses, that participate in inferences; ◮ passive clauses, that do not participate in inferences.

slide-133
SLIDE 133

Saturation Algorithm

Even when we implement inference selection by clause selection, there are too many inferences, especially when the search space grows. Solution: only apply inferences to the selected clause and the previously selected clauses. Thus, the search space is divided in two parts:

◮ active clauses, that participate in inferences; ◮ passive clauses, that do not participate in inferences.

Observation: the set of passive clauses is usually considerably larger than the set of active clauses, often by 2-4 orders of magnitude (depending on the saturation algorithm and the problem).

slide-134
SLIDE 134

Outline

Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination Equality

slide-135
SLIDE 135

Subsumption and Tautology Deletion

A clause is a propositional tautology if it is of the form A ∨ ¬A ∨ C, that is, it contains a pair of complementary literals. There are also equational tautologies, for example a ≃ b ∨ b ≃ c ∨ f(c, c) ≃ f(a, a).

slide-136
SLIDE 136

Subsumption and Tautology Deletion

A clause is a propositional tautology if it is of the form A ∨ ¬A ∨ C, that is, it contains a pair of complementary literals. There are also equational tautologies, for example a ≃ b ∨ b ≃ c ∨ f(c, c) ≃ f(a, a). A clause C subsumes any clause C ∨ D, where D is non-empty.

slide-137
SLIDE 137

Subsumption and Tautology Deletion

A clause is a propositional tautology if it is of the form A ∨ ¬A ∨ C, that is, it contains a pair of complementary literals. There are also equational tautologies, for example a ≃ b ∨ b ≃ c ∨ f(c, c) ≃ f(a, a). A clause C subsumes any clause C ∨ D, where D is non-empty. It was known since 1965 that subsumed clauses and propositional tautologies can be removed from the search space.

slide-138
SLIDE 138

Problem

How can we prove that completeness is preserved if we remove subsumed clauses and tautologies from the search space?

slide-139
SLIDE 139

Problem

How can we prove that completeness is preserved if we remove subsumed clauses and tautologies from the search space? Solution: general theory of redundancy.

slide-140
SLIDE 140

Bag Extension of an Ordering

Bag = finite multiset. Let > be any ordering on a set X. The bag extension of > is a binary relation >bag, on bags over X, defined as the smallest transitive relation on bags such that {x, y1, . . . , yn} >bag {x1, . . . , xm, y1, . . . , yn} if x > xi for all i ∈ {1 . . . m}, where m ≥ 0.

slide-141
SLIDE 141

Bag Extension of an Ordering

Bag = finite multiset. Let > be any ordering on a set X. The bag extension of > is a binary relation >bag, on bags over X, defined as the smallest transitive relation on bags such that {x, y1, . . . , yn} >bag {x1, . . . , xm, y1, . . . , yn} if x > xi for all i ∈ {1 . . . m}, where m ≥ 0. Idea: a bag becomes smaller if we replace an element by any finite number of smaller elements.

slide-142
SLIDE 142

Bag Extension of an Ordering

Bag = finite multiset. Let > be any ordering on a set X. The bag extension of > is a binary relation >bag, on bags over X, defined as the smallest transitive relation on bags such that {x, y1, . . . , yn} >bag {x1, . . . , xm, y1, . . . , yn} if x > xi for all i ∈ {1 . . . m}, where m ≥ 0. Idea: a bag becomes smaller if we replace an element by any finite number of smaller elements. The following results are known about the bag extensions of

  • rderings:
  • 1. >bag is an ordering;
  • 2. If > is total, then so is >bag;
  • 3. If > is well-founded, then so is >bag.
slide-143
SLIDE 143

Clause Orderings

From now on consider clauses also as bags of literals. Note:

◮ we have an ordering ≻ for comparing literals; ◮ a clause is a bag of literals.

slide-144
SLIDE 144

Clause Orderings

From now on consider clauses also as bags of literals. Note:

◮ we have an ordering ≻ for comparing literals; ◮ a clause is a bag of literals.

Hence

◮ we can compare clauses using the bag extension ≻bag of ≻.

slide-145
SLIDE 145

Clause Orderings

From now on consider clauses also as bags of literals. Note:

◮ we have an ordering ≻ for comparing literals; ◮ a clause is a bag of literals.

Hence

◮ we can compare clauses using the bag extension ≻bag of ≻.

For simpicity we denote the multiset ordering also by ≻.

slide-146
SLIDE 146

Redundancy

A clause C ∈ S is called redundant in S if it is a logical consequence

  • f clauses in S strictly smaller than C.
slide-147
SLIDE 147

Examples

A tautology A ∨ ¬A ∨ C is a logical consequence of the empty set of formulas: | = A ∨ ¬A ∨ C, therefore it is redundant.

slide-148
SLIDE 148

Examples

A tautology A ∨ ¬A ∨ C is a logical consequence of the empty set of formulas: | = A ∨ ¬A ∨ C, therefore it is redundant. We know that C subsumes C ∨ D. Note C ∨ D ≻ C C | = C ∨ D therefore subsumed clauses are redundant.

slide-149
SLIDE 149

Examples

A tautology A ∨ ¬A ∨ C is a logical consequence of the empty set of formulas: | = A ∨ ¬A ∨ C, therefore it is redundant. We know that C subsumes C ∨ D. Note C ∨ D ≻ C C | = C ∨ D therefore subsumed clauses are redundant. If ∈ S, then all non-empty other clauses in S are redundant.

slide-150
SLIDE 150

Redundant Clauses Can be Removed

In BRσ (and in all calculi we will consider later) redundant clauses can be removed from the search space.

slide-151
SLIDE 151

Redundant Clauses Can be Removed

In BRσ (and in all calculi we will consider later) redundant clauses can be removed from the search space.

slide-152
SLIDE 152

Inference Process with Redundancy

Let I be an inference system. Consider an inference process with two kinds of step Si ⇒ Si+1:

  • 1. Adding the conclusion of an I-inference with premises in Si.
  • 2. Deletion of a clause redundant in Si, that is

Si+1 = Si − {C}, where C is redundant in Si.

slide-153
SLIDE 153

Fairness: Persistent Clauses and Limit

Consider an inference process S0 ⇒ S1 ⇒ S2 ⇒ . . . A clause C is called persistent if ∃i∀j ≥ i(C ∈ Sj). The limit Sω of the inference process is the set of all persistent clauses: Sω =

  • i=0,1,...
  • j≥i

Sj.

slide-154
SLIDE 154

Fairness

The process is called I-fair if every inference with persistent premises in Sω has been applied, that is, if C1 . . . Cn C is an inference in I and {C1, . . . , Cn} ⊆ Sω, then C ∈ Si for some i.

slide-155
SLIDE 155

Completeness of BR≻,σ

Completeness Theorem. Let ≻ be a simplification ordering and σ a well-behaved selection function. Let also

  • 1. S0 be a set of clauses;
  • 2. S0 ⇒ S1 ⇒ S2 ⇒ . . . be a fair BR≻,σ-inference process.

Then S0 is unsatisfiable if and only if ∈ Si for some i.

slide-156
SLIDE 156

Saturation up to Redundancy

A set S of clauses is called saturated up to redundancy if for every I-inference C1 . . . Cn C with premises in S, either

  • 1. C ∈ S; or
  • 2. C is redundant w.r.t. S, that is, S≺C |

= C.

slide-157
SLIDE 157

End of Lecture 2

Slides for lecture 2 ended here . . .

slide-158
SLIDE 158

Proof of Completeness

A trace of a clause C: a set of clauses {C1, . . . , Cn} ⊆ Sω such that

  • 1. C ≻ Ci for all i = 1, . . . , n;
  • 2. C1, . . . , Cn |

= C. Lemma 1. Every removed clause has a trace. Lemma 2. The limit Sω is saturated up to redundancy. Lemma 3. The limit Sω is logically equivalent to the initial set S0. Lemma 4. A set S of clauses saturated up to redundancy in BR≻,σ is unsatisfiable if and only if ∈ S.

slide-159
SLIDE 159

Proof of Completeness

A trace of a clause C: a set of clauses {C1, . . . , Cn} ⊆ Sω such that

  • 1. C ≻ Ci for all i = 1, . . . , n;
  • 2. C1, . . . , Cn |

= C. Lemma 1. Every removed clause has a trace. Lemma 2. The limit Sω is saturated up to redundancy. Lemma 3. The limit Sω is logically equivalent to the initial set S0. Lemma 4. A set S of clauses saturated up to redundancy in BR≻,σ is unsatisfiable if and only if ∈ S. Interestingly, only the last lemma uses rules of BR≻,σ.

slide-160
SLIDE 160

Binary Resolution with Selection

One of the key properties to satisfy this lemma is the following: the conclusion of every rule is strictly smaller that the rightmost premise

  • f this rule.

◮ Binary resolution,

p ∨ C1 ¬p ∨ C2 C1 ∨ C2 (BR).

◮ Positive factoring,

p ∨ p ∨ C p ∨ C (Fact).

slide-161
SLIDE 161

Saturation up to Redundancy and Satisfiability Checking

Lemma 4. A set S of clauses saturated up to redundancy in BR≻,σ is unsatisfiable if and only if ∈ S.

slide-162
SLIDE 162

Saturation up to Redundancy and Satisfiability Checking

Lemma 4. A set S of clauses saturated up to redundancy in BR≻,σ is unsatisfiable if and only if ∈ S. Therefore, if we built a set saturated up to redundancy, then the initial set S0 is satisfiable. This is a powerful way of checking redundancy:

  • ne can even check satisfiability of formulas having only infinite

models.

slide-163
SLIDE 163

Saturation up to Redundancy and Satisfiability Checking

Lemma 4. A set S of clauses saturated up to redundancy in BR≻,σ is unsatisfiable if and only if ∈ S. Therefore, if we built a set saturated up to redundancy, then the initial set S0 is satisfiable. This is a powerful way of checking redundancy:

  • ne can even check satisfiability of formulas having only infinite

models. The only problem with this characterisation is that there is no obvious way to build a model of S0 out of a saturated set.

slide-164
SLIDE 164

Outline

Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination Equality

slide-165
SLIDE 165

First-order logic with equality

◮ Equality predicate: =. ◮ Equality: l = r.

The order of literals in equalities does not matter, that is, we consider an equality l = r as a multiset consisting of two terms l, r, and so consider l = r and r = l equal.

slide-166
SLIDE 166
  • Equality. An Axiomatisation

◮ reflexivity axiom: x = x; ◮ symmetry axiom: x = y → y = x; ◮ transitivity axiom: x = y ∧ y = z → x = z; ◮ function substitution axioms:

x1 = y1 ∧ . . . ∧ xn = yn → f(x1, . . . , xn) = f(y1, . . . , yn), for every function symbol f;

◮ predicate substitution axioms:

x1 = y1 ∧ . . . ∧ xn = yn ∧ P(x1, . . . , xn) → P(y1, . . . , yn) for every predicate symbol P.

slide-167
SLIDE 167

Inference systems for logic with equality

We will define a resolution and superposition inference system. This system is complete. One can eliminate redundancy (but the literal

  • rdering needs to satisfy additional properties).
slide-168
SLIDE 168

Inference systems for logic with equality

We will define a resolution and superposition inference system. This system is complete. One can eliminate redundancy (but the literal

  • rdering needs to satisfy additional properties).

Moreover, we will first define it only for ground clauses. On the theoretical side,

◮ Completeness is first proved for ground clauses only. ◮ It is then “lifted” to arbitrary clauses using a technique called

lifting.

◮ Moreover, this way some notions (ordering, selection function)

can first be defined for ground clauses only and then it is relatively easy to see how to generalise them for non-ground clauses.

slide-169
SLIDE 169

Simple Ground Superposition Inference System

Superposition: (right and left) l = r ∨ C s[l] = t ∨ D s[r] = t ∨ C ∨ D (Sup), l = r ∨ C s[l] ≃ t ∨ D s[r] ≃ t ∨ C ∨ D (Sup),

slide-170
SLIDE 170

Simple Ground Superposition Inference System

Superposition: (right and left) l = r ∨ C s[l] = t ∨ D s[r] = t ∨ C ∨ D (Sup), l = r ∨ C s[l] ≃ t ∨ D s[r] ≃ t ∨ C ∨ D (Sup), Equality Resolution: s ≃ s ∨ C C (ER),

slide-171
SLIDE 171

Simple Ground Superposition Inference System

Superposition: (right and left) l = r ∨ C s[l] = t ∨ D s[r] = t ∨ C ∨ D (Sup), l = r ∨ C s[l] ≃ t ∨ D s[r] ≃ t ∨ C ∨ D (Sup), Equality Resolution: s ≃ s ∨ C C (ER), Equality Factoring: s = t ∨ s = t′ ∨ C s = t ∨ t ≃ t′ ∨ C (EF),

slide-172
SLIDE 172

Example

f(a) = a ∨ g(a) = a f(f(a)) = a ∨ g(g(a)) ≃ a f(f(a)) ≃ a

slide-173
SLIDE 173

Can this system be used for efficient theorem proving?

Not really. It has too many inferences. For example, from the clause f(a) = a we can derive any clause of the form f m(a) = f n(a) where m, n ≥ 0.

slide-174
SLIDE 174

Can this system be used for efficient theorem proving?

Not really. It has too many inferences. For example, from the clause f(a) = a we can derive any clause of the form f m(a) = f n(a) where m, n ≥ 0. Worst of all, the derived clauses can be much larger than the original clause f(a) = a.

slide-175
SLIDE 175

Can this system be used for efficient theorem proving?

Not really. It has too many inferences. For example, from the clause f(a) = a we can derive any clause of the form f m(a) = f n(a) where m, n ≥ 0. Worst of all, the derived clauses can be much larger than the original clause f(a) = a. The recipe is to use the previously introduced ingredients:

  • 1. Ordering;
  • 2. Literal selection;
  • 3. Redundancy elimination.
slide-176
SLIDE 176

Atom and literal orderings on equalities

Equality atom comparison treats an equality s = t as the multiset ˙ {s, t ˙ }.

◮ (s′ = t′) ≻lit (s = t) if ˙

{s′, t′ ˙ } ≻ ˙ {s, t ˙ }.

◮ (s′ ≃ t′) ≻lit (s ≃ t) if ˙

{s′, t′ ˙ } ≻ ˙ {s, t ˙ }. Finally, we assert that all non-equality literals be greater than all equality literals.

slide-177
SLIDE 177

Ground Superposition Inference System Sup≻,σ

Let σ be a literal selection function. Superposition: (right and left) l = r ∨ C s[l] = t ∨ D s[r] = t ∨ C ∨ D (Sup), l = r ∨ C s[l] ≃ t ∨ D s[r] ≃ t ∨ C ∨ D (Sup), where (i) l ≻ r, (ii) s[l] ≻ t, (iii) l = r is strictly greater than any literal in C, (iv) s[l] = t is greater than or equal to any literal in D.

slide-178
SLIDE 178

Ground Superposition Inference System Sup≻,σ

Let σ be a literal selection function. Superposition: (right and left) l = r ∨ C s[l] = t ∨ D s[r] = t ∨ C ∨ D (Sup), l = r ∨ C s[l] ≃ t ∨ D s[r] ≃ t ∨ C ∨ D (Sup), where (i) l ≻ r, (ii) s[l] ≻ t, (iii) l = r is strictly greater than any literal in C, (iv) s[l] = t is greater than or equal to any literal in D. Equality Resolution: s ≃ s ∨ C C (ER),

slide-179
SLIDE 179

Ground Superposition Inference System Sup≻,σ

Let σ be a literal selection function. Superposition: (right and left) l = r ∨ C s[l] = t ∨ D s[r] = t ∨ C ∨ D (Sup), l = r ∨ C s[l] ≃ t ∨ D s[r] ≃ t ∨ C ∨ D (Sup), where (i) l ≻ r, (ii) s[l] ≻ t, (iii) l = r is strictly greater than any literal in C, (iv) s[l] = t is greater than or equal to any literal in D. Equality Resolution: s ≃ s ∨ C C (ER), Equality Factoring: s = t ∨ s = t′ ∨ C s = t ∨ t ≃ t′ ∨ C (EF), where (i) s ≻ t t′; (ii) s = t is greater than or equal to any literal in C.

slide-180
SLIDE 180

Extension to arbitrary (non-equality) literals

◮ Consider a two-sorted logic in which equality is the only

predicate symbol.

◮ Interpret terms as terms of the first sort and non-equality atoms

as terms of the second sort.

◮ Add a constant ⊤ of the second sort. ◮ Replace non-equality atoms p(t1, . . . , tn) by equalities of the

second sort p(t1, . . . , tn) = ⊤.

slide-181
SLIDE 181

Extension to arbitrary (non-equality) literals

◮ Consider a two-sorted logic in which equality is the only

predicate symbol.

◮ Interpret terms as terms of the first sort and non-equality atoms

as terms of the second sort.

◮ Add a constant ⊤ of the second sort. ◮ Replace non-equality atoms p(t1, . . . , tn) by equalities of the

second sort p(t1, . . . , tn) = ⊤. For example, the clause p(a, b) ∨ ¬q(a) ∨ a = b becomes p(a, b) = ⊤ ∨ q(a) ≃ ⊤ ∨ a = b.

slide-182
SLIDE 182

Binary resolution inferences can be represented by inferences in the superposition system

We ignore selection functions. A ∨ C1 ¬A ∨ C2 C1 ∨ C2 (BR) A = ⊤ ∨ C1 A ≃ ⊤ ∨ C2 ⊤ ≃ ⊤ ∨ C1 ∨ C2 (Sup) C1 ∨ C2 (ER)

slide-183
SLIDE 183

Exercise

Positive factoring can also be represented by inferences in the superposition system.

slide-184
SLIDE 184

Simplification Ordering

The only restriction we imposed on term orderings was well-foundedness and stability under substitutions. When we deal with equality, these two properties are insufficient. We need a third property, called monotonicity. An ordering ≻ on terms is called a simplification ordering if

  • 1. ≻ is well-founded;
  • 2. ≻ is monotonic: if l ≻ r, then s[l] ≻ s[r];
  • 3. ≻ is stable under substitutions: if l ≻ r, then lθ ≻ rθ.
slide-185
SLIDE 185

Simplification Ordering

The only restriction we imposed on term orderings was well-foundedness and stability under substitutions. When we deal with equality, these two properties are insufficient. We need a third property, called monotonicity. An ordering ≻ on terms is called a simplification ordering if

  • 1. ≻ is well-founded;
  • 2. ≻ is monotonic: if l ≻ r, then s[l] ≻ s[r];
  • 3. ≻ is stable under substitutions: if l ≻ r, then lθ ≻ rθ.

One can combine the last two properties into one:

  • 2a. If l ≻ r, then s[lθ] ≻ s[rθ].
slide-186
SLIDE 186

End of Lecture 3

Slides for lecture 3 ended here . . .