Automated reasoning for first-order logic Theory, Practice and

144
Automated reasoning for first-order logic Theory, Practice and Challenges Konstantin Korovin 1 The University of Manchester UK [email protected] Part II 1 supported by a Royal Society University Fellowship

Transcript of Automated reasoning for first-order logic Theory, Practice and

Page 1: Automated reasoning for first-order logic Theory, Practice and

Automated reasoning for first-order logic

Theory, Practice and Challenges

Konstantin Korovin1

The University of ManchesterUK

[email protected]

Part II

1supported by a Royal Society University Fellowship

Page 2: Automated reasoning for first-order logic Theory, Practice and

Modular instantiation-based reasoning

Page 3: Automated reasoning for first-order logic Theory, Practice and

SAT/SMT vs First-Order

The problem: Show that a given formula is a theorem.

Ground (SAT/SMT)

P(a) ∨ Q(c , d)

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

Very efficient

Not very expressive

DPLL

Industry

First-Order

∀x∃y Q(x , y) ∨ ¬Q(y , f (x))

P(a) ∨ Q(d , c)

Very expressive

Ground: not as efficient

Resolution/Superposition

Academia → Industry

From Ground to First-Order: Efficient at gound + Expressive?

3 / 144

Page 4: Automated reasoning for first-order logic Theory, Practice and

Traditional Methods: Resolution

Reasoning Problem

Given a set of first order clauses S , prove S is unsatisfiable.

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 Length of clauses can grow fast

I Recombination of clauses

I No effective model representation

4 / 144

Page 5: Automated reasoning for first-order logic Theory, Practice and

Traditional Methods: Resolution

Reasoning Problem

Given a set of first order clauses S , prove S is unsatisfiable.

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 Length of clauses can grow fast

I Recombination of clauses

I No effective model representation

5 / 144

Page 6: Automated reasoning for first-order logic Theory, Practice and

Basic idea behind instantiation proving

Can we approximate first-order by ground reasoning?

Theorem (Herbrand). For a quantifier free formula ϕ(x̄);

∀x̄ϕ(x̄) is unsatisfiable iff∧

i ϕ(t̄i ) is unsatisfiable,

for some ground terms t̄1, . . . , t̄n.

Basic idea: Interleave instantiation with propositional reasoning.

Main issues:

I How to restrict instantiations.

I How to interleave instantiation with propositional reasoning.

6 / 144

Page 7: Automated reasoning for first-order logic Theory, Practice and

Basic idea behind instantiation proving

Can we approximate first-order by ground reasoning?

Theorem (Herbrand). For a quantifier free formula ϕ(x̄);

∀x̄ϕ(x̄) is unsatisfiable iff∧

i ϕ(t̄i ) is unsatisfiable,

for some ground terms t̄1, . . . , t̄n.

Basic idea: Interleave instantiation with propositional reasoning.

Main issues:

I How to restrict instantiations.

I How to interleave instantiation with propositional reasoning.

7 / 144

Page 8: Automated reasoning for first-order logic Theory, Practice and

Different approaches

Gilmore (1960): generation of ground instances

Robinson (1965): resolution

Plaisted et al (1992): hyper-linking

Plaisted & Zhu (2000): semantics-based instance generation

Letz & Stenz (2000): disconnection tableaux-type calculus

Hooker et al (2002): generation of instances with sem. selection

Baumgartner & Tinelli (2003): ME: Lifting of DPLL

Ganzinger & Korovin (2003): Inst-Gen calculus, modular ground

reasoning

Claessen (2005): Equinox

. . . many instantiation based methods for different

fragments/logics

8 / 144

Page 9: Automated reasoning for first-order logic Theory, Practice and

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 LICS’03] Inst-Gen is sound and complete.9 / 144

Page 10: Automated reasoning for first-order logic Theory, Practice and

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 LICS’03] Inst-Gen is sound and complete.10 / 144

Page 11: Automated reasoning for first-order logic Theory, Practice and

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 LICS’03] Inst-Gen is sound and complete.11 / 144

Page 12: Automated reasoning for first-order logic Theory, Practice and

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 LICS’03] Inst-Gen is sound and complete.12 / 144

Page 13: Automated reasoning for first-order logic Theory, Practice and

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 LICS’03] Inst-Gen is sound and complete.13 / 144

Page 14: Automated reasoning for first-order logic Theory, Practice and

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 LICS’03] Inst-Gen is sound and complete.14 / 144

Page 15: Automated reasoning for first-order logic Theory, Practice and

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.

15 / 144

Page 16: Automated reasoning for first-order logic Theory, Practice and

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.

