First-Order Interpolation Laura Kov acs Interpolation: Craig - - PowerPoint PPT Presentation

first order interpolation
SMART_READER_LITE
LIVE PREVIEW

First-Order Interpolation Laura Kov acs Interpolation: Craig - - PowerPoint PPT Presentation

First-Order Interpolation Laura Kov acs Interpolation: Craig Interpolation Use of interpolation in software verification thanks to K. McMillan Interpolation: Craig Interpolation Use of interpolation in software verification


slide-1
SLIDE 1

First-Order Interpolation

Laura Kov´ acs

slide-2
SLIDE 2

◮ Interpolation: Craig Interpolation ◮ Use of interpolation in software verification thanks to K. McMillan

slide-3
SLIDE 3

◮ Interpolation: Craig Interpolation ◮ Use of interpolation in software verification thanks to K. McMillan

slide-4
SLIDE 4

Interpolation in Software Verification

while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d
slide-5
SLIDE 5

Interpolation in Software Verification

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c, d)

slide-6
SLIDE 6

Interpolation in Software Verification

Reachability of B in ONE iteration:

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; Loop Invariant? c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c, d)

slide-7
SLIDE 7

Interpolation in Software Verification

Reachability of B in ONE iteration: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → B(c′, d′)

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′)

slide-8
SLIDE 8

Interpolation in Software Verification

Reachability of B in ONE iteration: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → B(c′, d′)

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d];

c < N ∧ C[c] = D[d] ∧ c′ = c + 1 ∧ d′ = d + 1

  • T(c,d,c′,d′)

c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′)

slide-9
SLIDE 9

Interpolation in Software Verification

Reachability of B in ONE iteration: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → B(c′, d′)

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′)

Refutation: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N ∧ ¬B(c′, d′)

  • The formula is of 2 states (c, d, c′, d′).
  • Need a state formula I(c′, d′) such that:

(Jhala and McMillan) R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → I(c′, d′) and I(c′, d′) ∧ ¬B(c′, d′) → ⊥

slide-10
SLIDE 10

Interpolation in Software Verification

Reachability of B in ONE iteration: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → B(c′, d′)

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′)

Refutation: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N ∧ ¬B(c′, d′)

  • The formula is of 2 states (c, d, c′, d′).
  • Need a state formula I(c′, d′) such that:

(Jhala and McMillan) R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → I(c′, d′) and I(c′, d′) ∧ ¬B(c′, d′) → ⊥

slide-11
SLIDE 11

Interpolation in Software Verification

Reachability of B in ONE iteration: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → B(c′, d′)

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′)

Refutation: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N ∧ ¬B(c′, d′)

  • The formula is of 2 states (c, d, c′, d′).
  • Need a state formula I(c′, d′) such that:

(Jhala and McMillan) R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → I(c′, d′) and I(c′, d′) ∧ ¬B(c′, d′) → ⊥ Task: Compute interpolant I(c′, d′) from refutation by eliminating symbols c, d.

slide-12
SLIDE 12

Interpolation in Software Verification

Reachability of B in ONE iteration: R(c, d) ∧ T(c, d, c′, d′) ∧ c′ ≥ N → B(c′, d′)

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′) I(c′, d′) ≡ 0 < c′ = 1 ∧ C[0] = D[0] I(c′′, d′′) ≡ 0 < c′′ = 2 ∧ C[0] = D[0] ∧ C[1] = D[1]

Task: Compute interpolant I(c′, d′) from refutation by eliminating symbols c, d.

slide-13
SLIDE 13

Interpolation in Software Verification

Reachability of B in TWO iterations

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′) I(c′, d′) ≡ 0 < c′ = 1 ∧ C[0] = D[0] I(c′′, d′′) ≡ 0 < c′′ = 2 ∧ C[0] = D[0] ∧ C[1] = D[1]

Task: Compute interpolant I(c′′, d′′) from refutation by eliminating c, d, c′, d′.

slide-14
SLIDE 14

Interpolation in Software Verification

Reachability of B in TWO iterations

{c = d = 0 ∧ N > 0 ∧ (∀k) (0 ≤ k < N → D[k] = 0)} precondition R(c, d) while (c < N) do C[c] := D[d]; c := c + 1; d := d + 1

  • d

{(∀k)(0 ≤ k < N → C[k] = 0)} postcondition B(c′, d′) I(c′, d′) ≡ (∀k)0 ≤ k < c′ → C[k] = D[k] I(c′′, d′′) ≡ (∀k)0 ≤ k < c′′ → C[k] = D[k]

