+ All Categories
Home > Documents > Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf ·...

Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf ·...

Date post: 09-Jun-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
193
Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin The University of Manchester UK [email protected]
Transcript
Page 1: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Instantiation-Based Automated Theorem Proving

for First-Order Logic

Konstantin Korovin

The University of Manchester

UK

[email protected]

Page 2: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theorem proving for first-order logic

Theorem proving: Show that a given first-order formula is a theorem.

Maths: Axioms of groups Group

I ∀x , y , z (x · (y · z) ' (x · y) · z)

I ∀x (x · x−1 ' e)

I ∀x (x · e ' x)

Consider F = ∀x∃y ((x · y)−1 ' y−1 · x−1)

Is F a theorem in the group theory: Group |= F ?

Verification: Axioms of arrays

I ∀a, i , e (select(store(a, i , e), i) ' e)

I ∀a, i , j , e (i 6' j → (select(store(a, i , e), j) ' select(a, j)))

I ∀a1, a2 ((∀i (select(a1, i) ' select(a2, i)))→ a1 ' a2)

Is ∃a∃i∀j (select(a, i) ' select(a, j)) a theorem in the theory of arrays ?

2 / 1

Page 3: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theorem proving for first-order logic

Theorem proving: Show that a given first-order formula is a theorem.

Maths: Axioms of groups Group

I ∀x , y , z (x · (y · z) ' (x · y) · z)

I ∀x (x · x−1 ' e)

I ∀x (x · e ' x)

Consider F = ∀x∃y ((x · y)−1 ' y−1 · x−1)

Is F a theorem in the group theory: Group |= F ?

Verification: Axioms of arrays

I ∀a, i , e (select(store(a, i , e), i) ' e)

I ∀a, i , j , e (i 6' j → (select(store(a, i , e), j) ' select(a, j)))

I ∀a1, a2 ((∀i (select(a1, i) ' select(a2, i)))→ a1 ' a2)

Is ∃a∃i∀j (select(a, i) ' select(a, j)) a theorem in the theory of arrays ?3 / 1

Page 4: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Why first-order logic

I Expressive most of mathematics can be formalised in FOL

I Complete calculi – uniform reasoning methods

I Efficient reasoning – well-understood algorithms and datastructures

I Reductions from HOL to FOL: Blanchette (Sledgehammer), Urban

(Mizar)

FOL provides a good balance between expressivity and efficiency.

*

[”The Unreasonable Effectiveness of Mathematics in the Natural Sciences” E.

Wigner]

[Unreasonable effectiveness of logic in computer science]

4 / 1

Page 5: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Why first-order logic

I Expressive most of mathematics can be formalised in FOL

I Complete calculi – uniform reasoning methods

I Efficient reasoning – well-understood algorithms and datastructures

I Reductions from HOL to FOL: Blanchette (Sledgehammer), Urban

(Mizar)

FOL provides a good balance between expressivity and efficiency.

*

[”The Unreasonable Effectiveness of Mathematics in the Natural Sciences” E.

Wigner]

[Unreasonable effectiveness of logic in computer science]

5 / 1

Page 6: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Why first-order logic

I Expressive most of mathematics can be formalised in FOL

I Complete calculi – uniform reasoning methods

I Efficient reasoning – well-understood algorithms and datastructures

I Reductions from HOL to FOL: Blanchette (Sledgehammer), Urban

(Mizar)

FOL provides a good balance between expressivity and efficiency.

*

[”The Unreasonable Effectiveness of Mathematics in the Natural Sciences” E.

Wigner]

[Unreasonable effectiveness of logic in computer science]6 / 1

Page 7: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Calculi for first-order logic

Calculi complete for first-order logic:

I natural deduction

I difficult to automate

I tableaux-based calculi

I popular with special fragments: modal and description logics

I difficult to automate efficiently in the general case

I resolution/superposition calculi

I general purpose

I can be efficiently automated

I decision procedure for many fragments

I instantiation-based calculi

I combination of efficient propositional reasoning with first-order

reasoning

I can be efficiently automated

I decision procedure for the effectively propositional fragment (EPR)

7 / 1

Page 8: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Calculi for first-order logic

Calculi complete for first-order logic:

I natural deduction

I difficult to automate

I tableaux-based calculi

I popular with special fragments: modal and description logics

I difficult to automate efficiently in the general case

I resolution/superposition calculi

I general purpose

I can be efficiently automated

I decision procedure for many fragments

I instantiation-based calculi

I combination of efficient propositional reasoning with first-order

reasoning

I can be efficiently automated

I decision procedure for the effectively propositional fragment (EPR)

8 / 1

Page 9: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Calculi for first-order logic

Calculi complete for first-order logic:

I natural deduction

I difficult to automate

I tableaux-based calculi

I popular with special fragments: modal and description logics

I difficult to automate efficiently in the general case

I resolution/superposition calculi

I general purpose

I can be efficiently automated

I decision procedure for many fragments

I instantiation-based calculi

I combination of efficient propositional reasoning with first-order

reasoning

I can be efficiently automated

I decision procedure for the effectively propositional fragment (EPR)

9 / 1

Page 10: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Calculi for first-order logic

Calculi complete for first-order logic:

I natural deduction

I difficult to automate

I tableaux-based calculi

I popular with special fragments: modal and description logics

I difficult to automate efficiently in the general case

I resolution/superposition calculi

I general purpose

I can be efficiently automated

I decision procedure for many fragments

I instantiation-based calculi

I combination of efficient propositional reasoning with first-order

reasoning

I can be efficiently automated

I decision procedure for the effectively propositional fragment (EPR)

10 / 1

Page 11: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Refutational theorem proving

Theorem proving:

|= Axioms→ Theorem

Refutational theorem proving:

Axioms ∧ ¬Theorem |= ⊥

Other reasoning problems: validity, equivalence etc can be reduced to

(un)satisfiability

In order to apply efficient reasoning methods we need to transform

formulas into equi-satisfiable conjunctive normal form.

11 / 1

Page 12: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CNF transformation

Main steps in the basic CNF transformation:

1. Prenex normal form – moving all quantifiers up-front

∀y [∀x [p(f (x), y)]→ ∀v∃z [q(f (z)) ∧ p(v , z)]]⇒∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]

2. Skolemization – eliminating existential quantifiers

∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]⇒∀y∀v [p(f (sk1(y)), y)→ (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]

3. CNF transformation of the quantifier-free part

∀y∀v [ p(f (sk1(y)), y) → (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]⇒∀y∀v [ (¬p(f (sk1(y)), y) ∨ q(f (sk2(y , v)))) ∧

(¬p(f (sk1(y)), y) ∨ p(v , sk2(y , v)))]

Main reasoning problem:

Given set of clauses S prove that it (un)satisfiable.

12 / 1

Page 13: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CNF transformation

Main steps in the basic CNF transformation:

1. Prenex normal form – moving all quantifiers up-front

∀y [∀x [p(f (x), y)]→ ∀v∃z [q(f (z)) ∧ p(v , z)]]⇒∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]

2. Skolemization – eliminating existential quantifiers

∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]⇒∀y∀v [p(f (sk1(y)), y)→ (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]

3. CNF transformation of the quantifier-free part

∀y∀v [ p(f (sk1(y)), y) → (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]⇒∀y∀v [ (¬p(f (sk1(y)), y) ∨ q(f (sk2(y , v)))) ∧

(¬p(f (sk1(y)), y) ∨ p(v , sk2(y , v)))]

Main reasoning problem:

Given set of clauses S prove that it (un)satisfiable.

13 / 1

Page 14: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CNF transformation

Main steps in the basic CNF transformation:

1. Prenex normal form – moving all quantifiers up-front

∀y [∀x [p(f (x), y)]→ ∀v∃z [q(f (z)) ∧ p(v , z)]]⇒∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]

2. Skolemization – eliminating existential quantifiers

∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]⇒∀y∀v [p(f (sk1(y)), y)→ (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]

3. CNF transformation of the quantifier-free part

∀y∀v [ p(f (sk1(y)), y) → (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]⇒∀y∀v [ (¬p(f (sk1(y)), y) ∨ q(f (sk2(y , v)))) ∧

(¬p(f (sk1(y)), y) ∨ p(v , sk2(y , v)))]

Main reasoning problem:

Given set of clauses S prove that it (un)satisfiable.

14 / 1

Page 15: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CNF transformation

Main steps in the basic CNF transformation:

1. Prenex normal form – moving all quantifiers up-front

∀y [∀x [p(f (x), y)]→ ∀v∃z [q(f (z)) ∧ p(v , z)]]⇒∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]

2. Skolemization – eliminating existential quantifiers

∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]⇒∀y∀v [p(f (sk1(y)), y)→ (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]

3. CNF transformation of the quantifier-free part

∀y∀v [ p(f (sk1(y)), y) → (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]⇒∀y∀v [ (¬p(f (sk1(y)), y) ∨ q(f (sk2(y , v)))) ∧

(¬p(f (sk1(y)), y) ∨ p(v , sk2(y , v)))]

Main reasoning problem:

Given set of clauses S prove that it (un)satisfiable.

15 / 1

Page 16: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CNF transformation

Main steps in the basic CNF transformation:

1. Prenex normal form – moving all quantifiers up-front

∀y [∀x [p(f (x), y)]→ ∀v∃z [q(f (z)) ∧ p(v , z)]]⇒∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]

2. Skolemization – eliminating existential quantifiers

∀y∃x∀v∃z [p(f (x), y)→ (q(f (z)) ∧ p(v , z))]⇒∀y∀v [p(f (sk1(y)), y)→ (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]

3. CNF transformation of the quantifier-free part

∀y∀v [ p(f (sk1(y)), y) → (q(f (sk2(y , v))) ∧ p(v , sk2(y , v)))]⇒∀y∀v [ (¬p(f (sk1(y)), y) ∨ q(f (sk2(y , v)))) ∧

(¬p(f (sk1(y)), y) ∨ p(v , sk2(y , v)))]

Main reasoning problem:

Given set of clauses S prove that it (un)satisfiable.

16 / 1

Page 17: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inference systems: propositional resolution

Page 18: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inference-based theorem proving

Given: S – set of clauses.

Example: S = {q ∨ ¬p, p ∨ q, ¬q}We want to prove that S is unsatisfiable.

General Idea:

I use a set of simple rules for deriving new logical consequences from

S .

I use these inference rules to derive the contradiction signified by the

empty clause �

18 / 1

Page 19: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inference-based theorem proving

Given: S – set of clauses.

Example: S = {q ∨ ¬p, p ∨ q, ¬q}We want to prove that S is unsatisfiable.

General Idea:

I use a set of simple rules for deriving new logical consequences from

S .

I use these inference rules to derive the contradiction signified by the

empty clause �

19 / 1

Page 20: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inference-based theorem proving

Given: S – set of clauses.

Example: S = {q ∨ ¬p, p ∨ q, ¬q}We want to prove that S is unsatisfiable.

General Idea:

I use a set of simple rules for deriving new logical consequences from

S .

I use these inference rules to derive the contradiction signified by the

empty clause �

20 / 1

Page 21: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Propositional Resolution

Propositional Resolution inference system BR, consists of the following

inference rules:

I Binary Resolution Rule (BR):

C ∨ p ¬p ∨ D(BR)

C ∨ DI Binary Factoring Rule (BF):

C ∨ L ∨ L (BF )C ∨ L

where L is a literal.

21 / 1

Page 22: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example

Given: S = {q ∨ ¬p, p ∨ q, ¬q}

A proof in resolution calculus:

q ∨ ¬p p ∨ q(BR)

q ∨ q(BF)

q ¬q(BR)

22 / 1

Page 23: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Soundness/Completeness

Theorem (Soundness)

Resolution is a sound inference system:

S `BR � implies S |= ⊥

Theorem (Completeness)

Resolution is a complete inference system:

S |= ⊥ implies S `BR �

23 / 1

Page 24: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Soundness/Completeness

Theorem (Soundness)

Resolution is a sound inference system:

S `BR � implies S |= ⊥

Theorem (Completeness)

Resolution is a complete inference system:

S |= ⊥ implies S `BR �

24 / 1

Page 25: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Proof search based on inference systems

Basic approach. A Saturation Process:

Given set of clauses S we exhaustively apply all inference rules adding the

conclusions to this set until the contradiction (�) is derived.

S0 ⇒ S1 ⇒ . . . Sn ⇒ . . .

Three outcomes:

1. � is derived (� ∈ Sn for some n), then S is unsatisfiable

(soundness);

2. no new clauses can be derived from S and ⊥ 6∈ S , then S is

saturated; in this case S is satisfiable, (completeness).

3. S grows ad infinitum, the process does not terminate.

The main challenge: speed up the first two cases and reduce

non-termination.

25 / 1

Page 26: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Proof search based on inference systems

Basic approach. A Saturation Process:

Given set of clauses S we exhaustively apply all inference rules adding the

conclusions to this set until the contradiction (�) is derived.

S0 ⇒ S1 ⇒ . . . Sn ⇒ . . .

Three outcomes:

1. � is derived (� ∈ Sn for some n), then S is unsatisfiable

(soundness);

2. no new clauses can be derived from S and ⊥ 6∈ S , then S is

saturated; in this case S is satisfiable, (completeness).

3. S grows ad infinitum, the process does not terminate.

The main challenge: speed up the first two cases and reduce

non-termination.

26 / 1

Page 27: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Proof search based on inference systems

Basic approach. A Saturation Process:

Given set of clauses S we exhaustively apply all inference rules adding the

conclusions to this set until the contradiction (�) is derived.

S0 ⇒ S1 ⇒ . . . Sn ⇒ . . .

Three outcomes:

1. � is derived (� ∈ Sn for some n), then S is unsatisfiable

(soundness);

2. no new clauses can be derived from S and ⊥ 6∈ S , then S is

saturated; in this case S is satisfiable, (completeness).

3. S grows ad infinitum, the process does not terminate.

The main challenge: speed up the first two cases and reduce

non-termination.27 / 1

Page 28: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

First-order resolution

Page 29: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :

p(a) ∨ q(a, f (b))

∀x , y [¬p(x) ∨ ¬q(x , f (y))]

. . .

How to check if S is (un)satisfiable ?

Theorem (Herbrand)

S is unsatisfiable if and only there is a finite set of ground instances of

clauses in S which are propositionally unsatisfiable.

General approach: enumerate ground instances and apply resolution to

the ground instances.

29 / 1

Page 30: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :

p(a) ∨ q(a, f (b))

∀x , y [¬p(x) ∨ ¬q(x , f (y))]

. . .

How to check if S is (un)satisfiable ?

Theorem (Herbrand)

S is unsatisfiable if and only there is a finite set of ground instances of

clauses in S which are propositionally unsatisfiable.

General approach: enumerate ground instances and apply resolution to

the ground instances.

30 / 1

Page 31: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :

p(a) ∨ q(a, f (b))

∀x , y [¬p(x) ∨ ¬q(x , f (y))]

. . .

How to check if S is (un)satisfiable ?

Theorem (Herbrand)

S is unsatisfiable if and only there is a finite set of ground instances of

clauses in S which are propositionally unsatisfiable.

General approach: enumerate ground instances and apply resolution to

the ground instances.

31 / 1

Page 32: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :p(a) ∨ q(a, f (b))

¬p(z)

¬q(x , f (y))

How to check if S is (un)satisfiable ?

Replace variables by ground terms and apply resolution:

¬q(a, f (a))

¬q(b, f (f (a)))

. . .

¬q(a, f (b))

p(a) (BR)

¬p(a)

� (BR)

32 / 1

Page 33: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :p(a) ∨ q(a, f (b))

¬p(z)

¬q(x , f (y))

How to check if S is (un)satisfiable ?

Replace variables by ground terms and apply resolution:

¬q(a, f (a))

¬q(b, f (f (a)))

. . .

¬q(a, f (b))

p(a) (BR)

¬p(a)

� (BR)

33 / 1

Page 34: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :p(a) ∨ q(a, f (b))

¬p(z)

¬q(x , f (y))

How to check if S is (un)satisfiable ?

Replace variables by ground terms and apply resolution:

¬q(a, f (a))

¬q(b, f (f (a)))

. . .

¬q(a, f (b))

p(a) (BR)

¬p(a)

� (BR)

34 / 1

Page 35: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :p(a) ∨ q(a, f (b))

¬p(z)

¬q(x , f (y))

How to check if S is (un)satisfiable ?

Replace variables by ground terms and apply resolution:

¬q(a, f (a))

¬q(b, f (f (a)))

. . .

¬q(a, f (b))

p(a) (BR)

¬p(a)

� (BR)

35 / 1

Page 36: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Herbrand theorem

First-order clauses S :p(a) ∨ q(a, f (b))

¬p(z)

¬q(x , f (y))

How to check if S is (un)satisfiable ?

Replace variables by ground terms and apply resolution:

¬q(a, f (a))

¬q(b, f (f (a)))

. . .

¬q(a, f (b))

p(a) (BR)

¬p(a)

� (BR)

36 / 1

Page 37: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground resolution

I A non-ground clause can be seen as representation of a (possibly

infinite) set of its ground instances.

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y)).

A common instance to which ground resolution is applicable:

q(f (a), a) ∨ p(f (a)) and q(a, a) ∨ ¬p(f (a))

I There are other ground instances e.g.:

q(f (f (a)), a) ∨ p(f (f (a))) and q(f (a), f (f (f (a))) ∨ ¬p(f (f (a))

I In order to apply ground resolution we need find substitution which

make atoms p(x) and p(f (y)) syntactically equal.

I Such substitutions are called unifiers.

I Even for two clauses there are infinite number of possible instances

to which resolution is applicable.

37 / 1

Page 38: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground resolution

I A non-ground clause can be seen as representation of a (possibly

infinite) set of its ground instances.

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y)).

A common instance to which ground resolution is applicable:

q(f (a), a) ∨ p(f (a)) and q(a, a) ∨ ¬p(f (a))

I There are other ground instances e.g.:

q(f (f (a)), a) ∨ p(f (f (a))) and q(f (a), f (f (f (a))) ∨ ¬p(f (f (a))

I In order to apply ground resolution we need find substitution which

make atoms p(x) and p(f (y)) syntactically equal.

I Such substitutions are called unifiers.

I Even for two clauses there are infinite number of possible instances

to which resolution is applicable.

38 / 1

Page 39: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground resolution

I A non-ground clause can be seen as representation of a (possibly

infinite) set of its ground instances.

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y)).

A common instance to which ground resolution is applicable:

q(f (a), a) ∨ p(f (a)) and q(a, a) ∨ ¬p(f (a))

I There are other ground instances e.g.:

q(f (f (a)), a) ∨ p(f (f (a))) and q(f (a), f (f (f (a))) ∨ ¬p(f (f (a))

I In order to apply ground resolution we need find substitution which

make atoms p(x) and p(f (y)) syntactically equal.

I Such substitutions are called unifiers.

I Even for two clauses there are infinite number of possible instances

to which resolution is applicable.

39 / 1

Page 40: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground resolution

I A non-ground clause can be seen as representation of a (possibly

infinite) set of its ground instances.

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y)).

A common instance to which ground resolution is applicable:

q(f (a), a) ∨ p(f (a)) and q(a, a) ∨ ¬p(f (a))

I There are other ground instances e.g.:

q(f (f (a)), a) ∨ p(f (f (a))) and q(f (a), f (f (f (a))) ∨ ¬p(f (f (a))

I In order to apply ground resolution we need find substitution which

make atoms p(x) and p(f (y)) syntactically equal.

I Such substitutions are called unifiers.

I Even for two clauses there are infinite number of possible instances

to which resolution is applicable.

40 / 1

Page 41: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground resolution

I A non-ground clause can be seen as representation of a (possibly

infinite) set of its ground instances.

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y)).

A common instance to which ground resolution is applicable:

q(f (a), a) ∨ p(f (a)) and q(a, a) ∨ ¬p(f (a))

I There are other ground instances e.g.:

q(f (f (a)), a) ∨ p(f (f (a))) and q(f (a), f (f (f (a))) ∨ ¬p(f (f (a))

I In order to apply ground resolution we need find substitution which

make atoms p(x) and p(f (y)) syntactically equal.

I Such substitutions are called unifiers.

I Even for two clauses there are infinite number of possible instances

to which resolution is applicable.

41 / 1

Page 42: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground resolution

I A non-ground clause can be seen as representation of a (possibly

infinite) set of its ground instances.

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y)).

A common instance to which ground resolution is applicable:

q(f (a), a) ∨ p(f (a)) and q(a, a) ∨ ¬p(f (a))

I There are other ground instances e.g.:

q(f (f (a)), a) ∨ p(f (f (a))) and q(f (a), f (f (f (a))) ∨ ¬p(f (f (a))

I In order to apply ground resolution we need find substitution which

make atoms p(x) and p(f (y)) syntactically equal.

I Such substitutions are called unifiers.

I Even for two clauses there are infinite number of possible instances

to which resolution is applicable.

42 / 1

Page 43: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Most general unifiers

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y))

I substitute σ = {x 7→ f (y)}

I then q(f (y), a) ∨ p(f (y)) and q(y , z) ∨ ¬p(f (y)).

I Note:

1. underlined atoms are syntactically equal

2. any other substitution can be seen as an instance of σ

σ – most general unifier σ = mgu(p(x), p(f (y)))

3. σ can be seen as a finite representation of all infinitely many

substitutions which makes terms equal.

Theorem [Robinson 1965] If two atoms p(t(x)) and p(s(x)) have a

common ground instance then there is a unique most general unifier σ,

which can be effectively computed. Note p(t(x))σ = p(s(x))σ.

43 / 1

Page 44: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Most general unifiers

I Consider q(x , a) ∨ p(x) and q(y , z) ∨ ¬p(f (y))

I substitute σ = {x 7→ f (y)}

I then q(f (y), a) ∨ p(f (y)) and q(y , z) ∨ ¬p(f (y)).

I Note:

1. underlined atoms are syntactically equal

2. any other substitution can be seen as an instance of σ

σ – most general unifier σ = mgu(p(x), p(f (y)))

3. σ can be seen as a finite representation of all infinitely many

substitutions which makes terms equal.

Theorem [Robinson 1965] If two atoms p(t(x)) and p(s(x)) have a

common ground instance then there is a unique most general unifier σ,

which can be effectively computed. Note p(t(x))σ = p(s(x))σ.

44 / 1

Page 45: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

First-order resolution:

I Resolution rule (BR):

C ∨ p ¬p′ ∨ D(BR)

(C ∨ D)σ

where σ = mgu(p, p′)

I Example:

q(x , a) ∨ p(x) q(y , z) ∨ ¬p(f (y))(BR)

q(f (y), a) ∨ q(y , z)

where mgu(p(x), p(f (y))) = {x 7→ f (y)}

Theorem [Bachmair, Ganzinger] Resolution with many refinements is

complete for first-order logic.

45 / 1

Page 46: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

First-order resolution:

I Resolution rule (BR):

C ∨ p ¬p′ ∨ D(BR)

(C ∨ D)σ

where σ = mgu(p, p′)

I Example:

q(x , a) ∨ p(x) q(y , z) ∨ ¬p(f (y))(BR)

q(f (y), a) ∨ q(y , z)

where mgu(p(x), p(f (y))) = {x 7→ f (y)}

Theorem [Bachmair, Ganzinger] Resolution with many refinements is

complete for first-order logic.

46 / 1

Page 47: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

The magic of resolution

Resolution calculus with appropriate simplifications, selection functions

and saturation strategies is a decision procedure for many fragments:

I monadic fragment [Bachmair, Ganzinger, Waldmann]

I modal logic translations [Hustadt, Schmidt]

I guarded fragment [Ganzinger, de Nivelle]

I two variable fragment [de Nivelle, Pratt-Hartmann]

I fluted fragment [Hustadt, Schmidt, Georgieva]

I many description logic fragments [Kazakov, Motik, Sattler, . . .]

I . . .

I Original proofs of decidability for these fragments are based on

diverse, complicated, model theoretic arguments.

I Resolution-based methods provide practical procedures

I Vampire, E, SPASS are based on extensions resolution

47 / 1

Page 48: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

The magic of resolution

Resolution calculus with appropriate simplifications, selection functions

and saturation strategies is a decision procedure for many fragments:

I monadic fragment [Bachmair, Ganzinger, Waldmann]

I modal logic translations [Hustadt, Schmidt]

I guarded fragment [Ganzinger, de Nivelle]

I two variable fragment [de Nivelle, Pratt-Hartmann]

I fluted fragment [Hustadt, Schmidt, Georgieva]

I many description logic fragments [Kazakov, Motik, Sattler, . . .]

I . . .

I Original proofs of decidability for these fragments are based on

diverse, complicated, model theoretic arguments.

I Resolution-based methods provide practical procedures

I Vampire, E, SPASS are based on extensions resolution

48 / 1

Page 49: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Modular instantiation-based reasoning

Page 50: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

SAT/SMT vs First-Order

The main reasoning problem:

Check that a given a set of clauses S is (un)satisfiable.

Ground (SAT/SMT)

bv(a) ∨mem(c , d)

¬bv(a) ∨mem(d , c)

Very efficient solvers

Not very expressive

CDCL/Congruence closure

First-Order

∀x∃y ¬mem1(x , y)∨mem2(y , f (x))

bv(a) ∨mem(d , c)

Very expressive

Ground: not as efficient

Resolution/Superposition

From ground to first-order: Efficient at ground + Expressive?

50 / 1

Page 51: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Resolution weaknesses

Resolution :

C ∨ L L′ ∨ D(C ∨ D)σ

Example :

Q(x) ∨ P(x) ¬P(a) ∨ R(y)

Q(a) ∨ R(y)

L1 ∨ C1

...

Ln ∨ Cn

Weaknesses:

I Inefficient in propositional case

I Proof search without model search

I Length of clauses can grow fast

I Recombination of clauses

I No effective model representation

51 / 1

Page 52: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Basic idea behind instantiation proving

Can we approximate first-order by ground reasoning?

Theorem (Herbrand). S is unsatisfiable if and only there is a finite set of

ground instances of clauses of S which are propositionally unsatisfiable.

Basic idea: Interleave instantiation with propositional reasoning.

Main issues:

I How to restrict instantiations.

I How to interleave instantiation with propositional reasoning.

[Wang’59; Gilmore’60; Plaisted’92; Inst-Gen Ganzinger, Korovin; Model

Evolution Baumgartner Tinelli; AVATAR Voronkov; SGGS Bonacina Plaisted;

Weidenbach,. . . , SMT quantifier instantiations Ge, de Moura, Reynolds. . . ]

52 / 1

Page 53: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Basic idea behind instantiation proving

Can we approximate first-order by ground reasoning?

Theorem (Herbrand). S is unsatisfiable if and only there is a finite set of

ground instances of clauses of S which are propositionally unsatisfiable.

Basic idea: Interleave instantiation with propositional reasoning.

Main issues:

I How to restrict instantiations.

I How to interleave instantiation with propositional reasoning.

[Wang’59; Gilmore’60; Plaisted’92; Inst-Gen Ganzinger, Korovin; Model

Evolution Baumgartner Tinelli; AVATAR Voronkov; SGGS Bonacina Plaisted;

Weidenbach,. . . , SMT quantifier instantiations Ge, de Moura, Reynolds. . . ]

53 / 1

Page 54: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Basic idea behind instantiation proving

Can we approximate first-order by ground reasoning?

Theorem (Herbrand). S is unsatisfiable if and only there is a finite set of

ground instances of clauses of S which are propositionally unsatisfiable.

Basic idea: Interleave instantiation with propositional reasoning.

Main issues:

I How to restrict instantiations.

I How to interleave instantiation with propositional reasoning.

[Wang’59; Gilmore’60; Plaisted’92; Inst-Gen Ganzinger, Korovin; Model

Evolution Baumgartner Tinelli; AVATAR Voronkov; SGGS Bonacina Plaisted;

Weidenbach,. . . , SMT quantifier instantiations Ge, de Moura, Reynolds. . . ]

54 / 1

Page 55: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Overview of the Inst-Gen procedure

First-Order Clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

Theorem Proved

S⊥ UnSAT

C ∨ L L′ ∨ D

(C ∨ L)σ (L′ ∨ D)σ

Igr |= L⊥, L′⊥ σ = mgu(L, L′)

S⊥ SAT

Igr |= S⊥

Theorem.(Ganzinger, Korovin) Inst-Gen is sound and complete for FOL.

55 / 1

Page 56: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Overview of the Inst-Gen procedure

First-Order Clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

Theorem Proved

S⊥ UnSAT

C ∨ L L′ ∨ D

(C ∨ L)σ (L′ ∨ D)σ

Igr |= L⊥, L′⊥ σ = mgu(L, L′)

S⊥ SAT

Igr |= S⊥

Theorem.(Ganzinger, Korovin) Inst-Gen is sound and complete for FOL.

56 / 1

Page 57: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Overview of the Inst-Gen procedure

First-Order Clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

Theorem Proved

S⊥ UnSAT

C ∨ L L′ ∨ D

(C ∨ L)σ (L′ ∨ D)σ

Igr |= L⊥, L′⊥ σ = mgu(L, L′)

S⊥ SAT

Igr |= S⊥

Theorem.(Ganzinger, Korovin) Inst-Gen is sound and complete for FOL.

57 / 1

Page 58: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Overview of the Inst-Gen procedure

First-Order Clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

Theorem Proved

S⊥ UnSAT

C ∨ L L′ ∨ D

(C ∨ L)σ (L′ ∨ D)σ

Igr |= L⊥, L′⊥ σ = mgu(L, L′)

S⊥ SAT

Igr |= S⊥

Theorem.(Ganzinger, Korovin) Inst-Gen is sound and complete for FOL.

58 / 1

Page 59: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Overview of the Inst-Gen procedure

First-Order Clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

Theorem Proved

S⊥ UnSAT

C ∨ L L′ ∨ D

(C ∨ L)σ (L′ ∨ D)σ

Igr |= L⊥, L′⊥ σ = mgu(L, L′)

S⊥ SAT

Igr |= S⊥

Theorem.(Ganzinger, Korovin) Inst-Gen is sound and complete for FOL.

59 / 1

Page 60: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Overview of the Inst-Gen procedure

First-Order Clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

Theorem Proved

S⊥ UnSAT

C ∨ L L′ ∨ D

(C ∨ L)σ (L′ ∨ D)σ

Igr |= L⊥, L′⊥ σ = mgu(L, L′)

S⊥ SAT

Igr |= S⊥

Theorem.(Ganzinger, Korovin) Inst-Gen is sound and complete for FOL.60 / 1

Page 61: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example:

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

p(f (f (x)), b) ∨ q(f (x), y)

¬p(f (f (x)), b)

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (f (⊥)), b) ∨ q(f (⊥),⊥)

¬p(f (f (⊥)), b)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

The final set is propositionally unsatisfiable.

61 / 1

Page 62: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example:

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

p(f (f (x)), b) ∨ q(f (x), y)

¬p(f (f (x)), b)

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (f (⊥)), b) ∨ q(f (⊥),⊥)

¬p(f (f (⊥)), b)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

The final set is propositionally unsatisfiable.

62 / 1

Page 63: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example:

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

p(f (f (x)), b) ∨ q(f (x), y)

¬p(f (f (x)), b)

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (f (⊥)), b) ∨ q(f (⊥),⊥)

¬p(f (f (⊥)), b)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

The final set is propositionally unsatisfiable.

63 / 1

Page 64: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example:

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

p(f (f (x)), b) ∨ q(f (x), y)

¬p(f (f (x)), b)

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (f (⊥)), b) ∨ q(f (⊥),⊥)

¬p(f (f (⊥)), b)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

The final set is propositionally unsatisfiable.

64 / 1

Page 65: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example:

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

p(f (f (x)), b) ∨ q(f (x), y)

¬p(f (f (x)), b)

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (f (⊥)), b) ∨ q(f (⊥),⊥)

¬p(f (f (⊥)), b)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

The final set is propositionally unsatisfiable.

65 / 1

Page 66: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Example:

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

p(f (f (x)), b) ∨ q(f (x), y)

¬p(f (f (x)), b)

p(f (x), b) ∨ q(x , y)

¬p(f (f (x)), y)

¬q(f (x), x)

p(f (f (⊥)), b) ∨ q(f (⊥),⊥)

¬p(f (f (⊥)), b)

p(f (⊥), b) ∨ q(⊥,⊥)

¬p(f (f (⊥)),⊥)

¬q(f (⊥),⊥)

The final set is propositionally unsatisfiable.66 / 1

Page 67: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Resolution vs Inst-Gen

Resolution :

(C ∨ L) (L′ ∨ D)

(C ∨ D)σ

σ = mgu(L, L′)

Instantiation :

(C ∨ L) (L′ ∨ D)

(C ∨ L)σ (L′ ∨ D)σ

σ = mgu(L, L′)

Weaknesses of resolution:

Proof search without model search

Inefficient in the ground/EPR case

Length of clauses can grow fast

Recombination of clauses

No explicit model representation

Strengths of instantiation:

Proof search guided by prop. models

Modular ground reasoning

Length of clauses is fixed

Decision procedure for EPR

No recombination

Redundancy elimination

Effective model representation

67 / 1

Page 68: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Redundancy Elimination (Inst-Gen)

The key to efficiency is redundancy elimination.

I usual: tautology elimination, strict subsumption

I global subsumption: non-ground simplifications using SAT/SMT

reasoning

I blocking non-proper instantiators

I dismatching constraints

I predicate elimination

I sort inference/redundancies

I definitional redundancies

I . . .

68 / 1

Page 69: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Redundancy Elimination

The key to efficiency is redundancy elimination.

Ground clause C is redundant if

I C 1, . . . ,Cn |= C

I C 1, . . . ,Cn ≺ C

I P(a) |= Q(b) ∨ P(a)

I P(a) ≺((((((

Q(b) ∨ P(a)

Where ≺ is a well-founded ordering.

Theorem Redundant clauses/closures can be eliminated.

Consequences:

I many usual redundancy elimination techniques

I redundancy for inferences

I new instantiation-specific redundancies

69 / 1

Page 70: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Redundancy Elimination

The key to efficiency is redundancy elimination.

Ground clause C is redundant if

I C 1, . . . ,Cn |= C

I C 1, . . . ,Cn ≺ C

I P(a) |= Q(b) ∨ P(a)

I P(a) ≺((((((

Q(b) ∨ P(a)

Where ≺ is a well-founded ordering.

Theorem Redundant clauses/closures can be eliminated.

Consequences:

I many usual redundancy elimination techniques

I redundancy for inferences

I new instantiation-specific redundancies

70 / 1

Page 71: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Redundancy Elimination

The key to efficiency is redundancy elimination.

Ground clause C is redundant if

I C 1, . . . ,Cn |= C

I C 1, . . . ,Cn ≺ C

I P(a) |= Q(b) ∨ P(a)

I P(a) ≺((((((

Q(b) ∨ P(a)

Where ≺ is a well-founded ordering.

Theorem Redundant clauses/closures can be eliminated.

Consequences:

I many usual redundancy elimination techniques

I redundancy for inferences

I new instantiation-specific redundancies

71 / 1

Page 72: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Simplifications by SAT/SMT solver (K. IJCAR’08)

Can off-the-shelf ground solver be used to simplify ground clauses?

Abstract redundancy:

C1, . . . ,Cn |= C

C1, . . . ,Cn ≺ C

Sgr |= C — ground solver

follows from smaller ?

Basic idea:

I split D ⊂ C

I check Sgr |= D

I add D to S and remove C

Global ground subsumption:

����

D ∨ C ′

D

where Sgr |= D and C ′ 6= ∅

72 / 1

Page 73: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Simplifications by SAT/SMT solver (K. IJCAR’08)

Can off-the-shelf ground solver be used to simplify ground clauses?

Abstract redundancy:

C1, . . . ,Cn |= C

C1, . . . ,Cn ≺ C

Sgr |= C — ground solver

follows from smaller ?

Basic idea:

I split D ⊂ C

I check Sgr |= D

I add D to S and remove C

Global ground subsumption:

����

D ∨ C ′

D

where Sgr |= D and C ′ 6= ∅

73 / 1

Page 74: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Simplifications by SAT/SMT solver (K. IJCAR’08)

Can off-the-shelf ground solver be used to simplify ground clauses?

Abstract redundancy:

C1, . . . ,Cn |= C

C1, . . . ,Cn ≺ C

Sgr |= C — ground solver

follows from smaller ?

Basic idea:

I split D ⊂ C

I check Sgr |= D

I add D to S and remove C

Global ground subsumption:

����

D ∨ C ′

D

where Sgr |= D and C ′ 6= ∅

74 / 1

Page 75: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Simplifications by SAT/SMT solver (K. IJCAR’08)

Can off-the-shelf ground solver be used to simplify ground clauses?

Abstract redundancy:

C1, . . . ,Cn |= C

C1, . . . ,Cn ≺ C

Sgr |= C — ground solver

follows from smaller ?

Basic idea:

I split D ⊂ C

I check Sgr |= D

I add D to S and remove C

Global ground subsumption:

����

D ∨ C ′

D

where Sgr |= D and C ′ 6= ∅

75 / 1

Page 76: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Global Ground Subsumption

Sgr

¬Q(a, b) ∨ P(a) ∨ P(b)

P(a) ∨ Q(a, b)

¬P(b)

C

P(a) ∨ Q(c , d) ∨ Q(a, c)

A minimal D ⊂ C such that Sgr |= D can be found in

a linear number of implication checks.

Global Ground Subsumption generalises:

I strict subsumption

I subsumption resolution

I . . .

76 / 1

Page 77: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Global Ground Subsumption

Sgr

¬Q(a, b) ∨ P(a) ∨ P(b)

P(a) ∨ Q(a, b)

¬P(b)

C

P(a) ∨ Q(c , d) ∨����Q(a, c)

A minimal D ⊂ C such that Sgr |= D can be found in

a linear number of implication checks.

Global Ground Subsumption generalises:

I strict subsumption

I subsumption resolution

I . . .

77 / 1

Page 78: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Global Ground Subsumption

Sgr

¬Q(a, b) ∨ P(a) ∨ P(b)

P(a) ∨ Q(a, b)

¬P(b)

C

P(a) ∨����Q(c , d) ∨����Q(a, c)

A minimal D ⊂ C such that Sgr |= D can be found in

a linear number of implication checks.

Global Ground Subsumption generalises:

I strict subsumption

I subsumption resolution

I . . .

78 / 1

Page 79: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Global Ground Subsumption

Sgr

¬Q(a, b) ∨ P(a) ∨ P(b)

P(a) ∨ Q(a, b)

¬P(b)

C

P(a) ∨����Q(c , d) ∨����Q(a, c)

A minimal D ⊂ C such that Sgr |= D can be found in

a linear number of implication checks.

Global Ground Subsumption generalises:

I strict subsumption

I subsumption resolution

I . . .79 / 1

Page 80: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground simplifications by SAT/SMT (K. IJCAR’08)

Off-the-shelf SAT solver can be used to simplify ground clauses.

Can we also use SAT solver to simplify non-ground clauses?

Yes!

The main idea:

Sgr |= ∀xC (x)

C1(x), . . . ,Cn(x) ∈ S

C1(x), . . . ,Cn(x) ≺ C (x)

Sgr |= C (d) for fresh d

C1(d), . . . ,Cn(d) |= C (d) as

in Global Subsumption

Non-Ground Global Subsumption

80 / 1

Page 81: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground simplifications by SAT/SMT (K. IJCAR’08)

Off-the-shelf SAT solver can be used to simplify ground clauses.

Can we also use SAT solver to simplify non-ground clauses? Yes!

The main idea:

Sgr |= ∀xC (x)

C1(x), . . . ,Cn(x) ∈ S

C1(x), . . . ,Cn(x) ≺ C (x)

Sgr |= C (d) for fresh d

C1(d), . . . ,Cn(d) |= C (d) as

in Global Subsumption

Non-Ground Global Subsumption

81 / 1

Page 82: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground simplifications by SAT/SMT (K. IJCAR’08)

Off-the-shelf SAT solver can be used to simplify ground clauses.

Can we also use SAT solver to simplify non-ground clauses? Yes!

The main idea:

Sgr |= ∀xC (x)

C1(x), . . . ,Cn(x) ∈ S

C1(x), . . . ,Cn(x) ≺ C (x)

Sgr |= C (d) for fresh d

C1(d), . . . ,Cn(d) |= C (d) as

in Global Subsumption

Non-Ground Global Subsumption

82 / 1

Page 83: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground simplifications by SAT/SMT (K. IJCAR’08)

Off-the-shelf SAT solver can be used to simplify ground clauses.

Can we also use SAT solver to simplify non-ground clauses? Yes!

The main idea:

Sgr |= ∀xC (x)

C1(x), . . . ,Cn(x) ∈ S

C1(x), . . . ,Cn(x) ≺ C (x)

Sgr |= C (d) for fresh d

C1(d), . . . ,Cn(d) |= C (d) as

in Global Subsumption

Non-Ground Global Subsumption

83 / 1

Page 84: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground simplifications by SAT/SMT (K. IJCAR’08)

Off-the-shelf SAT solver can be used to simplify ground clauses.

Can we also use SAT solver to simplify non-ground clauses? Yes!

The main idea:

Sgr |= ∀xC (x)

C1(x), . . . ,Cn(x) ∈ S

C1(x), . . . ,Cn(x) ≺ C (x)

Sgr |= C (d) for fresh d

C1(d), . . . ,Cn(d) |= C (d)

as

in Global Subsumption

Non-Ground Global Subsumption

84 / 1

Page 85: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-ground simplifications by SAT/SMT (K. IJCAR’08)

Off-the-shelf SAT solver can be used to simplify ground clauses.

Can we also use SAT solver to simplify non-ground clauses? Yes!

The main idea:

Sgr |= ∀xC (x)

C1(x), . . . ,Cn(x) ∈ S

C1(x), . . . ,Cn(x) ≺ C (x)

Sgr |= C (d) for fresh d

C1(d), . . . ,Cn(d) |= C (d) as

in Global Subsumption

Non-Ground Global Subsumption

85 / 1

Page 86: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-Ground Global Subsumption

S

¬P(x) ∨ Q(x)

¬Q(x) ∨ S(x , y)

P(x) ∨ S(x , y)

C

S(x , y) ∨ Q(x)

Sgr

¬P(a) ∨ Q(a)

¬Q(a) ∨ S(a, b)

P(a) ∨ S(a, b)

Cgr

Simplify first-order by purely ground reasoning!

86 / 1

Page 87: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-Ground Global Subsumption

S

¬P(x) ∨ Q(x)

¬Q(x) ∨ S(x , y)

P(x) ∨ S(x , y)

C

S(x , y) ∨ Q(x)

Sgr

¬P(a) ∨ Q(a)

¬Q(a) ∨ S(a, b)

P(a) ∨ S(a, b)

Cgr

S(a, b) ∨ Q(a)

Simplify first-order by purely ground reasoning!

87 / 1

Page 88: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-Ground Global Subsumption

S

¬P(x) ∨ Q(x)

¬Q(x) ∨ S(x , y)

P(x) ∨ S(x , y)

C

S(x , y) ∨ Q(x)

Sgr

¬P(a) ∨ Q(a)

¬Q(a) ∨ S(a, b)

P(a) ∨ S(a, b)

Cgr

S(a, b) ∨���Q(a)

Simplify first-order by purely ground reasoning!

88 / 1

Page 89: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-Ground Global Subsumption

S

¬P(x) ∨ Q(x)

¬Q(x) ∨ S(x , y)

P(x) ∨ S(x , y)

C

S(x , y) ∨���Q(x)

Sgr

¬P(a) ∨ Q(a)

¬Q(a) ∨ S(a, b)

P(a) ∨ S(a, b)

Cgr

S(a, b) ∨���Q(a)

Simplify first-order by purely ground reasoning!

89 / 1

Page 90: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Non-Ground Global Subsumption

S

¬P(x) ∨ Q(x)

((((((((¬Q(x) ∨ S(x , y)

(((((((P(x) ∨ S(x , y)

C

S(x , y) ∨���Q(x)

Sgr

¬P(a) ∨ Q(a)

(((((((¬Q(a) ∨ S(a, b)

(((((((P(a) ∨ S(a, b)

Cgr

S(a, b) ∨���Q(a)

Simplify first-order by purely ground reasoning!

90 / 1

Page 91: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen summary

Inst-Gen modular instantiation based reasoning for first-order logic.

I Inst-Gen combines efficient ground reasoning with first-order

reasoning

I sound and complete for first-order logic

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I strict subsumption, subsumption resolution

I global subsumption:

non-ground simplifications using SAT/SMT reasoning

I dismatching constraintsI preprocessing:

I predicate elimination

I sort inference: EPR and non-cyclic sorts

I semantic filter

I definition inference

91 / 1

Page 92: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Equational instantiation-based reasoning

Page 93: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Equality and Paramodulation

Superposition calculus:

C ∨ s ' t L[s ′] ∨ D

(C ∨ D ∨ L[t])θ

where (i) θ = mgu(s, s ′), (ii) s ′ is not a variable, (iii) sθσ � tθσ , (iv) . . .

The same weaknesses as resolution has:

I Inefficient in the ground/EPR case

I Length of clauses can grow fast

I Recombination of clauses

I No explicit model representation

93 / 1

Page 94: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Equality Superposition vs Inst-Gen

Superposition

C ∨ l ' r L[l ′] ∨ D

(C ∨ D ∨ L[r ])θ

θ = mgu(l , l ′)

Instantiation?

C ∨ l ' r L[l ′] ∨ D

(C ∨ l ' r)θ (L[l ′] ∨ D)θ

θ = mgu(l , l ′)

Incomplete !

94 / 1

Page 95: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Equality Superposition vs Inst-Gen

Superposition

C ∨ l ' r L[l ′] ∨ D

(C ∨ D ∨ L[r ])θ

θ = mgu(l , l ′)

Instantiation?

C ∨ l ' r L[l ′] ∨ D

(C ∨ l ' r)θ (L[l ′] ∨ D)θ

θ = mgu(l , l ′)

Incomplete !

95 / 1

Page 96: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Superposition+Instantiation

f (h(y)) ' c

∨ C1(y , u)

h(x) ' x

∨ C2(x , v)

f (a) 6' c

∨ C3(e)

f (h(a)) ' c ∨ C1(a, u)

h(a) ' a ∨ C2(a, v)

f (a) 6' c ∨ C3(e)

This set is inconsistent but the contradiction is not deducible by the inference

system above.

The idea is to consider proofs generated by unit superposition:

h(x) ' x f (h(y)) ' c

f (x) ' c

[x/y ]

f (a) 6' c

c 6' c

[a/x ]

Propagating substitutions: {h(a) ' a; f (h(a)) ' c ; f (a) 6' c}ground unsatisfiable.

96 / 1

Page 97: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Superposition+Instantiation

f (h(y)) ' c

∨ C1(y , u)

h(x) ' x

∨ C2(x , v)

f (a) 6' c

∨ C3(e)

f (h(a)) ' c ∨ C1(a, u)

h(a) ' a ∨ C2(a, v)

f (a) 6' c ∨ C3(e)

This set is inconsistent but the contradiction is not deducible by the inference

system above.

The idea is to consider proofs generated by unit superposition:

h(x) ' x f (h(y)) ' c

f (x) ' c

[x/y ]

f (a) 6' c

c 6' c

[a/x ]

Propagating substitutions: {h(a) ' a; f (h(a)) ' c ; f (a) 6' c}ground unsatisfiable.

97 / 1

Page 98: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Superposition+Instantiation

f (h(y)) ' c

∨ C1(y , u)

h(x) ' x

∨ C2(x , v)

f (a) 6' c

∨ C3(e)

f (h(a)) ' c ∨ C1(a, u)

h(a) ' a ∨ C2(a, v)

f (a) 6' c ∨ C3(e)

This set is inconsistent but the contradiction is not deducible by the inference

system above.

The idea is to consider proofs generated by unit superposition:

h(x) ' x f (h(y)) ' c

f (x) ' c[x/y ]

f (a) 6' c

c 6' c[a/x ]

Propagating substitutions: {h(a) ' a; f (h(a)) ' c ; f (a) 6' c}ground unsatisfiable.

98 / 1

Page 99: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Superposition+Instantiation

f (h(y)) ' c

∨ C1(y , u)

h(x) ' x

∨ C2(x , v)

f (a) 6' c

∨ C3(e)

f (h(a)) ' c ∨ C1(a, u)

h(a) ' a ∨ C2(a, v)

f (a) 6' c ∨ C3(e)

This set is inconsistent but the contradiction is not deducible by the inference

system above.

The idea is to consider proofs generated by unit superposition:

h(x) ' x f (h(y)) ' c

f (x) ' c[x/y ]

f (a) 6' c

c 6' c[a/x ]

Propagating substitutions: {h(a) ' a; f (h(a)) ' c ; f (a) 6' c}ground unsatisfiable.

99 / 1

Page 100: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Superposition+Instantiation

f (h(y)) ' c ∨ C1(y , u)

h(x) ' x ∨ C2(x , v)

f (a) 6' c ∨ C3(e)

f (h(a)) ' c ∨ C1(a, u)

h(a) ' a ∨ C2(a, v)

f (a) 6' c ∨ C3(e)

This set is inconsistent but the contradiction is not deducible by the inference

system above.

The idea is to consider proofs generated by unit superposition:

h(x) ' x f (h(y)) ' c

f (x) ' c[x/y ]

f (a) 6' c

c 6' c[a/x ]

Propagating substitutions: {h(a) ' a; f (h(a)) ' c ; f (a) 6' c}ground unsatisfiable.

100 / 1

Page 101: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Superposition+Instantiation

f (h(y)) ' c ∨ C1(y , u)

h(x) ' x ∨ C2(x , v)

f (a) 6' c ∨ C3(e)

f (h(a)) ' c ∨ C1(a, u)

h(a) ' a ∨ C2(a, v)

f (a) 6' c ∨ C3(e)

This set is inconsistent but the contradiction is not deducible by the inference

system above.

The idea is to consider proofs generated by unit superposition:

h(x) ' x f (h(y)) ' c

f (x) ' c[x/y ]

f (a) 6' c

c 6' c[a/x ]

Propagating substitutions: {h(a) ' a; f (h(a)) ' c ; f (a) 6' c}ground unsatisfiable.

101 / 1

Page 102: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq instantiation-based equational reasoning

f.-o. clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |= L⊥

S⊥ SAT

I⊥ |= S⊥

Inst. gen.

from UP proofs

L ` �

S

satisfiable

L 6` �

Theorem. Inst-Gen-Eq is sound and complete.

102 / 1

Page 103: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq instantiation-based equational reasoning

f.-o. clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥

theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |= L⊥

S⊥ SAT

I⊥ |= S⊥

Inst. gen.

from UP proofs

L ` �

S

satisfiable

L 6` �

Theorem. Inst-Gen-Eq is sound and complete.

103 / 1

Page 104: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq instantiation-based equational reasoning

f.-o. clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |= L⊥

S⊥ SAT

I⊥ |= S⊥

Inst. gen.

from UP proofs

L ` �

S

satisfiable

L 6` �

Theorem. Inst-Gen-Eq is sound and complete.

104 / 1

Page 105: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq instantiation-based equational reasoning

f.-o. clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |= L⊥

S⊥ SAT

I⊥ |= S⊥

Inst. gen.

from UP proofs

L ` �

S

satisfiable

L 6` �

Theorem. Inst-Gen-Eq is sound and complete.

105 / 1

Page 106: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq instantiation-based equational reasoning

f.-o. clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |= L⊥

S⊥ SAT

I⊥ |= S⊥

Inst. gen.

from UP proofs

L ` �

S

satisfiable

L 6` �

Theorem. Inst-Gen-Eq is sound and complete.

106 / 1

Page 107: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq instantiation-based equational reasoning

f.-o. clauses

S

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |= L⊥

S⊥ SAT

I⊥ |= S⊥

Inst. gen.

from UP proofs

L ` �

S

satisfiable

L 6` �

Theorem. Inst-Gen-Eq is sound and complete. 107 / 1

Page 108: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen-Eq: Key properties

Inst-Gen-Eq:

I combines SMT for ground reasoning and superposition-based unit

reasoning

I sound and complete for first-order logic with equality

I unit superposition does not have weaknesses of the general

superposition

I all redundancy elimination techniques from Inst-Gen are applicable

to Inst-Gen-Eq

I redundancy elimination become more powerful: now we can use

SMT to simplify first-order rather than SAT

108 / 1

Page 109: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

Page 110: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

f.-o. clauses S

theory T

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |=T L⊥

S⊥ SAT

I⊥ |=T S⊥

L1 ∨ C1, . . . , Ln ∨ Cn

(L1 ∨ C1)θ, . . . , (Ln ∨ Cn)θ

L1θ⊥ ∧ . . . ∧ Lnθ⊥ |=T 0

L `T �

S

satisfiable

L 6`T �

110 / 1

Page 111: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

f.-o. clauses S

theory T

Ground Clauses

S⊥

⊥ : x → ⊥

theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |=T L⊥

S⊥ SAT

I⊥ |=T S⊥

L1 ∨ C1, . . . , Ln ∨ Cn

(L1 ∨ C1)θ, . . . , (Ln ∨ Cn)θ

L1θ⊥ ∧ . . . ∧ Lnθ⊥ |=T 0

L `T �

S

satisfiable

L 6`T �

111 / 1

Page 112: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

f.-o. clauses S

theory T

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |=T L⊥

S⊥ SAT

I⊥ |=T S⊥

L1 ∨ C1, . . . , Ln ∨ Cn

(L1 ∨ C1)θ, . . . , (Ln ∨ Cn)θ

L1θ⊥ ∧ . . . ∧ Lnθ⊥ |=T 0

L `T �

S

satisfiable

L 6`T �

112 / 1

Page 113: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

f.-o. clauses S

theory T

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |=T L⊥

S⊥ SAT

I⊥ |=T S⊥

L1 ∨ C1, . . . , Ln ∨ Cn

(L1 ∨ C1)θ, . . . , (Ln ∨ Cn)θ

L1θ⊥ ∧ . . . ∧ Lnθ⊥ |=T 0

L `T �

S

satisfiable

L 6`T �

113 / 1

Page 114: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

f.-o. clauses S

theory T

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |=T L⊥

S⊥ SAT

I⊥ |=T S⊥

L1 ∨ C1, . . . , Ln ∨ Cn

(L1 ∨ C1)θ, . . . , (Ln ∨ Cn)θ

L1θ⊥ ∧ . . . ∧ Lnθ⊥ |=T 0

L `T �

S

satisfiable

L 6`T �

114 / 1

Page 115: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Theory instantiation

f.-o. clauses S

theory T

Ground Clauses

S⊥

⊥ : x → ⊥ theorem

proved

S⊥ UnSAT

Semantic selection

of literals I⊥ |=T L⊥

S⊥ SAT

I⊥ |=T S⊥

L1 ∨ C1, . . . , Ln ∨ Cn

(L1 ∨ C1)θ, . . . , (Ln ∨ Cn)θ

L1θ⊥ ∧ . . . ∧ Lnθ⊥ |=T 0

L `T �

S

satisfiable

L 6`T �

115 / 1

Page 116: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Implementation

Page 117: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

iProver general features

iProver an instantiation-based theorem prover for FOL based on Inst-Gen.

I Proof search guided by SAT solver

I Redundancy elimination global subsumption, dismatching

constraints, predicate elimination, semantic filtering, splitting. . .

I Indexing techniques for inferences and simplifications

I Sort inference, non-cyclic sorts

I Combination with resolution

I Finite model finding based on EPR/sort inference/non-cyclic sorts

I Bounded model checking and k-induction

I QBF and bit-vectors

I Planning

I Query answering

I Proof representation: non-trivial due to global solver simplifications

I Model representation: using definitional extensions117 / 1

Page 118: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Inst-Gen Loop

Passive (Queues) Given Clausesimpl. II

SAT

passiveempty

Active (Unif. Index)

literal selection change

Instantiation Inferences

Unprocessedsimpl. I

Input

SAT Solver

grounding

Unsatisfiableunsat

sat, propositional model

literal selection

118 / 1

Page 119: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CASC 2018

EPR:

iProver Vampire E LEO-III

prob solved 133 128 27 17

First-order SAT:

Vampire iProver CVC4 E

prob solved 191 137 116 38

119 / 1

Page 120: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Applications and the EPR fragment

Page 121: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Effectively Propositional Logic (EPR)

EPR: ∃∗∀∗ fragment of first-order logic

EPR after Skolemization: No functions except constants

P(x , y , d) ∨ ¬Q(c , y , x)

Transitivity: ¬P(x , y) ∨ ¬P(y , z) ∨ P(x , z)

Symmetry: P(x , y) ∨ ¬P(y , x)

Verification:

∀A(wrenh1 ∧ A = wraddrFunc→∀B(range[35,0](B)→ (imem′(A,B)↔ iwrite(B)))).

Applications:

I Hardware verification: bounded model checking/bit-vectors

I Program verification: linked data structures (Sagiv)

I Planning/Scheduling

I Knowledge representation

I Finite model finding

EPR is hard for resolution, but decidable by instantiation methods.

121 / 1

Page 122: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Effectively Propositional Logic (EPR)

EPR: ∃∗∀∗ fragment of first-order logic

EPR after Skolemization: No functions except constants

P(x , y , d) ∨ ¬Q(c , y , x)

Transitivity: ¬P(x , y) ∨ ¬P(y , z) ∨ P(x , z)

Symmetry: P(x , y) ∨ ¬P(y , x)

Verification:

∀A(wrenh1 ∧ A = wraddrFunc→∀B(range[35,0](B)→ (imem′(A,B)↔ iwrite(B)))).

Applications:

I Hardware verification: bounded model checking/bit-vectors

I Program verification: linked data structures (Sagiv)

I Planning/Scheduling

I Knowledge representation

I Finite model finding

EPR is hard for resolution, but decidable by instantiation methods.122 / 1

Page 123: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Hardware verification

Functional Equivalence Checking

I The same functional behaviour can be implemented in different ways

I Optimised for:

I Timing – better performance

I Power – longer battery life

I Area – smaller chips

I Verification: optimisations do not change functional behaviour

Method of choice: Bounded Model Checking (BMC)

Biere, Cimatti, Clarke, Zhu (TACAS’99)123 / 1

Page 124: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

SAT-based bounded model checking

c

a

b

g

d

Symbolic representation:

I = (a0 ↔ ¬c0) ∧ (c0 → b0)

(g0 ↔ a0 ∧ b0) ∧ (d0 ↔ ¬g0 ∧ ¬c0)

T =

a′ ↔ a ∧b′ ↔ b ∧g ′ ↔ a′ ∧ b′ ∧c ′ ↔ d ∧d ′ ↔ ¬c ′ ∧ ¬g ′

P = (d ↔ ¬g)

124 / 1

Page 125: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

SAT-based bounded model checking (unrolling)

I0 . . .

a0

b0

c0

g0

d0

a1

b1

c1

g1

d1

ak

bk

ck

gk

dk ¬Pk

The system is unsafe if and only if

I0 ∧ T<1,2> ∧ . . . ∧ T<k−1,k> ∧ ¬Pk

is satisfiable for some k.

A. Biere, A. Cimatti, E. Clarke, Y. Zhu (TACAS’99)

125 / 1

Page 126: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

EPR-based BMC

EPR encoding:

I EPR formulas Finit(S),Ftarget(S),Fnext(S ,S′)

I encoding predicates init(S), target(S), next(S ,S ′)

Transition system:

∀S [init(S)→ Finit(S)] (1)

∀S ,S ′ [next(S ,S ′)→ Fnext(S ,S′)] (2)

∀S [target(S)↔ Ftarget(S)] (3)

BMC: init(s0) ∧ next(s0, s1) ∧ . . . ∧ next(sn−1, sn) ∧ ¬target(sn)

I EPR encoding provides succinct representation

I avoids copying transition relation

I reasoning can be done at higher level

I major challenge: hardware designs are very large and complex

126 / 1

Page 127: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

EPR-based BMC

EPR encoding:

I EPR formulas Finit(S),Ftarget(S),Fnext(S ,S′)

I encoding predicates init(S), target(S), next(S ,S ′)

Transition system:

∀S [init(S)→ Finit(S)] (1)

∀S ,S ′ [next(S ,S ′)→ Fnext(S ,S′)] (2)

∀S [target(S)↔ Ftarget(S)] (3)

BMC: init(s0) ∧ next(s0, s1) ∧ . . . ∧ next(sn−1, sn) ∧ ¬target(sn)

I EPR encoding provides succinct representation

I avoids copying transition relation

I reasoning can be done at higher level

I major challenge: hardware designs are very large and complex127 / 1

Page 128: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Word level

==wraddr[5:0]

rdaddr[5:0]

cacheline[63:0]

memory

mux

wrdata[63:0]

circuit

rden

wrenclock

sel

outp[63:0]

rddata[63:0]

∀S, S’(next(S, S’)→ // write is enabled

∀y(Assocwraddr(S’, y)→∀A(clock(S’) ∧ wren(S’) ∧ A = y →∀B(range[0,63](B)→ (mem(S’, A, B)↔ wrdata(S, B)))))).

BMC with memories and bit-vectors

first-order predicates: mem(S, A, B), wrdata(S, B).

M. Emmer, Z. Khasidashvili, K. Korovin, C. Sticksel, A. Voronkov IJCAR’12

128 / 1

Page 129: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!

129 / 1

Page 130: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x) ¬bv2(x) ∨ mem(x , y)

bv1(x) ∨ mem(x , y)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!

130 / 1

Page 131: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x) ¬bv2(x) ∨ mem(x , y)

bv1(x) ∨ mem(x , y)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!

131 / 1

Page 132: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x) ((((

(((((

¬bv2(x) ∨ mem(x , y)

((((((((bv1(x) ∨ mem(x , y) mem(x , y)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!

132 / 1

Page 133: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x) ((((

(((((

¬bv2(x) ∨ mem(x , y)

((((((((bv1(x) ∨ mem(x , y) mem(x , y)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!

133 / 1

Page 134: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x) ((((

(((((

¬bv2(x) ∨ mem(x , y)

((((((((bv1(x) ∨ mem(x , y) mem(x , y)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!

134 / 1

Page 135: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Properties of EPR

Direct reduction to SAT — exponential blow-up.

Satisfiability for EPR is NEXPTIME-complete.

More succinct but harder to solve.... Any gain?

Yes: Reasoning can be done at a more general level.

Restricting instances:

¬mem(a1, x1) ∨ ¬mem(a2, x2) ∨ . . .¬mem(an, xn)

mem(b1, x1) ∨ mem(b2, x2) ∨ . . . ∨ mem(bn, xn)

General lemmas:¬bv1(x) ∨ bv2(x) ((((

(((((

¬bv2(x) ∨ mem(x , y)

((((((((bv1(x) ∨ mem(x , y) mem(x , y)

Quantified invariants:

∀s∀x [cond(s, x)→ prop(s, x)]

Using more expressive logics can speed up reasoning!135 / 1

Page 136: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Experiments: iProver vs Intel BMC

Problem # Memories # Transient BVs Intel BMC iProver BMC

ROB2 2 (4704 bits) 255 (3479 bits) 50 8

DCC2 4 (8960 bits) 426 (1844 bits) 8 11

DCC1 4 (8960 bits) 1827 (5294 bits) 7 8

DCI1 32 (9216 bits) 3625 (6496 bits) 6 4

BPB2 4 (10240 bits) 550 (4955 bits) 50 11

SCD2 2 (16384 bits) 80 (756 bits) 4 14

SCD1 2 (16384 bits) 556 (1923 bits) 4 12

PMS1 8 (46080 bits) 1486 (6109 bits) 2 10

Large memories:

iProver performs well compared to highly optimised Intel SAT-based

model checker.

136 / 1

Page 137: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

From bounded to unbounded model checking

EPR-based k-induction

Page 138: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

EPR-based k-induction

Base case:

init(s0) ∧ target(s0) ∧ next(s0, s1) ∧ . . . ∧ next(sk−1, sk) ∧ ¬target(sk)

Bad states are not reachable in ≤ k steps.

Induction case:

target(s0)∧ next(s0, s1)∧ . . .∧ target(sk)∧ next(sn, sk+1)∧¬target(sk+1)

Assume that bad states are not reachable in ≤ k steps then bad states

are not reachable in k + 1 steps.

Visited states are non-equivalent

∀S ,S ′ (S 6≡p S ′ → ∃x [p(S , x)↔ ¬p(S ′, x)])

∀S ,S ′ (S 6≡Σ S ′ →∨

p∈Σ S 6≡p S ′)∧0≤i≤j≤k si 6≡Σ sj

Z. Khasidashvili, K. Korovin, D. Tsarkov (EPR k-induction)

138 / 1

Page 139: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

EPR-based k-induction

Base case:

init(s0) ∧ target(s0) ∧ next(s0, s1) ∧ . . . ∧ next(sk−1, sk) ∧ ¬target(sk)

Bad states are not reachable in ≤ k steps.

Induction case:

target(s0)∧ next(s0, s1)∧ . . .∧ target(sk)∧ next(sn, sk+1)∧¬target(sk+1)

Assume that bad states are not reachable in ≤ k steps then bad states

are not reachable in k + 1 steps.

Visited states are non-equivalent

∀S ,S ′ (S 6≡p S ′ → ∃x [p(S , x)↔ ¬p(S ′, x)])

∀S ,S ′ (S 6≡Σ S ′ →∨

p∈Σ S 6≡p S ′)∧0≤i≤j≤k si 6≡Σ sj

Z. Khasidashvili, K. Korovin, D. Tsarkov (EPR k-induction)139 / 1

Page 140: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

QBF to EPR

Page 141: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

QBF to EPR

QBF:

∀x1∃y1∀x2∃y2 [x1 ∨ y1 ∨ ¬y2 ∧ . . .]

First-order: Domain: {1, 0}; p(1); ¬p(0)

∀x1∃y1∀x2∃y2 [p(x1) ∨ p(y1) ∨ ¬p(y2) ∧ . . .]

Skolemize:

∀x1∀x2 [p(x1) ∨ p(sk1(x1)) ∨ ¬p(sk2(x1, x2)) ∧ . . .]

EPR: Replace Skolem functions with predicates:

∀x1∀x2 [p(x1) ∨ psk1 (x1) ∨ ¬psk2 (x1, x2) ∧ . . .]

M. Seidl, F. Lonsing, A. Biere (PAAR’12)141 / 1

Page 142: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

BV with log-encoded width to EPR

142 / 1

Page 143: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

BV with log-encoded width to EPR

01. . .0. . .1

0652n

Encode bit indexes in binary using n bits:

E.g. ¬bv(0, . . . , 0, 1, 0, 0, 0, 0, 1︸ ︷︷ ︸n

) represents value 0 at index 65.

Succinct encodings of bit-vector operations avoiding bit-blasting:

bv and , bv or , bv shl , bv shr , bv mult, bv add , . . ..

G. Kovasznai, A. Frohlich, and A. Biere (CADE’13)

143 / 1

Page 144: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

What’s next ?

Abstraction refinement reasoning

Page 145: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Large theories in TPTP

TPTP large theories benchmarks:

I Mizar – formalising mathematics

I Isabelle, HOL 4, HOL Light

translation of higher order problems from different domains into FOL

I CakeML – verification

I Cyc/SUMO – large first-order ontologies

Many of these benchmarks contain hundreds of thousand of axioms.

Observation: large number of axioms is only one indication of complexity.

145 / 1

Page 146: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Large theories in TPTP

TPTP large theories benchmarks:

I Mizar – formalising mathematics

I Isabelle, HOL 4, HOL Light

translation of higher order problems from different domains into FOL

I CakeML – verification

I Cyc/SUMO – large first-order ontologies

Many of these benchmarks contain hundreds of thousand of axioms.

Observation: large number of axioms is only one indication of complexity.

146 / 1

Page 147: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Large theories in TPTP

TPTP large theories benchmarks:

I Mizar – formalising mathematics

I Isabelle, HOL 4, HOL Light

translation of higher order problems from different domains into FOL

I CakeML – verification

I Cyc/SUMO – large first-order ontologies

Many of these benchmarks contain hundreds of thousand of axioms.

Observation: large number of axioms is only one indication of complexity.

147 / 1

Page 148: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

QBF benchmarks

148 / 1

Page 149: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

HOL benchmarks

149 / 1

Page 150: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Reasoning with large theories: axiom selection

Previous approaches: select “relevant axioms”

I Semantic or syntactic structure

I SRASS

I SInE

I Machine learning

I MaLARea

I Two phases

I Axiom selection

I Reasoning

Axiom selection phase

Selected axioms

Reasoning phase

Observation: large number of axioms is only one source of complexity.

We also have: large number of arguments; large signatures; long/deep

clauses; etc.

150 / 1

Page 151: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Reasoning with large theories: axiom selection

Previous approaches: select “relevant axioms”

I Semantic or syntactic structure

I SRASS

I SInE

I Machine learning

I MaLARea

I Two phases

I Axiom selection

I Reasoning

Axiom selection phase

Selected axioms

Reasoning phase

Observation: large number of axioms is only one source of complexity.

We also have: large number of arguments; large signatures; long/deep

clauses; etc.

151 / 1

Page 152: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Abstraction-refinement approach L. Hernandez, K. IJCAR’18

I Abstraction-Refinement

I Interleaving abstraction and

reasoning phases

I Over-Approximation

I Under-Approximation

I Combination of approximations

I The abstraction is easier

to solve

I If there is no solution, the

abstraction is refined

I If A |= ⊥ then α(A) |= ⊥

I If α(A) |= ⊥ then A |= ⊥

I Converge rapidly to a

solution if it exists

152 / 1

Page 153: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Abstraction-refinement approach L. Hernandez, K. IJCAR’18

I Abstraction-Refinement

I Interleaving abstraction and

reasoning phases

I Over-Approximation

I Under-Approximation

I Combination of approximations

I The abstraction is easier

to solve

I If there is no solution, the

abstraction is refined

I If A |= ⊥ then α(A) |= ⊥

I If α(A) |= ⊥ then A |= ⊥

I Converge rapidly to a

solution if it exists

153 / 1

Page 154: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Abstraction-refinement approach L. Hernandez, K. IJCAR’18

I Abstraction-Refinement

I Interleaving abstraction and

reasoning phases

I Over-Approximation

I Under-Approximation

I Combination of approximations

I The abstraction is easier

to solve

I If there is no solution, the

abstraction is refined

I If A |= ⊥ then α(A) |= ⊥

I If α(A) |= ⊥ then A |= ⊥

I Converge rapidly to a

solution if it exists

154 / 1

Page 155: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Abstraction-refinement approach L. Hernandez, K. IJCAR’18

I Abstraction-Refinement

I Interleaving abstraction and

reasoning phases

I Over-Approximation

I Under-Approximation

I Combination of approximations

I The abstraction is easier

to solve

I If there is no solution, the

abstraction is refined

I If A |= ⊥ then α(A) |= ⊥

I If α(A) |= ⊥ then A |= ⊥

I Converge rapidly to a

solution if it exists

155 / 1

Page 156: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Abstraction-Refinement in ATPs

I . . .

I Inst-Gen: Ganzinger, Korovin

I SPASS: targeted decidable fragment Teucke, Weidenbach

I Speculative inferences: Bonacina, Lynch, de Moura

I SMT: conflict and model-based instantiation

de Moura, Ge; Reynolds, Tinelli . . .

I AVATAR: new architecture for first-order theorem provers

Voronkov; Reger, Suda, . . .

156 / 1

Page 157: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Over-Approximating Abstractions

Over-approximation abstractions:

I Subsumption abstraction

I Generalisation abstraction

I Argument filtering abstraction

I Signature grouping abstraction

157 / 1

Page 158: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Over-Approximation Procedure

Concrete

axioms Aαs(A)

Abstract

axioms AsATPC Disproved

Conjecture C

Get Asuc

Retrieve concrete

axioms, γs(Asuc )

Refine abstrac-

tion α′s(A)

ATPS Proved

UNSAT

SAT

UNSATSAT

Subsumption-Based Abstraction

I Partition based on joint literals.

I Abstract clauses represent each partition and

subsume all clauses in the collection.`1 ∨`2 ∨ `3

`1`1 ∨`3 ∨ `4

`1 ∨`6 ∨ `4

`2 ∨`7 ∨ `6

}`2

`2 ∨`8 ∨ `5

Subsumption-Based refinement

I Subpartition of the previous

collections based on a new joint

literal.

`1

`1 ∨`2∨ `3

}`1 ∨ `3

`1 ∨ `3 ∨`4

`1 ∨`6∨ `4

}`1 ∨ `4

Argument Filtering Abstraction

I Removing certain arguments in the signature

symbols.

P(x, f (x, g(y))) ∨ ¬P(c, x)

P 0 ∨ ¬P 0

¬P(g(f (x, y)), g(y)) ¬P 0

P(c, x) P 0

Argument Filtering refinement

I Restoring arguments of abstract

symbols.

P 0 ∨ ¬P 0

P(x, f 0) ∨ ¬P(c, x)

¬P 0 ¬P(g 0, g 0)

P 0 P(c, x)

Signature Grouping Abstraction

I Abstraction of the signature by grouping symbols

of the same type.

R(x,y) ∨ Q(x)

¬ S(c,c) ∨ Q(y) T1(x, y) ∨ T2(x)

¬R(c,c) ∨ P(y) ¬T1(c, c) ∨ T2(y)

¬Q(c) ¬T2(c)

¬P(c)

Signature grouping refinement

I Concretising abstract symbols.

T1(x, y) ∨T2(x)

R(x, y) ∨T2(x)

¬ T1(c, c) ∨T2(y) ¬ S(c, c) ∨T2(y)

¬T2(c) ¬ R(c, c) ∨T2(y)

¬T2(c)

158 / 1

Page 159: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Over-Approximation Procedure

Concrete

axioms Aαs(A)

Abstract

axioms AsATPC Disproved

Conjecture C

Get Asuc

Retrieve concrete

axioms, γs(Asuc )

Refine abstrac-

tion α′s(A)

ATPS Proved

UNSAT

SAT

UNSATSAT

Subsumption-Based Abstraction

I Partition based on joint literals.

I Abstract clauses represent each partition and

subsume all clauses in the collection.`1 ∨`2 ∨ `3

`1`1 ∨`3 ∨ `4

`1 ∨`6 ∨ `4

`2 ∨`7 ∨ `6

}`2

`2 ∨`8 ∨ `5

Subsumption-Based refinement

I Subpartition of the previous

collections based on a new joint

literal.

`1

`1 ∨`2∨ `3

}`1 ∨ `3

`1 ∨ `3 ∨`4

`1 ∨`6∨ `4

}`1 ∨ `4

Argument Filtering Abstraction

I Removing certain arguments in the signature

symbols.

P(x, f (x, g(y))) ∨ ¬P(c, x)

P 0 ∨ ¬P 0

¬P(g(f (x, y)), g(y)) ¬P 0

P(c, x) P 0

Argument Filtering refinement

I Restoring arguments of abstract

symbols.

P 0 ∨ ¬P 0

P(x, f 0) ∨ ¬P(c, x)

¬P 0 ¬P(g 0, g 0)

P 0 P(c, x)

Signature Grouping Abstraction

I Abstraction of the signature by grouping symbols

of the same type.

R(x,y) ∨ Q(x)

¬ S(c,c) ∨ Q(y) T1(x, y) ∨ T2(x)

¬R(c,c) ∨ P(y) ¬T1(c, c) ∨ T2(y)

¬Q(c) ¬T2(c)

¬P(c)

Signature grouping refinement

I Concretising abstract symbols.

T1(x, y) ∨T2(x)

R(x, y) ∨T2(x)

¬ T1(c, c) ∨T2(y) ¬ S(c, c) ∨T2(y)

¬T2(c) ¬ R(c, c) ∨T2(y)

¬T2(c)

159 / 1

Page 160: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Over-Approximation Procedure

Concrete

axioms Aαs(A)

Abstract

axioms AsATPC Disproved

Conjecture C

Get Asuc

Retrieve concrete

axioms, γs(Asuc )

Refine abstrac-

tion α′s(A)

ATPS Proved

UNSAT

SAT

UNSATSAT

Subsumption-Based Abstraction

I Partition based on joint literals.

I Abstract clauses represent each partition and

subsume all clauses in the collection.`1 ∨`2 ∨ `3

`1`1 ∨`3 ∨ `4

`1 ∨`6 ∨ `4

`2 ∨`7 ∨ `6

}`2

`2 ∨`8 ∨ `5

Subsumption-Based refinement

I Subpartition of the previous

collections based on a new joint

literal.

`1

`1 ∨`2∨ `3

}`1 ∨ `3

`1 ∨ `3 ∨`4

`1 ∨`6∨ `4

}`1 ∨ `4

Argument Filtering Abstraction

I Removing certain arguments in the signature

symbols.

P(x, f (x, g(y))) ∨ ¬P(c, x)

P 0 ∨ ¬P 0

¬P(g(f (x, y)), g(y)) ¬P 0

P(c, x) P 0

Argument Filtering refinement

I Restoring arguments of abstract

symbols.

P 0 ∨ ¬P 0

P(x, f 0) ∨ ¬P(c, x)

¬P 0 ¬P(g 0, g 0)

P 0 P(c, x)

Signature Grouping Abstraction

I Abstraction of the signature by grouping symbols

of the same type.

R(x,y) ∨ Q(x)

¬ S(c,c) ∨ Q(y) T1(x, y) ∨ T2(x)

¬R(c,c) ∨ P(y) ¬T1(c, c) ∨ T2(y)

¬Q(c) ¬T2(c)

¬P(c)

Signature grouping refinement

I Concretising abstract symbols.

T1(x, y) ∨T2(x)

R(x, y) ∨T2(x)

¬ T1(c, c) ∨T2(y) ¬ S(c, c) ∨T2(y)

¬T2(c) ¬ R(c, c) ∨T2(y)

¬T2(c)

160 / 1

Page 161: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Over-Approximation Procedure

Concrete

axioms Aαs(A)

Abstract

axioms AsATPC Disproved

Conjecture C

Get Asuc

Retrieve concrete

axioms, γs(Asuc )

Refine abstrac-

tion α′s(A)

ATPS Proved

UNSAT

SAT

UNSATSAT

Subsumption-Based Abstraction

I Partition based on joint literals.

I Abstract clauses represent each partition and

subsume all clauses in the collection.`1 ∨`2 ∨ `3

`1`1 ∨`3 ∨ `4

`1 ∨`6 ∨ `4

`2 ∨`7 ∨ `6

}`2

`2 ∨`8 ∨ `5

Subsumption-Based refinement

I Subpartition of the previous

collections based on a new joint

literal.

`1

`1 ∨`2∨ `3

}`1 ∨ `3

`1 ∨ `3 ∨`4

`1 ∨`6∨ `4

}`1 ∨ `4

Argument Filtering Abstraction

I Removing certain arguments in the signature

symbols.

P(x, f (x, g(y))) ∨ ¬P(c, x)

P 0 ∨ ¬P 0

¬P(g(f (x, y)), g(y)) ¬P 0

P(c, x) P 0

Argument Filtering refinement

I Restoring arguments of abstract

symbols.

P 0 ∨ ¬P 0

P(x, f 0) ∨ ¬P(c, x)

¬P 0 ¬P(g 0, g 0)

P 0 P(c, x)

Signature Grouping Abstraction

I Abstraction of the signature by grouping symbols

of the same type.

R(x,y) ∨ Q(x)

¬ S(c,c) ∨ Q(y) T1(x, y) ∨ T2(x)

¬R(c,c) ∨ P(y) ¬T1(c, c) ∨ T2(y)

¬Q(c) ¬T2(c)

¬P(c)

Signature grouping refinement

I Concretising abstract symbols.

T1(x, y) ∨T2(x)

R(x, y) ∨T2(x)

¬ T1(c, c) ∨T2(y) ¬ S(c, c) ∨T2(y)

¬T2(c) ¬ R(c, c) ∨T2(y)

¬T2(c)

161 / 1

Page 162: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Generalisation abstraction

I Strengthening abstraction function αs.

I Partition axioms A = ∪iAi ; abstract axiom: αs(Ai ) |= Ai

¬Q(x , a)

Negated conjecture

S(f (x))

S(h(x , y)) Q(z , x) ∨ R(x) ∨ P(x , z)

Q(f (x), a) ∨ R(g(x))

¬P(x , h(y , a)) ∨ R(y)

¬P(f (x), g(z)) ∨ R(h(a, z))¬R(f (y))

¬R(h(f (x), g(y)))

Q(x0, x1) ∨ R(x2)S(x0)

¬P(x0, x1) ∨ R(x2)

¬R(x0)

⊃⊂

S(x0) Q(x0, x1) ∨ R(x2)

¬P(x0, x1) ∨ R(x2)¬R(x0)

162 / 1

Page 163: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Generalisation abstraction

I Strengthening abstraction function αs.

I Partition axioms A = ∪iAi ; abstract axiom: αs(Ai ) |= Ai

¬Q(x , a)

Negated conjecture

S(f (x))

S(h(x , y)) Q(z , x) ∨ R(x) ∨ P(x , z)

Q(f (x), a) ∨ R(g(x))

¬P(x , h(y , a)) ∨ R(y)

¬P(f (x), g(z)) ∨ R(h(a, z))¬R(f (y))

¬R(h(f (x), g(y)))

Q(x0, x1) ∨ R(x2)S(x0)

¬P(x0, x1) ∨ R(x2)

¬R(x0)

⊃⊂

S(x0) Q(x0, x1) ∨ R(x2)

¬P(x0, x1) ∨ R(x2)¬R(x0)

163 / 1

Page 164: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Generalisation abstraction

I Strengthening abstraction function αs.

I Partition axioms A = ∪iAi ; abstract axiom: αs(Ai ) |= Ai

¬Q(x , a)

Negated conjecture

S(f (x))

S(h(x , y)) Q(z , x) ∨ R(x) ∨ P(x , z)

Q(f (x), a) ∨ R(g(x))

¬P(x , h(y , a)) ∨ R(y)

¬P(f (x), g(z)) ∨ R(h(a, z))¬R(f (y))

¬R(h(f (x), g(y)))

Q(x0, x1) ∨ R(x2)S(x0)

¬P(x0, x1) ∨ R(x2)

¬R(x0)

⊃⊂

S(x0) Q(x0, x1) ∨ R(x2)

¬P(x0, x1) ∨ R(x2)¬R(x0)

164 / 1

Page 165: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Generalisation abstraction refinement

I Weakening abstraction refinement.

I Sub-partition groups of concrete axioms involved in an abstract

proof.

¬Q(x , a)

Negated conjecture

S(x0)

¬P(x0, x1) ∨ R(x2)

Q(z , x) ∨ R(x) ∨ P(x , z)

Q(x0, x1) ∨ R(g(x))

¬R(f (y))

¬R(h(f (x), g(y)))

165 / 1

Page 166: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Generalisation abstraction for termination

Consider the following set of clauses:

S = { p(g(x), g(x)) ∨ q(f (g(x)))

g(f (f (x))) ' g(f (x))}

A generalisation abstraction of S :

α(S) = { p(x , x) ∨ q(f (x))

g(f (x)) ' g(x)}

Superposition is not applicable after subsumption abstraction and

therefore S is satisfiable.

166 / 1

Page 167: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Over-approximation

Over-approximation abstractions:

I Subsumption abstraction

I Generalisation abstraction

I Argument filtering abstraction

I Signature grouping abstraction

Combinations of these abstractions

I --abstr ref [sig;subs;arg filter]

I abstractions can enable further abstractions: e.g, argument filtering

can enable signature grouping which can enable subsumption

Targeted abstractions:

I abstractions can target fragments e.g., EPR

I block superposition inferences

167 / 1

Page 168: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Under-Approximation

I Weakening abstraction function.

I Removing irrelevant axioms using methods like SInE or MaLARea.

I Using ground instances of concrete axioms.

I Strengthening abstraction refinement.

I Turning a model I into a countermodel.

I Add concrete axioms

I Generate and add ground instances of axioms

168 / 1

Page 169: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Under-Approximation

Concrete

axioms Aαw (A)

Abstract

axioms AwATPS Proved

Conjecture C

I |=Aw ∧ ¬C

Refine abstraction Aw

find a set A, I 6|= A

Aw := Aw ∪ A

Disproved

UNSAT

SAT

A = ∅

A 6= ∅

Weakening Abstraction Function

I Using ground instances of concrete

axioms (instantiation abstraction).

I Removing irrelevant axioms (deletion

abstraction).

Strengthening Abstraction Refinement

I Generate and add ground instances of

axioms

I Add concrete axioms

169 / 1

Page 170: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Under-Approximation

Concrete

axioms Aαw (A)

Abstract

axioms AwATPS Proved

Conjecture C

I |=Aw ∧ ¬C

Refine abstraction Aw

find a set A, I 6|= A

Aw := Aw ∪ A

Disproved

UNSAT

SAT

A = ∅

A 6= ∅

Weakening Abstraction Function

I Using ground instances of concrete

axioms (instantiation abstraction).

I Removing irrelevant axioms (deletion

abstraction).

Strengthening Abstraction Refinement

I Generate and add ground instances of

axioms

I Add concrete axioms

170 / 1

Page 171: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Under-Approximation

Concrete

axioms Aαw (A)

Abstract

axioms AwATPS Proved

Conjecture C

I |=Aw ∧ ¬C

Refine abstraction Aw

find a set A, I 6|= A

Aw := Aw ∪ A

Disproved

UNSAT

SAT

A = ∅

A 6= ∅

Weakening Abstraction Function

I Using ground instances of concrete

axioms (instantiation abstraction).

I Removing irrelevant axioms (deletion

abstraction).

Strengthening Abstraction Refinement

I Generate and add ground instances of

axioms

I Add concrete axioms

171 / 1

Page 172: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Under-Approximation

Concrete

axioms Aαw (A)

Abstract

axioms AwATPS Proved

Conjecture C

I |=Aw ∧ ¬C

Refine abstraction Aw

find a set A, I 6|= A

Aw := Aw ∪ A

Disproved

UNSAT

SAT

A = ∅

A 6= ∅

Weakening Abstraction Function

I Using ground instances of concrete

axioms (instantiation abstraction).

I Removing irrelevant axioms (deletion

abstraction).

Strengthening Abstraction Refinement

I Generate and add ground instances of

axioms

I Add concrete axioms

172 / 1

Page 173: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Combined Approximations

Concrete

axioms Aαw (A)

Abstract

axioms Aw

Over-approximation

embedded as ATPS

Proved

Conjecture C

I |=Aw ∧ ¬C

Refine abstraction Aw

find a set A, I 6|= A

Aw := Aw ∪ A

Disproved

UNSAT

SAT

A = ∅

A 6= ∅

Shared abstractions.

173 / 1

Page 174: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Implementation & Experiments

I Abstraction-refinement implemented in iProver v2.8

I Strategies: combination of atomic abstractions

--abstr ref [subs;arg filger;sig]

I SInE as under-approximating abstraction

174 / 1

Page 175: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

The Most Effective Strategies

Table: SC = Skolem and constant, SS = Skolem and split symb.

Depth Tolerance Abstractions Signature Arg-filter Until SAT Solutions

1 1.0 sig, subs, arg-fil SS true 1001

1 2.0 subs, sig, arg-fil SC false 42

2 1.0 subs, sig, arg-fil SC false 23

1 4.0 arg-fil, sig, subs SS true 5

1 1.0 subs, sig, arg-fil SC SS false 4

1 1.0 subs, sig, arg-fil false 2

2 1.0 sig SC false 2

1 8.0 subs, sig, arg-fil false 2

1 1.0 arg-fil, subs, sig SS false 2

2 1.0 arg-fil, sig, subs SS true 2

2 1.0 arg-fil false 1

2 1.0 subs, sig false 1

Total 1087

175 / 1

Page 176: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

CASC-26

Table: CASC-26 LTB comparison (out of 1500 problems)

Vampire

4.0

Vampire

4.2

MaLARea iProver 2.8 iProver

2.6

E LTB

1156 1144 1131 1087 777 683

176 / 1

Page 177: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Abstraction-refinement current work

I Abstractions targeted for specific theories

I Goal directed abstractions

I Reuse of abstractions

I Different combination schemes/ ML

I Target abstractions for theories

177 / 1

Page 178: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Conclusions

Instantiation-based theorem proving for first-order logic:

I Modular combination of SAT/SMT and first-order reasoning

I Combination of proof search and model search

I Abstraction-refinement for large/complex problems

Further directions:

I The quest of combining first-order and theories: highly undecidable

I Combination with SMT approaches to quantifier instantiation

I Abstraction-refinement as a generalisation of instantiation based

reasoning ?

178 / 1

Page 179: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Extra: efficient datastructures and indexes

179 / 1

Page 180: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Indexing

Why indexing:

I Single subsumption is NP-hard.

I We can have 100,000 clauses in our search space

I Applying naively between all pairs of clauses we need

10,000,000,000 subsumption checks !

Indexes in iProver:

I non-perfect discrimination trees for unification, matching

I compressed feature vector indexes for subsumption, subsumption

resolution, dismatching constraints.

180 / 1

Page 181: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Indexing

Why indexing:

I Single subsumption is NP-hard.

I We can have 100,000 clauses in our search space

I Applying naively between all pairs of clauses we need

10,000,000,000 subsumption checks !

Indexes in iProver:

I non-perfect discrimination trees for unification, matching

I compressed feature vector indexes for subsumption, subsumption

resolution, dismatching constraints.

181 / 1

Page 182: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Unification: Discrimination trees

ε

f

g

a

f (g(x), a)

h

f (g(x), h(x))f (g(y), h(x))

h

. . . . . .

g

. . . a

g(a)

Efficient filtering unification, matching and generalisation candidates182 / 1

Page 183: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Subsumption: Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz] works well for subsumption, and many other

operations

Design efficient filters based on “features of clauses”:

I clause C can not subsume any clause with number of literals strictly

less than C

I clause C can not subsume any clause with number of positive

literals strictly less than C

I clause C can not subsume any clause with the number of

occurrences of a symbol f less than in C

I . . .

183 / 1

Page 184: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Subsumption: Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz] works well for subsumption, and many other

operations

Design efficient filters based on “features of clauses”:

I clause C can not subsume any clause with number of literals strictly

less than C

I clause C can not subsume any clause with number of positive

literals strictly less than C

I clause C can not subsume any clause with the number of

occurrences of a symbol f less than in C

I . . .

184 / 1

Page 185: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Subsumption: Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz] works well for subsumption, and many other

operations

Design efficient filters based on “features of clauses”:

I clause C can not subsume any clause with number of literals strictly

less than C

I clause C can not subsume any clause with number of positive

literals strictly less than C

I clause C can not subsume any clause with the number of

occurrences of a symbol f less than in C

I . . .

185 / 1

Page 186: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Subsumption: Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz] works well for subsumption, and many other

operations

Design efficient filters based on “features of clauses”:

I clause C can not subsume any clause with number of literals strictly

less than C

I clause C can not subsume any clause with number of positive

literals strictly less than C

I clause C can not subsume any clause with the number of

occurrences of a symbol f less than in C

I . . .

186 / 1

Page 187: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Subsumption: Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz] works well for subsumption, and many other

operations

Design efficient filters based on “features of clauses”:

I clause C can not subsume any clause with number of literals strictly

less than C

I clause C can not subsume any clause with number of positive

literals strictly less than C

I clause C can not subsume any clause with the number of

occurrences of a symbol f less than in C

I . . .

187 / 1

Page 188: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Subsumption: Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz] works well for subsumption, and many other

operations

Design efficient filters based on “features of clauses”:

I clause C can not subsume any clause with number of literals strictly

less than C

I clause C can not subsume any clause with number of positive

literals strictly less than C

I clause C can not subsume any clause with the number of

occurrences of a symbol f less than in C

I . . .

188 / 1

Page 189: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Feature vector index

Fix: a list of features:

1. number of literals

2. number of occurrences of f

3. number of occurrences of g

With each clause associate a feature vector:

numeric vector of feature values

Example: feature vector of C = p(f (f (x))) ∨ ¬p(g(y)) is

fv(C ) = [2, 2, 1]

Arrange feature vectors in a trie data structure similar to discrimination

tree

For retrieving all candidates which can be subsumed by C we need to

traverse only vectors which are component-wise greater or equal to fv(C ).

189 / 1

Page 190: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Feature vector index

Fix: a list of features:

1. number of literals

2. number of occurrences of f

3. number of occurrences of g

With each clause associate a feature vector:

numeric vector of feature values

Example: feature vector of C = p(f (f (x))) ∨ ¬p(g(y)) is

fv(C ) = [2, 2, 1]

Arrange feature vectors in a trie data structure similar to discrimination

tree

For retrieving all candidates which can be subsumed by C we need to

traverse only vectors which are component-wise greater or equal to fv(C ).

190 / 1

Page 191: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Compressed feature vector index [iProver]

The signature based features are most useful but also expensive.

Example: is signature contains 1000 symbols and we use all symbols as

features then feature vector for every clause will be 1000 in length.

Basic idea: for each clause most features will be 0.

Compress feature vector: use list of pairs [(p1, v1), . . . , (pn, v1)] where pi

are non-zero positions and vi are values that start from this position.

Sequential positions with the same value are combined.

iProver uses compressed feature vector index for forward and backward

subsumption, subsumption resolution and dismatching constraints.

191 / 1

Page 192: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Compressed feature vector index [iProver]

The signature based features are most useful but also expensive.

Example: is signature contains 1000 symbols and we use all symbols as

features then feature vector for every clause will be 1000 in length.

Basic idea: for each clause most features will be 0.

Compress feature vector: use list of pairs [(p1, v1), . . . , (pn, v1)] where pi

are non-zero positions and vi are values that start from this position.

Sequential positions with the same value are combined.

iProver uses compressed feature vector index for forward and backward

subsumption, subsumption resolution and dismatching constraints.

192 / 1

Page 193: Instantiation-Based Automated Theorem Proving for First ...korovink/kk-satsmtar19-slides.pdf · Instantiation-Based Automated Theorem Proving for First-Order Logic Konstantin Korovin

Compressed feature vector index [iProver]

The signature based features are most useful but also expensive.

Example: is signature contains 1000 symbols and we use all symbols as

features then feature vector for every clause will be 1000 in length.

Basic idea: for each clause most features will be 0.

Compress feature vector: use list of pairs [(p1, v1), . . . , (pn, v1)] where pi

are non-zero positions and vi are values that start from this position.

Sequential positions with the same value are combined.

iProver uses compressed feature vector index for forward and backward

subsumption, subsumption resolution and dismatching constraints.

193 / 1


Recommended