16 / 144

Page 17: Automated reasoning for first-order logic Theory, Practice and

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.

17 / 144

Page 18: Automated reasoning for first-order logic Theory, Practice and

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.

18 / 144

Page 19: Automated reasoning for first-order logic Theory, Practice and

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.

19 / 144

Page 20: Automated reasoning for first-order logic Theory, Practice and

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.20 / 144

Page 21: Automated reasoning for first-order logic Theory, Practice and

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:

Inefficient in the ground/EPR case

Length of clauses can grow fast

Recombination of clauses

No explicit model representation

Strengths of instantiation:

Modular ground reasoning

Length of clauses is fixed

Decision procedure for EPR

No recombination

Semantic selection

Redundancy elimination

Effective model presentation

21 / 144

Page 22: Automated reasoning for first-order logic Theory, Practice and

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 [Ganzinger, Korovin]. Redundant clauses/closures can be

eliminated.

Consequences:

I many usual redundancy elimination techniques

I redundancy for inferences

I new instantiation-specific redundancies

22 / 144

Page 23: Automated reasoning for first-order logic Theory, Practice and

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 [Ganzinger, Korovin]. Redundant clauses/closures can be

eliminated.

Consequences:

I many usual redundancy elimination techniques

I redundancy for inferences

I new instantiation-specific redundancies

23 / 144

Page 24: Automated reasoning for first-order logic Theory, Practice and

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 [Ganzinger, Korovin]. Redundant clauses/closures can be

eliminated.

Consequences:

I many usual redundancy elimination techniques

I redundancy for inferences

I new instantiation-specific redundancies24 / 144

Page 25: Automated reasoning for first-order logic Theory, Practice and