Task: Compute interpolant I(c′′, d′′) implying invariant in any state.

slide-15
SLIDE 15

Interpolation in Software Verification

Tasks:

◮ Proving: Refute reachability properties ◮ Extracting: Compute interpolants from proofs

slide-16
SLIDE 16

Outline

Interpolation and Local Proofs Localizing Proofs Minimizing Interpolants Quantifier Complexity of Interpolants

slide-17
SLIDE 17

Interpolation

Theorem

Let R, B be closed formulas and let R ⊢ B. Then there exists a formula I such that

  • 1. R ⊢ I and I ⊢ B;
  • 2. every symbol of I occurs both in R and B;
slide-18
SLIDE 18

Interpolation

Theorem

Let R, B be closed formulas and let R ⊢ B. Then there exists a formula I such that

  • 1. R ⊢ I and I ⊢ B;
  • 2. every symbol of I occurs both in R and B;

Any formula I with this property is called an interpolant of R and B. Essentially, an interpolant is a formula that is

  • 1. intermediate in power between R and B;
  • 2. Uses only common symbols of R and B.
slide-19
SLIDE 19

Interpolation

Theorem

Let R, B be closed formulas and let R ⊢ B. Then there exists a formula I such that

  • 1. R ⊢ I and I ⊢ B;
  • 2. every symbol of I occurs both in R and B;

Any formula I with this property is called an interpolant of R and B. Essentially, an interpolant is a formula that is

  • 1. intermediate in power between R and B;
  • 2. Uses only common symbols of R and B.

When we deal with refutations rather than proofs and have an unsatisfiable set {R, B}, it is convenient to use reverse interpolants of R and B, that is, a formula I such that

  • 1. R ⊢ I and {I, B} is unsatisfiable;
  • 2. every symbol of I occurs both in R and B;
slide-20
SLIDE 20

Interpolation Through Colors

◮ There are three colors: red, blue and grey.

slide-21
SLIDE 21

Interpolation Through Colors

◮ There are three colors: red, blue and grey. ◮ Each symbol (function or predicate) is colored in exactly one of

these colors.

slide-22
SLIDE 22

Interpolation Through Colors

◮ There are three colors: red, blue and grey. ◮ Each symbol (function or predicate) is colored in exactly one of

these colors.

◮ We have two formulas: R and B. ◮ Each symbol in R is either red or grey. ◮ Each symbol in B is either blue or grey.

slide-23
SLIDE 23

Interpolation Through Colors

◮ There are three colors: red, blue and grey. ◮ Each symbol (function or predicate) is colored in exactly one of

these colors.

◮ We have two formulas: R and B. ◮ Each symbol in R is either red or grey. ◮ Each symbol in B is either blue or grey. ◮ We know that ⊢ R → B. ◮ Our goal is to find a grey formula I such that:

  • 1. ⊢ R → I;
  • 2. ⊢ I → B.
slide-24
SLIDE 24

Interpolation with Theories

◮ Theory T: any set of closed green formulas. ◮ C1, . . . , Cn ⊢T C denotes that the formula C1 ∧ . . . ∧ C1 → C

holds in all models of T.

◮ Interpreted symbols: symbols occurring in T. ◮ Uninterpreted symbols: all other symbols.

slide-25
SLIDE 25

Interpolation with Theories

◮ Theory T: any set of closed green formulas. ◮ C1, . . . , Cn ⊢T C denotes that the formula C1 ∧ . . . ∧ C1 → C

holds in all models of T.

◮ Interpreted symbols: symbols occurring in T. ◮ Uninterpreted symbols: all other symbols.

Theorem

Let R, B be formulas and let R ⊢T B. Then there exists a formula I such that

  • 1. R ⊢T I and I ⊢ B;
  • 2. every uninterpreted symbol of I occurs both in R and B;
  • 3. every interpreted symbol of I occurs in B.

Likewise, there exists a formula I such that

  • 1. R ⊢ I and I ⊢T B;
  • 2. every uninterpreted symbol of I occurs both in R and B;
  • 3. every interpreted symbol of I occurs in R.
slide-26
SLIDE 26

Local Derivations

A derivation is called local (well-colored) if each inference in it C1 · · · Cn C either has no blue symbols or has no red symbols. That is, one cannot mix blue and red in the same inference.

slide-27
SLIDE 27

Local Derivations: Example

◮ R := ∀x(x = a) ◮ B := c = b ◮ Interpolant: ∀x∀y(x = y) (note: universally quantified!)

slide-28
SLIDE 28

Local Derivations: Example

◮ R := ∀x(x = a) ◮ B := c = b ◮ Interpolant: ∀x∀y(x = y) (note: universally quantified!)

x =a c=a x =a b=a c=b c=b ⊥

slide-29
SLIDE 29

Local Derivations: Example

◮ R := ∀x(x = a) ◮ B := c = b ◮ Interpolant: ∀x∀y(x = y) (note: universally quantified!)

Non-local proof x =a c=a x =a b=a c=b c=b ⊥

slide-30
SLIDE 30

Local Derivations: Example

◮ R := ∀x(x = a) ◮ B := c = b ◮ Interpolant: ∀x∀y(x = y) (note: universally quantified!)

Non-local proof Local Proof x =a c=a x =a b=a c=b c=b ⊥ x =a y =a x = y c=b y =b ⊥

slide-31
SLIDE 31

Shape of a local derivation

slide-32
SLIDE 32

Symbol Eliminating Inference

◮ At least one of the premises is not grey. ◮ The conclusion is grey.

x = a y = a x = y c = b y = b ⊥

slide-33
SLIDE 33

Extracting Interpolants from Local Proofs

slide-34
SLIDE 34

Extracting Interpolants from Local Proofs

G1 G2 G3 G4

Interpolant: boolean combination of {G1, . . . , G4}

[McMillan05, KV09]

slide-35
SLIDE 35

Extracting Interpolants from Local Proofs

G1 G2 G3 G4

Digest Interpolant: boolean combination of {G1, . . . , G4}

slide-36
SLIDE 36

Extracting Interpolants from Local Proofs

G is in the digest:

  • comes from a red block
  • followed by a blue or grey block

G1 G2 G3 G4

Digest Interpolant: boolean combination of {G1, . . . , G4}

slide-37
SLIDE 37

Extracting Interpolants from Local Proofs

G is in the digest:

  • comes from a red block
  • followed by a blue or grey block
  • r
  • comes from a blue block
  • followed by a red

G1 G2 G3 G4

Digest Interpolant: boolean combination of {G1, . . . , G4}

slide-38
SLIDE 38

Extracting Interpolants from Local Proofs

Theorem

Let Π be a local refutation. Then one can extract from Π in linear time a reverse interpolant I of R and B. This interpolant is ground if all formulas in Π are ground.

slide-39
SLIDE 39

Extracting Interpolants from Local Proofs

Theorem

Let Π be a local refutation. Then one can extract from Π in linear time a reverse interpolant I of R and B. This interpolant is ground if all formulas in Π are ground. This reverse interpolant is a boolean combination of conclusions of symbol-eliminating inferences of Π.

slide-40
SLIDE 40

Extracting Interpolants from Local Proofs

Theorem

Let Π be a local refutation. Then one can extract from Π in linear time a reverse interpolant I of R and B. This interpolant is ground if all formulas in Π are ground. This reverse interpolant is a boolean combination of conclusions of symbol-eliminating inferences of Π. What is remarkable in this theorem:

◮ No restriction on the calculus (only soundness required) – can be

used with theories.

◮ Can generate interpolants in theories where no good

interpolation algorithms exist.

slide-41
SLIDE 41

Interpolation: Examples in Vampire

Our running example: Local proof and interpolant: vampire interpol1.p Non-local proof: vampire interpol2.p

slide-42
SLIDE 42

What is Vampire?

An automated theorem prover for first-order logic and theories. https://vprover.github.io/download.html

slide-43
SLIDE 43

What is Vampire?

An automated theorem prover for first-order logic and theories. https://vprover.github.io/download.html ◮ Completely automatic: once you started a proof attempt, it can only be interrupted by terminating the process.

slide-44
SLIDE 44

What is Vampire?

An automated theorem prover for first-order logic and theories. https://vprover.github.io/download.html ◮ Completely automatic: once you started a proof attempt, it can only be interrupted by terminating the process. ◮ Champion of the CASC world-cup in first-order theorem proving: won CASC >45 times.

slide-45
SLIDE 45

Vampire:

⊲ It produces detailed proofs but also supports finding finite models ⊲ In normal operation it is saturation-based - it saturates a clausal form with respect to an inference system ⊲ It is portfolio-based - it works best when you allow it to try lots

  • f strategies

⊲ It supports lots of extra features and options

slide-46
SLIDE 46

Vampire:

⊲ It produces detailed proofs but also supports finding finite models ⊲ It competes with SMT solvers on their problems (thanks to our

FOOL logic and AVATAR)

⊲ In normal operation it is saturation-based - it saturates a clausal form with respect to an inference system ⊲ It is portfolio-based - it works best when you allow it to try lots

  • f strategies