Simplifications by SAT/SMT solver [Korovin 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= ∅

25 / 144

Page 26: Automated reasoning for first-order logic Theory, Practice and

Simplifications by SAT/SMT solver [Korovin 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= ∅

26 / 144

Page 27: Automated reasoning for first-order logic Theory, Practice and

Simplifications by SAT/SMT solver [Korovin 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= ∅

27 / 144

Page 28: Automated reasoning for first-order logic Theory, Practice and

Simplifications by SAT/SMT solver [Korovin 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= ∅

28 / 144

Page 29: Automated reasoning for first-order logic Theory, Practice and

Global Ground Subsumption [Korovin IJCAR’08]

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 . . .

29 / 144

Page 30: Automated reasoning for first-order logic Theory, Practice and

Global Ground Subsumption [Korovin IJCAR’08]

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 . . .

30 / 144

Page 31: Automated reasoning for first-order logic Theory, Practice and

Global Ground Subsumption [Korovin IJCAR’08]

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 . . .

31 / 144

Page 32: Automated reasoning for first-order logic Theory, Practice and

Global Ground Subsumption [Korovin IJCAR’08]

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 . . .32 / 144

Page 33: Automated reasoning for first-order logic Theory, Practice and

Non-Ground Simplifications by SAT/SMT [Korovin IJCAR’08]

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

Can we do more?

Yes!

Ground solver can be used to simplify non-ground clauses.

The main idea:

Sgr |= ∀x̄C (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

33 / 144

Page 34: Automated reasoning for first-order logic Theory, Practice and

Non-Ground Simplifications by SAT/SMT [Korovin IJCAR’08]

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

Can we do more? Yes!

Ground solver can be used to simplify non-ground clauses.

The main idea:

Sgr |= ∀x̄C (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

34 / 144

Page 35: Automated reasoning for first-order logic Theory, Practice and

Non-Ground Simplifications by SAT/SMT [Korovin IJCAR’08]

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

Can we do more? Yes!

Ground solver can be used to simplify non-ground clauses.

The main idea:

Sgr |= ∀x̄C (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

35 / 144

Page 36: Automated reasoning for first-order logic Theory, Practice and

Non-Ground Simplifications by SAT/SMT [Korovin IJCAR’08]

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

Can we do more? Yes!

Ground solver can be used to simplify non-ground clauses.

The main idea:

Sgr |= ∀x̄C (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

36 / 144

Page 37: Automated reasoning for first-order logic Theory, Practice and

Non-Ground Simplifications by SAT/SMT [Korovin IJCAR’08]

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

Can we do more? Yes!

Ground solver can be used to simplify non-ground clauses.

The main idea:

Sgr |= ∀x̄C (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

37 / 144

Page 38: Automated reasoning for first-order logic Theory, Practice and

Non-Ground Simplifications by SAT/SMT [Korovin IJCAR’08]

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

Can we do more? Yes!

Ground solver can be used to simplify non-ground clauses.

The main idea:

Sgr |= ∀x̄C (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

38 / 144

Page 39: Automated reasoning for first-order logic Theory, Practice and

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!

39 / 144

Page 40: Automated reasoning for first-order logic Theory, Practice and

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!

40 / 144

Page 41: Automated reasoning for first-order logic Theory, Practice and

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!

41 / 144

Page 42: Automated reasoning for first-order logic Theory, Practice and

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!

42 / 144

Page 43: Automated reasoning for first-order logic Theory, Practice and

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!

43 / 144

Page 44: Automated reasoning for first-order logic Theory, Practice and

Finer-grained control: closure orderings

Finer-grained control: replace ground clauses with ground closures.

Closure, a closure is a pair C · σ,

where C is a clause and σ a grounding substitution

(A(a) ∨ B(x)) · [b/x ]

Represents: ground clause Cσ

A(a) ∨ B(b)

Closure ordering: any total, well-founded ordering such that

Cθ · τ ≺ C · σ if

I Cσ = Cθτ , and

I θ properly instantiates C

Slogan: more specific representations take priority over less specific ones

Ex: (p(a) ∨ q(z)) · [b/z ] ≺ (p(y) ∨ q(z)) · [a/y , b/z ]44 / 144

Page 45: Automated reasoning for first-order logic Theory, Practice and

Finer-grained control: closure orderings

Finer-grained control: replace ground clauses with ground closures.

Closure, a closure is a pair C · σ,

where C is a clause and σ a grounding substitution

(A(a) ∨ B(x)) · [b/x ]

Represents: ground clause Cσ

A(a) ∨ B(b)

Closure ordering: any total, well-founded ordering such that

Cθ · τ ≺ C · σ if

I Cσ = Cθτ , and

I θ properly instantiates C

Slogan: more specific representations take priority over less specific ones

Ex: (p(a) ∨ q(z)) · [b/z ] ≺ (p(y) ∨ q(z)) · [a/y , b/z ]45 / 144

Page 46: Automated reasoning for first-order logic Theory, Practice and

Finer-grained control: closure orderings

Finer-grained control: replace ground clauses with ground closures.

Closure, a closure is a pair C · σ,

where C is a clause and σ a grounding substitution

(A(a) ∨ B(x)) · [b/x ]

Represents: ground clause Cσ

A(a) ∨ B(b)

Closure ordering: any total, well-founded ordering such that

Cθ · τ ≺ C · σ if

I Cσ = Cθτ , and

I θ properly instantiates C

Slogan: more specific representations take priority over less specific ones

Ex: (p(a) ∨ q(z)) · [b/z ] ≺ (p(y) ∨ q(z)) · [a/y , b/z ]46 / 144

Page 47: Automated reasoning for first-order logic Theory, Practice and

Closure-based redundancy elimination

Definition call C · σ redundant in S if

I C1 · σ1, . . . ,Cn · σn |= C · σ and

I C1 · σ1, . . . ,Cn · σn ≺ C · σ

Theorem. [Ganzinger, Korovin]

Redundant closures (and clauses) can be eliminated.

Consequences:

I generalises usual redundancy

I new instantiation specific redundancies

I blocking non-proper instances (merging variables) can be eliminated

I dismatching constraints

I redundancy for inferences

47 / 144

Page 48: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.48 / 144

Page 49: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.49 / 144

Page 50: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.50 / 144

Page 51: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.51 / 144

Page 52: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.52 / 144

Page 53: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.53 / 144

Page 54: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin (IJCAR’08, vol. HG’13)]

Example:

p(x) ∨ ¬q(f (x)) (1)

p(f (x)) ∨ ¬q(f (f (x))) (2)

q(f(f(a))) (3)

Then the inference between (1) and (2) is redundant!

Why? the conclusion is represented twice p(f (a)) ∨ ¬q(f (f (a)))

p(f (x)) ∨ ¬q(f (f (x))) · [a/x ] ≺ p(x) ∨ ¬q(f (x)) · [f (a)/x ]

This can be represented as a dismatching constraint.

p(x) ∨ ¬q(f (x)) | x /ds f (x)

How to make closures redundant? Instantiate!

Every proper instantiation inference makes closures redundant in the

premise.54 / 144

Page 55: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin IJCAR’08, HG’13]

Example

A(f (y)) ∨ D1 ¬A(x) ∨ C

| x /ds f (y)

A(f 3(y)) ∨ D2

¬A(f (y)) ∨ C

A(f 5(y)) ∨ D3

. . .

A(f in(y)) ∨ Dn

All other inferences with ¬A(x) ∨ C are blocked!

Premises inherit the constraints during instantiation inferences.

55 / 144

Page 56: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin IJCAR’08, HG’13]

Example

A(f (y)) ∨ D1 ¬A(x) ∨ C | x /ds f (y)

A(f 3(y)) ∨ D2 ¬A(f (y)) ∨ C

A(f 5(y)) ∨ D3

. . .

A(f in(y)) ∨ Dn

All other inferences with ¬A(x) ∨ C are blocked!

Premises inherit the constraints during instantiation inferences.

56 / 144

Page 57: Automated reasoning for first-order logic Theory, Practice and

Dismatching Constraints [Korovin IJCAR’08, HG’13]

Example

A(f (y)) ∨ D1 ¬A(x) ∨ C | x /ds f (y)

A(f 3(y)) ∨ D2 ¬A(f (y)) ∨ C

A(f 5(y)) ∨ D3

. . .

A(f in(y)) ∨ Dn

All other inferences with ¬A(x) ∨ C are blocked!

Premises inherit the constraints during instantiation inferences.

57 / 144

Page 58: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

58 / 144

Page 59: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

59 / 144

Page 60: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

60 / 144

Page 61: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

61 / 144

Page 62: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

62 / 144

Page 63: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

63 / 144

Page 64: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

64 / 144

Page 65: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

65 / 144

Page 66: Automated reasoning for first-order logic Theory, Practice and

Summary

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

I Inst-Gen is sound and complete for first-order logic

I combines efficient ground reasoning with first-order reasoning

I decision procedure for effectively propositional logic (EPR)

I redundancy elimination

I usual: tautology elimination, strict subsumption

I global subsumption:

non-ground simplifications using SAT/SMT reasoningI closure-based redundancies:

I blocking non-proper instantiators

I dismatching constraints

66 / 144

Page 67: Automated reasoning for first-order logic Theory, Practice and

Equational instantiation-based reasoning

Page 68: Automated reasoning for first-order logic Theory, Practice and

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

68 / 144

Page 69: Automated reasoning for first-order logic Theory, Practice and

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 !

69 / 144

Page 70: Automated reasoning for first-order logic Theory, Practice and

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 !

70 / 144

Page 71: Automated reasoning for first-order logic Theory, Practice and

Superposition+Instantiation

f (h(x)) ' c

∨ C1(x , y)

h(x) ' x

∨ C2(x , y)

f (a) 6' c

∨ C3(x , y)

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

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

f (a) 6' c ∨ C3(a, y)

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.

71 / 144

Page 72: Automated reasoning for first-order logic Theory, Practice and

Superposition+Instantiation

f (h(x)) ' c

∨ C1(x , y)

h(x) ' x

∨ C2(x , y)

f (a) 6' c

∨ C3(x , y)

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

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

f (a) 6' c ∨ C3(a, y)

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.

72 / 144

Page 73: Automated reasoning for first-order logic Theory, Practice and

Superposition+Instantiation

f (h(x)) ' c

∨ C1(x , y)

h(x) ' x

∨ C2(x , y)

f (a) 6' c

∨ C3(x , y)

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

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

f (a) 6' c ∨ C3(a, y)

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.

73 / 144

Page 74: Automated reasoning for first-order logic Theory, Practice and

Superposition+Instantiation

f (h(x)) ' c

∨ C1(x , y)

h(x) ' x

∨ C2(x , y)

f (a) 6' c

∨ C3(x , y)

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

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

f (a) 6' c ∨ C3(a, y)

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.

74 / 144

Page 75: Automated reasoning for first-order logic Theory, Practice and

Superposition+Instantiation

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

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

f (a) 6' c ∨ C3(x , y)

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

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

f (a) 6' c ∨ C3(a, y)

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.

75 / 144

Page 76: Automated reasoning for first-order logic Theory, Practice and

Superposition+Instantiation

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

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

f (a) 6' c ∨ C3(x , y)

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

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

f (a) 6' c ∨ C3(a, y)

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.

76 / 144

Page 77: Automated reasoning for first-order logic Theory, Practice and

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.[Ganzinger, Korovin CSL’04] Inst-Gen-Eq is sound and complete. 77 / 144

Page 78: Automated reasoning for first-order logic Theory, Practice and

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.[Ganzinger, Korovin CSL’04] Inst-Gen-Eq is sound and complete. 78 / 144

Page 79: Automated reasoning for first-order logic Theory, Practice and

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.[Ganzinger, Korovin CSL’04] Inst-Gen-Eq is sound and complete. 79 / 144

Page 80: Automated reasoning for first-order logic Theory, Practice and

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.[Ganzinger, Korovin CSL’04] Inst-Gen-Eq is sound and complete. 80 / 144

Page 81: Automated reasoning for first-order logic Theory, Practice and

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.[Ganzinger, Korovin CSL’04] Inst-Gen-Eq is sound and complete. 81 / 144

Page 82: Automated reasoning for first-order logic Theory, Practice and

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.[Ganzinger, Korovin CSL’04] Inst-Gen-Eq is sound and complete. 82 / 144

Page 83: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

83 / 144

Page 84: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

84 / 144

Page 85: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

85 / 144

Page 86: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

86 / 144

Page 87: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

87 / 144

Page 88: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

88 / 144

Page 89: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen-Eq: Key properties

Inst-Gen-Eq is

I sound and complete for first-order logic with equality

I combines SMT for ground reasoning and superposition-based unit

reasoning

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

New technical issue: Potentially we need to consider

all unit-superposition proofs!

89 / 144

Page 90: Automated reasoning for first-order logic Theory, Practice and

Labelled Unit Superposition [Korovin, Sticksel LPAR’10]

General idea: Dismatching constraints can be used to block already

derived proofs!

Unit superposition with dismatching constraints:

(l ' r) | [ D1 ] L[l ′] | [ D2 ]

L[r ]θ | [ (D1 ∧ D2)θ ](θ)

s 6' t | [ D ]

�(µ)

where (i) θ = mgu(l , l ′); (ii) l ′ is not a variable; (iii) for some grounding substitution

σ, satisfying (D1 ∧ D2)θ, lσ � rσ; (iv) µ = mgu(s, t); (v) Dµ is satisfiable.

Next technical issue: The same unit literal can

I correspond to different clauses,

I have different dismatching constraints

I be represented many times in the same proof search

Solution: labelled approach90 / 144

Page 91: Automated reasoning for first-order logic Theory, Practice and

Labelled Unit Superposition [Korovin, Sticksel LPAR’10]

General idea: Dismatching constraints can be used to block already

derived proofs!

Unit superposition with dismatching constraints:

(l ' r) | [ D1 ] L[l ′] | [ D2 ]

L[r ]θ | [ (D1 ∧ D2)θ ](θ)

s 6' t | [ D ]

�(µ)

where (i) θ = mgu(l , l ′); (ii) l ′ is not a variable; (iii) for some grounding substitution

σ, satisfying (D1 ∧ D2)θ, lσ � rσ; (iv) µ = mgu(s, t); (v) Dµ is satisfiable.

Next technical issue: The same unit literal can

I correspond to different clauses,

I have different dismatching constraints

I be represented many times in the same proof search

Solution: labelled approach91 / 144

Page 92: Automated reasoning for first-order logic Theory, Practice and

Labelled Unit Superposition [Korovin, Sticksel LPAR’10]

General idea: Dismatching constraints can be used to block already

derived proofs!

Unit superposition with dismatching constraints:

(l ' r) | [ D1 ] L[l ′] | [ D2 ]

L[r ]θ | [ (D1 ∧ D2)θ ](θ)

s 6' t | [ D ]

�(µ)

where (i) θ = mgu(l , l ′); (ii) l ′ is not a variable; (iii) for some grounding substitution

σ, satisfying (D1 ∧ D2)θ, lσ � rσ; (iv) µ = mgu(s, t); (v) Dµ is satisfiable.

Next technical issue: The same unit literal can

I correspond to different clauses,

I have different dismatching constraints

I be represented many times in the same proof search

Solution: labelled approach92 / 144

Page 93: Automated reasoning for first-order logic Theory, Practice and

Tree Labelled Unit Superposition

I Preserve Boolean structure of proofs

I Closure is a propositional variable in an AND/OR tree

I Conjunction ∧ in superposition, disjunction ∨ in merging

Label of the Contradiction �

93 / 144

Page 94: Automated reasoning for first-order logic Theory, Practice and

OBDD Labelled Unit Superposition

Label of the

contradiction �

Disadvantages of trees

I Not produced in normal form

I Sequence of inferences determines shape

I Potential growth ad infinitum

I OBDD as normal form

I Maintenance effort

I Reordering required

94 / 144

Page 95: Automated reasoning for first-order logic Theory, Practice and

Labels: Sets vs. Trees vs. OBDDs

iProver-Eq – CVC3 as a background solver on pure equational problems.

(developed with Christoph Sticksel)

Solved equational

problems

193

216 13

1393

344

30

76

set

2006

tree

1983

OBDD

1512

FeaturesNormal

form

Precise

elim.Sets yes no

Trees no yes

OBDDs yes yes

[Korovin, Sticksel LPAR’10]

95 / 144

Page 96: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation

Page 97: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation [Ganzinger, Korovin LPAR’06]

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 �

97 / 144

Page 98: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation [Ganzinger, Korovin LPAR’06]

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 �

98 / 144

Page 99: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation [Ganzinger, Korovin LPAR’06]

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 �

99 / 144

Page 100: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation [Ganzinger, Korovin LPAR’06]

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 �

100 / 144

Page 101: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation [Ganzinger, Korovin LPAR’06]

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 �

101 / 144

Page 102: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation [Ganzinger, Korovin LPAR’06]

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 �

102 / 144

Page 103: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation

Conditions on completeness:

I complete ground reasoning modulo T

I answer completeness of unit reasoning modulo T

I T is universal

Answer completeness: If L1τ ∧ . . . ∧ Lnτ |=T � for ground τ . Then

L1, . . . , LnL1θ, . . . , Lnθ

UC

such that θ is a genralization of τ and L1θ⊥, . . . , Lnθ⊥ `T �

Theorem. Theory instantiation is sound and complete under these

conditions.

103 / 144

Page 104: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation

Conditions on completeness:

I complete ground reasoning modulo T

I answer completeness of unit reasoning modulo T

I T is universal

Answer completeness: If L1τ ∧ . . . ∧ Lnτ |=T � for ground τ . Then

L1, . . . , LnL1θ, . . . , Lnθ

UC

such that θ is a genralization of τ and L1θ⊥, . . . , Lnθ⊥ `T �

Theorem. Theory instantiation is sound and complete under these

conditions.

104 / 144

Page 105: Automated reasoning for first-order logic Theory, Practice and

Theory instantiation

Conditions on completeness:

I complete ground reasoning modulo T

I answer completeness of unit reasoning modulo T

I T is universal

Answer completeness: If L1τ ∧ . . . ∧ Lnτ |=T � for ground τ . Then

L1, . . . , LnL1θ, . . . , Lnθ

UC

such that θ is a genralization of τ and L1θ⊥, . . . , Lnθ⊥ `T �

Theorem. Theory instantiation is sound and complete under these

conditions.

105 / 144

Page 106: Automated reasoning for first-order logic Theory, Practice and

Evaluation

Page 107: Automated reasoning for first-order logic Theory, Practice and

CASC 2013

107 / 144

Page 108: Automated reasoning for first-order logic Theory, Practice and

CASC 2013 results

General first-order (FOF) 300 problems

Vampire E iProver E-KRHyper Prover9

prob 281 249 167 122 119

time 12 29 12 8 12

Effectively propositional 100 problems

iProver Vampire PEPR E EKRHyper

prob 81 47 43 23 8

time 27 15 26 50 27

First-order satisfiability (FNT) 150 problems

iProver Paradox CVC4 E Nitrox Vampire

prob 122 99 96 79 79 78

time 52 2 25 20 29 30

Non-cyclic sorts for first-order satisfiability [Korovin FroCoS’13]108 / 144

Page 109: Automated reasoning for first-order logic Theory, Practice and

CASC 2013 results

General first-order (FOF) 300 problems

Vampire E iProver E-KRHyper Prover9

prob 281 249 167 122 119

time 12 29 12 8 12

Effectively propositional 100 problems

iProver Vampire PEPR E EKRHyper

prob 81 47 43 23 8

time 27 15 26 50 27

First-order satisfiability (FNT) 150 problems

iProver Paradox CVC4 E Nitrox Vampire

prob 122 99 96 79 79 78

time 52 2 25 20 29 30

Non-cyclic sorts for first-order satisfiability [Korovin FroCoS’13]109 / 144

Page 110: Automated reasoning for first-order logic Theory, Practice and

CASC 2013 results

General first-order (FOF) 300 problems

Vampire E iProver E-KRHyper Prover9

prob 281 249 167 122 119

time 12 29 12 8 12

Effectively propositional 100 problems

iProver Vampire PEPR E EKRHyper

prob 81 47 43 23 8

time 27 15 26 50 27

First-order satisfiability (FNT) 150 problems

iProver Paradox CVC4 E Nitrox Vampire

prob 122 99 96 79 79 78

time 52 2 25 20 29 30

Non-cyclic sorts for first-order satisfiability [Korovin FroCoS’13]110 / 144

Page 111: Automated reasoning for first-order logic Theory, Practice and

Effectively propositional logic (EPR)

Page 112: Automated reasoning for first-order logic Theory, Practice and

Effectively Propositional Logic (EPR)

EPR: No functions except constants: P(x , y) ∨ ¬Q(c , y)

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 (Intel)

I Planning/Scheduling

I Finite model reasoning

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

112 / 144

Page 113: Automated reasoning for first-order logic Theory, Practice and

Effectively Propositional Logic (EPR)

EPR: No functions except constants: P(x , y) ∨ ¬Q(c , y)

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 (Intel)

I Planning/Scheduling

I Finite model reasoning

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

Page 114: Automated reasoning for first-order logic Theory, Practice and

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:¬a(x) ∨ b(x)

mem(x , y)

More expressive logics can speed up calculations!

114 / 144

Page 115: Automated reasoning for first-order logic Theory, Practice and

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:

¬a(x) ∨ b(x) ¬b(x) ∨ mem(x , y)

a(x) ∨ mem(x , y)

mem(x , y)

More expressive logics can speed up calculations!

115 / 144

Page 116: Automated reasoning for first-order logic Theory, Practice and

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:

¬a(x) ∨ b(x) ¬b(x) ∨ mem(x , y)

a(x) ∨ mem(x , y) mem(x , y)

More expressive logics can speed up calculations!

116 / 144

Page 117: Automated reasoning for first-order logic Theory, Practice and

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:

¬a(x) ∨ b(x) ((((((((¬b(x) ∨ mem(x , y)

((((((((a(x) ∨ mem(x , y) mem(x , y)

More expressive logics can speed up calculations!

117 / 144

Page 118: Automated reasoning for first-order logic Theory, Practice and

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) used at Intel, IBM118 / 144

Page 119: Automated reasoning for first-order logic Theory, Practice and

EPR-based BMC Navarro-Perez, Voronkov (CADE’07)

EPR encoding:

I s0, . . . , sk constants denote unrolling bounds

I first-order formulas I (S),P(S),T (S ,S ′)

I next state predicate Next(S ,S ′)

BMC can be encoded

I (s0);¬P(sk); initial and final states

∀S , S ′(Next(S , S ′)→ T (S , S ′)); transition relation

Next(s0, s1);Next(s1, s2); . . .Next(sk−1, sk); next state relation

I EPR encoding provides succinct representation

I avoids copying transition relation

I reasoning can be done at higher level

BMC with bit-vectors, memories:

[M. Emmer, Z. Khasidashvili, K. Korovin, C. Sticksel, A. Voronkov IJCAR’12]119 / 144

Page 120: Automated reasoning for first-order logic Theory, Practice and

EPR-based BMC Navarro-Perez, Voronkov (CADE’07)

EPR encoding:

I s0, . . . , sk constants denote unrolling bounds

I first-order formulas I (S),P(S),T (S ,S ′)

I next state predicate Next(S ,S ′)

BMC can be encoded

I (s0);¬P(sk); initial and final states

∀S , S ′(Next(S , S ′)→ T (S , S ′)); transition relation

Next(s0, s1);Next(s1, s2); . . .Next(sk−1, sk); next state relation

I EPR encoding provides succinct representation

I avoids copying transition relation

I reasoning can be done at higher level

BMC with bit-vectors, memories:

[M. Emmer, Z. Khasidashvili, K. Korovin, C. Sticksel, A. Voronkov IJCAR’12]120 / 144

Page 121: Automated reasoning for first-order logic Theory, Practice and

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 outperforms highly optimised Intel SAT-based model checker.

121 / 144

Page 122: Automated reasoning for first-order logic Theory, Practice and

Implementation

Page 123: Automated reasoning for first-order logic Theory, Practice and

iProver general features

I Inst-Gen also uses SAT solver and resolution for simplifications

I Query answering: using answer substitutions

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

I Bounded model checking mode: (Intel format)

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

I Model representation: using formulas in term algebra;

special model representation for hardware BMC

123 / 144

Page 124: Automated reasoning for first-order logic Theory, Practice and

iProver implementation features

iProver is implemented in OCaml, around 50,000 LOC

Core:

I Inst-Gen Given clause algorithm

I SAT solvers for ground reasoning: MiniSAT, PicoSAT, Lingeling

I strategy scheduling

I preprocessing

I splitting with naming

Simplifications:

I Literal selection

I Subsumption (forward/backward)

I Subsumption resolution (forward/backward)

I Dismatching constraints

I Blocking non-proper instantiators

I Global subsumption: SAT solver is used for non-ground

simplifications124 / 144

Page 125: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen given clause algorithm

Passive: clauses that are waiting to participate in inferences

I priority queues based on lexicographic combinations of parameters

−− inst pass queue1 [−conj dist; +conj symb;−num var ]

−− inst pass queue2 [+age;−num symb]

Active: clauses between which all inferences are done

I unification index on selected literals

Non-perfect discrimination trees

Given clause: C

1. C – next clause from the top of Passive

2. simplify C : compressed feature indexes

3. perform all inferences between C and Active

4. add all conclusions to passive

5. add ⊥-grounding of conclusions to the SAT solver125 / 144

Page 126: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen given clause algorithm

Passive: clauses that are waiting to participate in inferences

I priority queues based on lexicographic combinations of parameters

−− inst pass queue1 [−conj dist; +conj symb;−num var ]

−− inst pass queue2 [+age;−num symb]

Active: clauses between which all inferences are done

I unification index on selected literals

Non-perfect discrimination trees

Given clause: C

1. C – next clause from the top of Passive

2. simplify C : compressed feature indexes

3. perform all inferences between C and Active

4. add all conclusions to passive

5. add ⊥-grounding of conclusions to the SAT solver126 / 144

Page 127: Automated reasoning for first-order logic Theory, Practice and

Inst-Gen given clause algorithm

Passive: clauses that are waiting to participate in inferences

I priority queues based on lexicographic combinations of parameters

−− inst pass queue1 [−conj dist; +conj symb;−num var ]

−− inst pass queue2 [+age;−num symb]

Active: clauses between which all inferences are done

I unification index on selected literals

Non-perfect discrimination trees

Given clause: C

1. C – next clause from the top of Passive

2. simplify C : compressed feature indexes

3. perform all inferences between C and Active

4. add all conclusions to passive

5. add ⊥-grounding of conclusions to the SAT solver127 / 144

Page 128: Automated reasoning for first-order logic Theory, Practice and

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

[Korovin (Essays in Memory of Harald Ganzinger 2013])128 / 144

Page 129: Automated reasoning for first-order logic Theory, Practice and

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.

129 / 144

Page 130: Automated reasoning for first-order logic Theory, Practice and

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.

130 / 144

Page 131: Automated reasoning for first-order logic Theory, Practice and

Discrimination trees

ε

f

g

a

f (g(x), a)

h

f (x , h(x))f (y , h(x))

h

. . . . . .

g

. . . a

g(a)

Efficient filtering unification, matching and generalisation candidates131 / 144

Page 132: Automated reasoning for first-order logic Theory, Practice and

Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz’04] 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 . . .

132 / 144

Page 133: Automated reasoning for first-order logic Theory, Practice and

Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz’04] 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 . . .

133 / 144

Page 134: Automated reasoning for first-order logic Theory, Practice and

Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz’04] 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 . . .

134 / 144

Page 135: Automated reasoning for first-order logic Theory, Practice and

Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz’04] 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 . . .

135 / 144

Page 136: Automated reasoning for first-order logic Theory, Practice and

Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz’04] 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 . . .

136 / 144

Page 137: Automated reasoning for first-order logic Theory, Practice and

Feature vector index

Subsumption is very expensive and usual indexing are complicated.

Feature vector index [Schulz’04] 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 . . .

137 / 144

Page 138: Automated reasoning for first-order logic Theory, Practice and

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.

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 ).

138 / 144

Page 139: Automated reasoning for first-order logic Theory, Practice and

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.

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 ).

139 / 144

Page 140: Automated reasoning for first-order logic Theory, Practice and

Compressed feature vector index [Korovin (iProver’08)]

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.

140 / 144

Page 141: Automated reasoning for first-order logic Theory, Practice and

Compressed feature vector index [Korovin (iProver’08)]

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.

141 / 144

Page 142: Automated reasoning for first-order logic Theory, Practice and

Compressed feature vector index [Korovin (iProver’08)]

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.

142 / 144

Page 143: Automated reasoning for first-order logic Theory, Practice and

Summary

iProver is a theorem prover for full clausal first-order logic which features

I Query answering: using answer substitutions

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

I Bounded model checking mode: (Intel format)

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

I Model representation: using formulas in term algebra;

special model representation for hardware BMC

iProver has solid performance over the whole range of TPTP.

iProver excels on EPR problems and in turn on satisfiability, bounded

model checking and other encodings into EPR.

143 / 144

Page 144: Automated reasoning for first-order logic Theory, Practice and

PhD opportunities at the University of Manchester

PhD opportunities in reasoning, logic and verification, please contact:

[email protected]

144 / 144