⊲ It supports lots of extra features and options helpful for program analysis by symbol elimination

slide-47
SLIDE 47

Interpolation: Examples in Vampire

Our running example: Local proof and interpolant: vampire interpol1.p Non-local proof: vampire interpol2.p

slide-48
SLIDE 48

Interpolation: Examples in Vampire

fof(fA,axiom, q(f(a)) & ˜q(f(b)) ). fof(fB,conjecture, ?[V]: V != c). Non-local proof: vampire interpol4.p

slide-49
SLIDE 49

Interpolation: Examples in Vampire

% request to generate an interpolant vampire(option,show_interpolant,on). % symbol coloring vampire(symbol,predicate,q,1,left). vampire(symbol,function,f,1,left). vampire(symbol,function,a,0,left). vampire(symbol,function,b,0,left). vampire(symbol,function,c,0,right). % formula R vampire(left_formula). fof(fA,axiom, q(f(a)) & ˜q(f(b)) ). vampire(end_formula). % formula B vampire(right_formula). fof(fB,conjecture, ?[V]: V != c). vampire(end_formula). Local proof and interpolant: vampire interpol3.p

slide-50
SLIDE 50

Outline

Interpolation and Local Proofs Localizing Proofs Minimizing Interpolants Quantifier Complexity of Interpolants

slide-51
SLIDE 51

Localizing Proofs

Task: eliminate non-local inferences

slide-52
SLIDE 52

Localizing Proofs

Task: eliminate non-local inferences

Idea: quantify away colored symbols ↓ Idea: colored symbols replaced by logical variables.

slide-53
SLIDE 53

Localizing Proofs

Task: eliminate non-local inferences

Idea: quantify away colored symbols ↓ Idea: colored symbols replaced by logical variables. Given R(a) ⊢ B where a is an uninterpreted constant not occurring in B. Then, R(a) ⊢ (∃x)R(x) and (∃x)R(x) ⊢ B.

slide-54
SLIDE 54

Localizing Proofs

Task: eliminate non-local inferences

Idea: quantify away colored symbols ↓ Idea: colored symbols replaced by logical variables. Given R(a) ⊢ B where a is an uninterpreted constant not occurring in B. Then, R(a) ⊢ (∃x)R(x) and (∃x)R(x) ⊢ B. R1(a) R2(a) B A R1(a) (∃x)R2(x) B A

slide-55
SLIDE 55

Localizing Proofs

Task: eliminate non-local inferences

Idea: quantify away colored symbols ↓ Idea: colored symbols replaced by logical variables. Cons: Comes at the cost of using extra quantifiers. Given R(a) ⊢ B where a is an uninterpreted constant not occurring in B. Then, R(a) ⊢ (∃x)R(x) and (∃x)R(x) ⊢ B. R1(a) R2(a) B A R1(a) (∃x)R2(x) B A

slide-56
SLIDE 56

Localizing Proofs

Task: eliminate non-local inferences

Idea: quantify away colored symbols ↓ Idea: colored symbols replaced by logical variables. Cons: Comes at the cost of using extra quantifiers. But we can minimise the number of quantifiers in the interpolant. Given R(a) ⊢ B where a is an uninterpreted constant not occurring in B. Then, R(a) ⊢ (∃x)R(x) and (∃x)R(x) ⊢ B. R1(a) R2(a) B A R1(a) (∃x)R2(x) B A

slide-57
SLIDE 57

Outline

Interpolation and Local Proofs Localizing Proofs Minimizing Interpolants Quantifier Complexity of Interpolants

slide-58
SLIDE 58

Minimizing Interpolants

Our Interest: Small Interpolants

◮ in size; ◮ in weight; ◮ in the number of quantifiers; ◮ . . .

slide-59
SLIDE 59

Minimizing Interpolants

Our Interest: Small Interpolants

◮ in size; ◮ in weight; ◮ in the number of quantifiers; ◮ . . .

Given ⊢ R → B, find a grey formula I: ⊢ R → I; ⊢ I → B; I is small.

slide-60
SLIDE 60

Minimizing Interpolant

Task: minimise interpolants = minimise digest

slide-61
SLIDE 61

Minimizing Interpolant

Task: minimise interpolants = minimise digest

slide-62
SLIDE 62

Minimizing Interpolant

Task: minimise interpolants = minimise digest

Hercule Poirot: It is the little GREY CELLS, mon ami, on which one must rely. Mon Dieu, mon ami, but use your little GREY CELLS!

slide-63
SLIDE 63

Minimizing Interpolant

Task: minimise interpolants = minimise digest

slide-64
SLIDE 64

Minimizing Interpolant

Task: minimise interpolants = minimise digest

Idea: Change the grey areas of the local proof

slide-65
SLIDE 65

Minimizing Interpolant

Task: minimise interpolants = minimise digest

Idea: Change the grey areas of the local proof Slicing off formulas

A1 · · · An An+1 · · · Am A A0

− →

slicing off A

A1 · · · An An+1 · · · Am A0

slide-66
SLIDE 66

Minimizing Interpolant

Task: minimise interpolants = minimise digest

Idea: Change the grey areas of the local proof Slicing off formulas

A1 · · · An An+1 · · · Am A A0

− →

slicing off A

A1 · · · An An+1 · · · Am A0 If A is grey: Grey slicing

slide-67
SLIDE 67

Minimizing Interpolant

Task: minimise interpolants = minimise digest

Idea: Change the grey areas of the local proof Slicing off formulas

B0 R0 G1 G0

− →

slicing off G1

B0 R0 G0 If A is grey: Grey slicing

slide-68
SLIDE 68

Minimizing Interpolant

Task: minimise interpolants = minimise digest

Idea: Change the grey areas of the local proof, but preserve locality! Slicing off formulas

B0 R0 G1 G0

− →

slicing off G1

B0 R0 G0 If A is grey: Grey slicing

slide-69
SLIDE 69

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥

slide-70
SLIDE 70

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥ Digest: {G4, G7} Reverse interpolant: G4 → G7

slide-71
SLIDE 71

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥

slide-72
SLIDE 72

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥ Digest: {G5, G7} Reverse interpolant: G5 → G7

slide-73
SLIDE 73

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥

slide-74
SLIDE 74

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥ Digest: {G6, G7} Reverse interpolant: G6 → G7

slide-75
SLIDE 75

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥

slide-76
SLIDE 76

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥ Digest: {G6} Reverse interpolant: ¬G6

slide-77
SLIDE 77

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥ Note that the interpolant has changed from G4 → G7 to ¬G6.

slide-78
SLIDE 78

Minimizing Interpolant

R3 R1 G1 G3 B1 G2 G4 G5 G6 R4 G7 ⊥ Note that the interpolant has changed from G4 → G7 to ¬G6.

◮ There is no obvious logical relation between G4 → G7 and ¬G6,

for example none of these formulas implies the other one;

◮ These formulas may even have no common atoms or no

common symbols.

slide-79
SLIDE 79

Minimizing Interpolant

If grey slicing gives us very different interpolants, we can use it for finding small interpolants. Problem: if the proof contains n grey formulas, the number of possible different slicing off transformations is 2n.

slide-80
SLIDE 80

Minimizing Interpolant

If grey slicing gives us very different interpolants, we can use it for finding small interpolants. Problem: if the proof contains n grey formulas, the number of possible different slicing off transformations is 2n.

slide-81
SLIDE 81

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

slide-82
SLIDE 82

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3

slide-83
SLIDE 83

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 G3, and at most one of G1, G2 can be sliced off.

slide-84
SLIDE 84

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Some predicates on grey for- mulas:

◮ sliced(G): G was sliced

  • ff;

◮ red(G): the trace of G

contains a red formula;

◮ blue(G): the trace of G

contains a blue formula;

◮ grey(G): the trace of G

contains only grey formulas;

◮ digest(G): G belongs to

the digest.

slide-85
SLIDE 85

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Some predicates on grey for- mulas:

◮ sliced(G): G was sliced

  • ff;

◮ red(G): the trace of G

contains a red formula;

◮ blue(G): the trace of G

contains a blue formula;

◮ grey(G): the trace of G

contains only grey formulas;

◮ digest(G): G belongs to

the digest. ¬sliced(G1) → grey(G1) sliced(G1) → red(G1)

slide-86
SLIDE 86

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Some predicates on grey for- mulas:

◮ sliced(G): G was sliced

  • ff;

◮ red(G): the trace of G

contains a red formula;

◮ blue(G): the trace of G

contains a blue formula;

◮ grey(G): the trace of G

contains only grey formulas;

◮ digest(G): G belongs to

the digest. ¬sliced(G3) → grey(G3) sliced(G3) → (grey(G3) ↔ grey(G1) ∧ grey(G2)) sliced(G3) → (red(G3) ↔ red(G1) ∨ red(G2)) sliced(G3) → (blue(G3) ↔ blue(G1) ∨ blue(G2))

slide-87
SLIDE 87

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Some predicates on grey for- mulas:

◮ sliced(G): G was sliced

  • ff;

◮ red(G): the trace of G

contains a red formula;

◮ blue(G): the trace of G

contains a blue formula;

◮ grey(G): the trace of G

contains only grey formulas;

◮ digest(G): G belongs to

the digest. digest(G1) → ¬sliced(G1)

slide-88
SLIDE 88

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Some predicates on grey for- mulas:

◮ sliced(G): G was sliced

  • ff;

◮ red(G): the trace of G

contains a red formula;

◮ blue(G): the trace of G

contains a blue formula;

◮ grey(G): the trace of G

contains only grey formulas;

◮ digest(G): G belongs to

the digest. ¬sliced(G1) → grey(G1) sliced(G1) → red(G1) ¬sliced(G3) → grey(G3) sliced(G3) → (grey(G3) ↔ grey(G1) ∧ grey(G2)) sliced(G3) → (red(G3) ↔ red(G1) ∨ red(G2)) sliced(G3) → (blue(G3) ↔ blue(G1) ∨ blue(G2)) digest(G1) → ¬sliced(G1) · · ·

slide-89
SLIDE 89

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Express digest(G)

slide-90
SLIDE 90

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Express digest(G) by considering the possibilities:

◮ G comes from a

red/ blue/ grey formula

◮ G is followed by a

red/ blue/ grey formula

slide-91
SLIDE 91

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Express digest(G) by considering the possibilities:

◮ G comes from a

red/ blue/ grey formula

rc(G)/bc(G)

◮ G is followed by a

red/ blue/ grey formula

bf(G)/rf(G)

slide-92
SLIDE 92

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Express digest(G) by considering the possibilities:

◮ G comes from a

red/ blue/ grey formula

rc(G)/bc(G)

◮ G is followed by a

red/ blue/ grey formula

bf(G)/rf(G)

digest(G3) ↔ (rc(G3) ∧ rf(G3)) ∨ (bc(G3) ∧ bf(G3)) rc(G3) ↔ (¬sliced(G3) ∧ (red(G1) ∨ red(G2))

slide-93
SLIDE 93

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Express digest(G) by considering the possibilities:

◮ G comes from a

red/ blue/ grey formula

rc(G)/bc(G)

◮ G is followed by a

red/ blue/ grey formula

bf(G)/rf(G)

¬sliced(G1) → grey(G1) sliced(G1) → red(G1) ¬sliced(G3) → grey(G3) sliced(G3) → (grey(G3) ↔ grey(G1) ∧ grey(G2)) sliced(G3) → (red(G3) ↔ red(G1) ∨ red(G2)) sliced(G3) → (blue(G3) ↔ blue(G1) ∨ blue(G2)) digest(G1) → ¬sliced(G1) digest(G3) ↔ (rc(G3) ∧ rf(G3)) ∨ (bc(G3) ∧ bf(G3)) rc(G3) ↔ (¬sliced(G3) ∧ (red(G1) ∨ red(G2)) · · ·

slide-94
SLIDE 94

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT ◮ solutions encode all slicing off transformations

R G1 B G2 G3 Express digest(G) by considering the possibilities:

◮ G comes from a

red/ blue/ grey formula

rc(G)/bc(G)

◮ G is followed by a

red/ blue/ grey formula

bf(G)/rf(G)

¬sliced(G1) → grey(G1) sliced(G1) → red(G1) ¬sliced(G3) → grey(G3) sliced(G3) → (grey(G3) ↔ grey(G1) ∧ grey(G2)) sliced(G3) → (red(G3) ↔ red(G1) ∨ red(G2)) sliced(G3) → (blue(G3) ↔ blue(G1) ∨ blue(G2)) digest(G1) → ¬sliced(G1) digest(G3) ↔ (rc(G3) ∧ rf(G3)) ∨ (bc(G3) ∧ bf(G3)) rc(G3) ↔ (¬sliced(G3) ∧ (red(G1) ∨ red(G2)) · · ·

slide-95
SLIDE 95

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT; ◮ solutions encode all slicing off transformations; ◮ compute small interpolants: smallest digest of grey formulas;

min{Gi1,...,Gin }

Gi

digest(Gi)

  • ◮ use a pseudo-boolean optimisation tool or an SMT solver to

minimise interpolants;

◮ minimising interpolants is an NP-complete problem.

slide-96
SLIDE 96

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT; ◮ solutions encode all slicing off transformations; ◮ compute small interpolants: smallest digest of grey formulas;

min{Gi1,...,Gin }

Gi

digest(Gi)

  • ◮ use a pseudo-boolean optimisation tool or an SMT solver to

minimise interpolants;

◮ minimising interpolants is an NP-complete problem.

slide-97
SLIDE 97

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT; ◮ solutions encode all slicing off transformations; ◮ compute small interpolants: smallest digest of grey formulas;

min{Gi1,...,Gin }

Gi

digest(Gi)

  • min{Gi1,...,Gin }

Gi

quantifier number(Gi) digest(Gi)

  • ◮ use a pseudo-boolean optimisation tool or an SMT solver to

minimise interpolants;

◮ minimising interpolants is an NP-complete problem.

slide-98
SLIDE 98

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT; ◮ solutions encode all slicing off transformations; ◮ compute small interpolants: smallest digest of grey formulas;

min{Gi1,...,Gin }

Gi

digest(Gi)

  • min{Gi1,...,Gin }

Gi

quantifier number(Gi) digest(Gi)

  • ◮ use a pseudo-boolean optimisation tool or an SMT solver to

minimise interpolants;

◮ minimising interpolants is an NP-complete problem.

slide-99
SLIDE 99

Minimizing Interpolant

Solution:

◮ encode all sequences of transformations as an instance of SAT; ◮ solutions encode all slicing off transformations; ◮ compute small interpolants: smallest digest of grey formulas;

min{Gi1,...,Gin }

Gi

digest(Gi)

  • min{Gi1,...,Gin }

Gi

quantifier number(Gi) digest(Gi)

  • ◮ use a pseudo-boolean optimisation tool or an SMT solver to

minimise interpolants;

◮ minimising interpolants is an NP-complete problem.

slide-100
SLIDE 100

Experiments with Small Interpolants

◮ Implemented in Vampire; ◮ We used Yices for solving pseudo-boolean constraints; ◮ Experimental results:

◮ 9632 first-order examples from the TPTP library:

for example, for 2000 problems the size of the interpolants became 20-49 times smaller;

◮ 4347 SMT examples: ◮ we used Z3 for proving SMT examples; ◮ Z3 proofs were localised in Vampire; ◮ small interpolants were generated for 2123 SMT examples.

slide-101
SLIDE 101

Experiments with Small Interpolants

◮ Implemented in Vampire; ◮ We used Yices for solving pseudo-boolean constraints; ◮ Experimental results:

◮ 9632 first-order examples from the TPTP library:

for example, for 2000 problems the size of the interpolants became 20-49 times smaller;

◮ 4347 SMT examples: ◮ we used Z3 for proving SMT examples; ◮ Z3 proofs were localised in Vampire; ◮ small interpolants were generated for 2123 SMT examples.

slide-102
SLIDE 102

Experiments with Small Interpolants

◮ Implemented in Vampire; ◮ We used Yices for solving pseudo-boolean constraints; ◮ Experimental results:

◮ 9632 first-order examples from the TPTP library:

for example, for 2000 problems the size of the interpolants became 20-49 times smaller;

◮ 4347 SMT examples: ◮ we used Z3 for proving SMT examples; ◮ Z3 proofs were localised in Vampire; ◮ small interpolants were generated for 2123 SMT examples.

slide-103
SLIDE 103

Outline

Interpolation and Local Proofs Localizing Proofs Minimizing Interpolants Quantifier Complexity of Interpolants

slide-104
SLIDE 104

Quantifier Complexity of Interpolants

Local Proofs Do Not Always Exist

◮ R: (∀x)p(r, x) ◮ B: (∀y)¬p(y, b) ◮ Reverse interpolant I of R and B: (∃y)(∀x)p(y, x). ◮ Note: R and B contain no quantifier alternations, yet I contains

quantifier alternations. One can prove that every interpolant of this formula must have at least one quantifier alternation.

◮ There is no local refutation of R, B in the resolution/superposition

calculus.

◮ There is a non-local one:

p(r, x) ¬p(y, b) ⊥

slide-105
SLIDE 105

Quantifier Complexity of Interpolants

Local Proofs Do Not Always Exist

◮ R: (∀x)p(r, x) ◮ B: (∀y)¬p(y, b) ◮ Reverse interpolant I of R and B: (∃y)(∀x)p(y, x). ◮ Note: R and B contain no quantifier alternations, yet I contains

quantifier alternations. One can prove that every interpolant of this formula must have at least one quantifier alternation.

◮ There is no local refutation of R, B in the resolution/superposition

calculus.

◮ There is a non-local one:

p(r, x) ¬p(y, b) ⊥

slide-106
SLIDE 106

Quantifier Complexity of Interpolants

Local Proofs Do Not Always Exist

◮ R: (∀x)p(r, x) ◮ B: (∀y)¬p(y, b) ◮ Reverse interpolant I of R and B: (∃y)(∀x)p(y, x). ◮ Note: R and B contain no quantifier alternations, yet I contains

quantifier alternations. One can prove that every interpolant of this formula must have at least one quantifier alternation.

◮ There is no local refutation of R, B in the resolution/superposition

calculus.

◮ There is a non-local one:

p(r, x) ¬p(y, b) ⊥

slide-107
SLIDE 107

Quantifier Complexity of Interpolants

Theorem There is no lower bound on the number of quantifier alternations in interpolants of universal sentences. That is, for every positive integer n there exist universal sentences R, B such that {R, B} is unsatisfiable and every reverse interpolant of R and B has at least n quantifier alternations.

slide-108
SLIDE 108

Quantifier Complexity of Interpolants

Example

Take the formula A: ∀x1∃y1∀x1∃y2 . . . p(x1, y1, x2, y2, . . .) and let R be

  • btained by skolemizing A and B be obtained by skolemizing ¬A:

R = ∀x1∀x2 . . . p(x1, r1(x1), x2, r2(x1, x2), . . .) B = ∀y1∀y2 . . . ¬p(b1, y1, b2(y1), y2, . . .) I = ∀x1∃y1∀x2∃y2 . . . p(x1, y1, x2, y2, . . .) There is no reverse interpolant with a smaller number of quantifier alternations. The resolution refutation consists of a single step deriving the empty clause from R and B.

slide-109
SLIDE 109

Quantifier Complexity of Interpolants

Example

Take the formula A: ∀x1∃y1∀x1∃y2 . . . p(x1, y1, x2, y2, . . .) and let R be

  • btained by skolemizing A and B be obtained by skolemizing ¬A:

R = ∀x1∀x2 . . . p(x1, r1(x1), x2, r2(x1, x2), . . .) B = ∀y1∀y2 . . . ¬p(b1, y1, b2(y1), y2, . . .) I = ∀x1∃y1∀x2∃y2 . . . p(x1, y1, x2, y2, . . .) There is no reverse interpolant with a smaller number of quantifier alternations. The resolution refutation consists of a single step deriving the empty clause from R and B.

slide-110
SLIDE 110

Quantifier Complexity of Interpolants

Example

Take the formula A: ∀x1∃y1∀x1∃y2 . . . p(x1, y1, x2, y2, . . .) and let R be

  • btained by skolemizing A and B be obtained by skolemizing ¬A:

R = ∀x1∀x2 . . . p(x1, r1(x1), x2, r2(x1, x2), . . .) B = ∀y1∀y2 . . . ¬p(b1, y1, b2(y1), y2, . . .) I = ∀x1∃y1∀x2∃y2 . . . p(x1, y1, x2, y2, . . .) There is no reverse interpolant with a smaller number of quantifier alternations. The resolution refutation consists of a single step deriving the empty clause from R and B.

slide-111
SLIDE 111

Quantifier Complexity of Interpolants

Bad News for Local Proof Systems

Let S be an inference system with the following property: for every red formula R and blue formula B, if {R, B} is unsatisfiable, then there is a local refutation of R, B in S. Then the number of quantifier alternations in refutations of universal formulas of S is not bound by any positive integer.

slide-112
SLIDE 112

Quantifier Complexity of Interpolants

◮ There is no bound on the number of quantifier alternations in

reverse interpolants of universal formulas.

◮ Any complete local proof system for first-order predicate logic

must have inferences dealing with formulas of an arbitrary quantifier complexity, even if the input formulas have no quantifier alternations.

◮ There is no simple modification of the superposition calculus for

logic with/without equality in which every unsatisfiable formula has a local refutation.

slide-113
SLIDE 113

Quantifier Complexity of Interpolants

◮ There is no bound on the number of quantifier alternations in

reverse interpolants of universal formulas.

◮ Any complete local proof system for first-order predicate logic

must have inferences dealing with formulas of an arbitrary quantifier complexity, even if the input formulas have no quantifier alternations.

◮ There is no simple modification of the superposition calculus for

logic with/without equality in which every unsatisfiable formula has a local refutation.

slide-114
SLIDE 114

Quantifier Complexity of Interpolants

◮ There is no bound on the number of quantifier alternations in

reverse interpolants of universal formulas.

◮ Any complete local proof system for first-order predicate logic

must have inferences dealing with formulas of an arbitrary quantifier complexity, even if the input formulas have no quantifier alternations.

◮ There is no simple modification of the superposition calculus for

logic with/without equality in which every unsatisfiable formula has a local refutation.