Efficient Interpolant Generation in Satisfiability Modulo Linear - - PowerPoint PPT Presentation

efficient interpolant generation in satisfiability modulo
SMART_READER_LITE
LIVE PREVIEW

Efficient Interpolant Generation in Satisfiability Modulo Linear - - PowerPoint PPT Presentation

Deduction at Scale Seminar 2011 Efficient Interpolant Generation in Satisfiability Modulo Linear Integer Arithmetic Alberto Griggio FBK-IRST, Trento joint work with Thi Thieu Hoa Le and Roberto Sebastiani, DISI - Univ. Trento Introduction


slide-1
SLIDE 1

Deduction at Scale Seminar 2011

Efficient Interpolant Generation in Satisfiability Modulo Linear Integer Arithmetic

Alberto Griggio

FBK-IRST, Trento joint work with Thi Thieu Hoa Le and Roberto Sebastiani, DISI - Univ. Trento

slide-2
SLIDE 2

Introduction

♦ (Craig) Interpolation for ground first-order theories

successfully applied in formal verification

♦ Efficient SMT-based algorithms for several theories and

combinations (e.g. EUF, LA(Q), DL, UTVPI)

♦ Interpolation for full LA(Z) is harder

♦ Some promising recent work [Brillout et al IJCAR'10, Kroening

et al. LPAR'10], but still some drawbacks

♦ This work: propose a novel, general technique for

interpolation in LA(Z)

♦ to overcome some drawbacks of current approaches

slide-3
SLIDE 3

Outline

♦ Background ♦ Current techniques for interpolation in LA(Z) ♦ A novel interpolation technique for LA(Z) ♦ Experimental evaluation

slide-4
SLIDE 4

Background - Interpolants

♦ (Craig) Interpolant for an ordered pair (A, B) of formulas s.t.

is a formula I s.t.

a) b) c) all the uninterpreted (in ) symbols of I occur in both A and B

A j =T I B ^ I j =T ? T A ^ B j =T ?

slide-5
SLIDE 5

Background - Interpolants

♦ Interpolants can be generated from proofs of unsatisfiability

[McMillan]

slide-6
SLIDE 6

Background - Interpolants

♦ Interpolants can be generated from proofs of unsatisfiability

[McMillan]

♦ Proof of unsatisfiability in SMT:

Boolean part (ground resolution)

  • specific part

(for conjunctions of constraints)

T

slide-7
SLIDE 7

Background - Interpolants

♦ Interpolants can be generated from proofs of unsatisfiability

[McMillan]

♦ Proof of unsatisfiability in SMT:

Boolean part (ground resolution)

  • specific part

(for conjunctions of constraints)

T

Standard Boolean interpolation

  • specific

interpolation for conjunctions only

T

slide-8
SLIDE 8

Background - Interpolants

♦ Interpolants can be generated from proofs of unsatisfiability

[McMillan]

♦ Proof of unsatisfiability in SMT:

Boolean part (ground resolution)

  • specific part

(for conjunctions of constraints)

T

Standard Boolean interpolation

  • specific

interpolation for conjunctions only

T

Problem reduced to finding an interpolant for sets of -literals T

slide-9
SLIDE 9

Outline

♦ Background ♦ Current techniques for interpolation in LA(Z) ♦ A novel interpolation technique for LA(Z) ♦ Experimental evaluation

slide-10
SLIDE 10

Interpolation and LA(Z)

♦ Linear Integer Arithmetic: constraints of the form ♦ In general, no quantifier-free interpolation for LA(Z)!

[McMillan05]

♦ Solution: extend the signature to include modular equations

(divisibility predicates)

P

i cixi + c .

/ 0; . / 2 f·; =g A := (y ¡ 2x = 0) B := (y ¡ 2z ¡ 1 = 0)

Example:

9w:(y = 2w)

The only interpolant is:

(t + c =d 0) ´ 9w:(t + c = d ¢ w); d 2 Z>0

The interpolant now becomes: (y =2 0)

slide-11
SLIDE 11

SMT(LA(Z)) with modular equations

♦ Modular equations can be eliminated via preprocessing:

♦ Replace every atom

with a fresh Boolean variable

♦ Add the 4 clauses

where are fresh integer variables

a := (t + c =d 0) pa pa ! (t + c ¡ dw1 = 0) (¡w2 + 1 · 0) (w2 ¡ d + 1 · 0) w1; w2 :pa ! (t + c ¡ dw1 ¡ w2 = 0)

slide-12
SLIDE 12

Interpolation via quantifier elimination

♦ Using modular equation, interpolants can be constructed via

quantifier elimination:

♦ However, this is very expensive, both in theory and in practice

I(A; B) := ExistElim(xi 62 B)(A)

slide-13
SLIDE 13

♦ Cutting-plane proof system: complete proof system for LA(Z)

Hyp ¡ t · 0 Comb t1 · 0 t2 · 0 c1 ¢ t1 + c2 ¢ t2 · 0; c1; c2 > 0 Div P

i cixi + c · 0

P

i ci d xi + d c de · 0; d > 0 divides the ci's

Interpolants from LA(Z)-proofs

slide-14
SLIDE 14

♦ Cutting-plane proof system: complete proof system for LA(Z)

Hyp ¡ t · 0 Comb t1 · 0 t2 · 0 c1 ¢ t1 + c2 ¢ t2 · 0; c1; c2 > 0 Div P

i cixi + c · 0

P

i ci d xi + d c de · 0; d > 0 divides the ci's

Interpolants from LA(Z)-proofs

LA(Q) rules

slide-15
SLIDE 15

♦ Cutting-plane proof system: complete proof system for LA(Z)

Hyp ¡ t · 0 Comb t1 · 0 t2 · 0 c1 ¢ t1 + c2 ¢ t2 · 0; c1; c2 > 0

Interpolants from LA(Z)-proofs

Strenghten P

i cixi + c · 0

P

i cixi + d ¢ d c de · 0; d > 0 divides the ci's

slide-16
SLIDE 16

Interpolants from LA(Z)-proofs

♦ Cutting-plane proof system: complete proof system for LA(Z) ♦ Interpolation by annotating proof rules [McMillan05, Brillout et

  • al. IJCAR'10]

♦ Annotation (in this talk): a set of pairs ♦ When is derived, then

is the computed interpolant

Hyp ¡ t · 0 Comb t1 · 0 t2 · 0 c1 ¢ t1 + c2 ¢ t2 · 0; c1; c2 > 0 fhti · 0; V

j(tij = 0)igi

? Strenghten P

i cixi + c · 0

P

i cixi + d ¢ d c de · 0; d > 0 divides the ci's

I := W

i(ti · 0 ^ V j ExistElim(xi 62 B):(tij = 0))

slide-17
SLIDE 17

Interpolants from cutting-plane proofs

♦ Annotations for Hyp and Comb from [McMillan05]

(same as LA(Q))

♦ k-Strengthen rule of [Brillout et al. IJCAR'10] (special case)

Hyp ¡ t · 0 [fht0 · 0; >ig] t0 = ½ t if t · 0 2 A 0 if t · 0 2 B Comb t1 · 0 [I1] t2 · 0 [I2] c1 ¢ t1 + c2 ¢ t2 · 0 [I] I := fhc1t0

i + c2t0 j · 0; Ei ^ Eji j ht0 i; Eii 2 I1; ht0 j; Eji 2 I2g

Str. P

i cixi + c · 0 [fht · 0; >ig]

P

i cixi + d ¢ d c de · 0 [I]

; d > 0 divides the ci's I := fh(t + n · 0); (t + n = 0)i j 0 · n < d ¢ d c

de ¡ cg[

fh(t + d ¢ d c

de ¡ c · 0); >ig

slide-18
SLIDE 18

Interpolants from cutting-plane proofs

♦ Annotations for Hyp and Comb from [McMillan05]

(same as LA(Q))

♦ k-Strengthen rule of [Brillout et al. IJCAR'10] (special case)

Comb t1 · 0 [I1] t2 · 0 [I2] c1 ¢ t1 + c2 ¢ t2 · 0 [I] I := fhc1t0

i + c2t0 j · 0; Ei ^ Eji j ht0 i; Eii 2 I1; ht0 j; Eji 2 I2g

Str. P

i cixi + c · 0 [fht · 0; >ig]

P

i cixi + d ¢ d c de · 0 [I]

; d > 0 divides the ci's I := fh(t + n · 0); (t + n = 0)i j 0 · n < d ¢ d c

de ¡ cg[

fh(t + d ¢ d c

de ¡ c · 0); >ig

Hyp ¡ t · 0 [fht · 0; >ig] t0 = ½ t if t · 0 2 A 0 if t · 0 2 B

slide-19
SLIDE 19

Interpolants from cutting-plane proofs

♦ Annotations for Hyp and Comb from [McMillan05]

(same as LA(Q))

♦ k-Strengthen rule of [Brillout et al. IJCAR'10] (special case)

Comb t1 · 0 [I1] t2 · 0 [I2] c1 ¢ t1 + c2 ¢ t2 · 0 [I] I := fhc1t0

i + c2t0 j · 0; Ei ^ Eji j ht0 i; Eii 2 I1; ht0 j; Eji 2 I2g

Str. P

i cixi + c · 0 [fht · 0; >ig]

P

i cixi + d ¢ d c de · 0 [I]

; d > 0 divides the ci's I := fh(t + n · 0); (t + n = 0)i j 0 · n < d ¢ d c

de ¡ cg[

fh(t + d ¢ d c

de ¡ c · 0); >ig

Hyp ¡ t · 0 [fh0 · 0; >ig] t0 = ½ t if t · 0 2 A 0 if t · 0 2 B

slide-20
SLIDE 20

Example [Kroening et al. LPAR'10]

B := ½ ¡y ¡ 4z + 1 · 0 y + 4z ¡ 2 · 0 A := ½ ¡y ¡ 4x ¡ 1 · 0 y + 4x · 0

y + 4x · 0 ¡y ¡ 4z + 1 · 0 4x ¡ 4z + 1 · 0 4x ¡ 4z + 1 + 3 · 0 ¡y ¡ 4x ¡ 1 · 0 y + 4z ¡ 2 · 0 ¡4x + 4z ¡ 3 · 0 (1 · 0) ´ ?

slide-21
SLIDE 21

Example – with annotations

B := ½ ¡y ¡ 4z + 1 · 0 y + 4z ¡ 2 · 0 A := ½ ¡y ¡ 4x ¡ 1 · 0 y + 4x · 0

y + 4x · 0 ¡y ¡ 4z + 1 · 0 4x ¡ 4z + 1 · 0 4x ¡ 4z + 1 + 3 · 0 ¡y ¡ 4x ¡ 1 · 0 y + 4z ¡ 2 · 0 ¡4x + 4z ¡ 3 · 0 (1 · 0) ´ ? [fhy + 4x · 0; >ig] [fh0 · 0; >ig] [fhy + 4x · 0; >ig] [fh0 · 0; >ig] [fh¡y ¡ 4x ¡ 1 · 0; >ig] [fh¡y ¡ 4x ¡ 1 · 0; >ig] [fhn ¡ 1 · 0; y + 4x + n = 0i j 0 · n < 3g [ fh2 ¡ 1 · 0; >ig] [fhy + 4x + n · 0; y + 4x + n = 0i j 0 · n < 3g [ fhy + 4x + 2 · 0; >ig]

slide-22
SLIDE 22

Example – with annotations

B := ½ ¡y ¡ 4z + 1 · 0 y + 4z ¡ 2 · 0 A := ½ ¡y ¡ 4x ¡ 1 · 0 y + 4x · 0

y + 4x · 0 ¡y ¡ 4z + 1 · 0 4x ¡ 4z + 1 · 0 4x ¡ 4z + 1 + 3 · 0 ¡y ¡ 4x ¡ 1 · 0 y + 4z ¡ 2 · 0 ¡4x + 4z ¡ 3 · 0 (1 · 0) ´ ? [fhy + 4x · 0; >ig] [fh0 · 0; >ig] [fhy + 4x · 0; >ig] [fh0 · 0; >ig] [fh¡y ¡ 4x ¡ 1 · 0; >ig] [fh¡y ¡ 4x ¡ 1 · 0; >ig] [fhn ¡ 1 · 0; y + 4x + n = 0i j 0 · n < 3g [ fh2 ¡ 1 · 0; >ig] [fhy + 4x + n · 0; y + 4x + n = 0i j 0 · n < 3g [ fhy + 4x + 2 · 0; >ig]

(y =4 0) _ (y + 1 =4 0)

Interpolant:

slide-23
SLIDE 23

Drawback of Strengthen

♦ Interpolation of Strengthen creates potentially very big

disjunctions

♦ Linear in the strengthening factor ♦ Can be exponential in the size of the proof

k := dd c de ¡ c B := ½ ¡y ¡ 4z + 1 · 0 y + 4z ¡ 2 · 0 A := ½ ¡y ¡ 4x ¡ 1 · 0 y + 4x · 0

Example:

(y =4 0) _ (y + 1 =4 0)

Interpolant:

slide-24
SLIDE 24

Drawback of Strengthen

♦ Interpolation of Strengthen creates potentially very big

disjunctions

♦ Linear in the strengthening factor ♦ Can be exponential in the size of the proof

k := dd c de ¡ c

Example:

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

Interpolant: (y =2n 0) _ (y + 1 =2n 0) _ : : : _ (y =2n n ¡ 1)

slide-25
SLIDE 25

Drawback of Strengthen

♦ Interpolation of Strengthen creates potentially very big

disjunctions

♦ Linear in the strengthening factor ♦ Can be exponential in the size of the proof

♦ The problem are AB-mixed cuts:

k := dd c de ¡ c

Example:

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

Interpolant: (y =2n 0) _ (y + 1 =2n 0) _ : : : _ (y =2n n ¡ 1)

Strengthen P

xi62B cixi + P yj62A cjyj + c · 0

P

xi62B cixi + P yj62A cjyj + d ¢ d c de · 0

slide-26
SLIDE 26

Solution of [Kroening et al. LPAR'10]

♦ Avoid the problem by avoiding mixed cuts

♦ Algorithm based on reduction to LA(Q) + Diophantine equations

♦ Generate interpolants linear in the size of proofs ♦ However, this is a strong restriction:

♦ Forbids use of popular LA(Z) techniques like Gomory cuts, cuts

from proofs [Dillig et al CAV'09], the Omega test [Pugh91]

♦ Might generate much larger proofs

slide-27
SLIDE 27

Solution of [Kroening et al. LPAR'10]

♦ Avoid the problem by avoiding mixed cuts

♦ Algorithm based on reduction to LA(Q) + Diophantine equations

♦ Generate interpolants linear in the size of proofs ♦ However, this is a strong restriction:

♦ Forbids use of popular LA(Z) techniques like Gomory cuts, cuts

from proofs [Dillig et al CAV'09], the Omega test [Pugh91]

♦ Might generate much larger proofs

Example:

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

Same interpolant as with Strengthen In fact, [Kroening et al. LPAR'10] shows this is the only interpolant for (A, B) Without AB-mixed cuts, proof of exponential size

slide-28
SLIDE 28

Solution of [Kroening et al. LPAR'10]

♦ Avoid the problem by avoiding mixed cuts

♦ Algorithm based on reduction to LA(Q) + Diophantine equations

♦ Generate interpolants linear in the size of proofs ♦ However, this is a strong restriction:

♦ Forbids use of popular LA(Z) techniques like Gomory cuts, cuts

from proofs [Dillig et al CAV'09], the Omega test [Pugh91]

♦ Might generate much larger proofs

Example:

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

Same interpolant as with Strengthen In fact, [Kroening et al. LPAR'10] shows this is the only interpolant for (A, B) Without AB-mixed cuts, proof of exponential size Implicit assumption: we are in the signature

Z [ f+; ¢; =; ·g [ f=ggg2Z>0

slide-29
SLIDE 29

Outline

♦ Background ♦ Current techniques for interpolation in LA(Z) ♦ A novel interpolation technique for LA(Z) ♦ Experimental evaluation

slide-30
SLIDE 30

Interpolation with ceilings

♦ Idea: use a different extension of the signature of LA(Z), and

extend also its domain

♦ Introduce the ceiling function [Pudlák '97] ♦ Allow non-variable terms to be non-integers (e.g. )

♦ Much simpler interpolation procedure

♦ Proof annotations are single inequalities

d¢e

x 2

(t · 0)

slide-31
SLIDE 31

Interpolation with ceilings

♦ Idea: use a different extension of the signature of LA(Z), and

extend also its domain

♦ Introduce the ceiling function [Pudlák '97] ♦ Allow non-variable terms to be non-integers (e.g. )

♦ Much simpler interpolation procedure

♦ Proof annotations are single inequalities

d¢e

x 2

(t · 0)

Comb t1 · 0 [t0

1 · 0]

t2 · 0 [t0

2 · 0]

c1 ¢ t1 + c2 ¢ t2 · 0 [c1 ¢ t0

1 + c2 ¢ t0 2 · 0]

d > 0 divides aj; bk; ci

Div P

yj62B ajyj + P zk62A bkzk + P xi2A\B cixi + c

[ P

yj62B ajyj + P xi2A\B c0 ixi + c0]

P

yj62B aj d yj + P zk2B bk d zk + P xi2A\B ci d xi + d c de

[ P

yj62B aj d yj + d P

xi2A\B c0 ixi+c0

d

e]

Hyp ¡ t · 0 [t0 · 0]

slide-32
SLIDE 32

Interpolation with ceilings - example

♦ No blowup of interpolants wrt. the size of the proofs

(1 · 0) ´ ?

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

y + 2nx · 0 ¡y ¡ 2nz + 1 · 0 2nx ¡ 2nz + 1 · 0 ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nz ¡ n · 0 ¡2nx + 2nz ¡ 2n + 1 · 0 2n ¢ (x ¡ z + 1 · 0)

slide-33
SLIDE 33

Interpolation with ceilings - example

♦ No blowup of interpolants wrt. the size of the proofs

(1 · 0) ´ ?

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

y + 2nx · 0 ¡y ¡ 2nz + 1 · 0 2nx ¡ 2nz + 1 · 0 ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nz ¡ n · 0 ¡2nx + 2nz ¡ 2n + 1 · 0 2n ¢ (x ¡ z + 1 · 0) [y + 2nx · 0] [0 · 0] [y + 2nx · 0] [¡y ¡ 2nx ¡ n + 1 · 0] [0 · 0] [¡y ¡ 2nx ¡ n + 1 · 0] [2nd y

2ne ¡ y ¡ n + 1 · 0]

[x + d y

2ne · 0]

slide-34
SLIDE 34

Interpolation with ceilings - example

♦ No blowup of interpolants wrt. the size of the proofs

(1 · 0) ´ ?

A := ½ ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nx · 0 B := ½ ¡y ¡ 2nz + 1 · 0 y + 2nz ¡ n · 0

y + 2nx · 0 ¡y ¡ 2nz + 1 · 0 2nx ¡ 2nz + 1 · 0 ¡y ¡ 2nx ¡ n + 1 · 0 y + 2nz ¡ n · 0 ¡2nx + 2nz ¡ 2n + 1 · 0 2n ¢ (x ¡ z + 1 · 0) [y + 2nx · 0] [0 · 0] [y + 2nx · 0] [¡y ¡ 2nx ¡ n + 1 · 0] [0 · 0] [¡y ¡ 2nx ¡ n + 1 · 0] [2nd y

2ne ¡ y ¡ n + 1 · 0]

Interpolant:

(2nd y

2ne ¡ y ¡ n + 1 · 0)

[x + d y

2ne · 0]

slide-35
SLIDE 35

SMT(LA(Z)) with ceilings

♦ Like modular equations, also ceilings can be eliminated via

preprocessing:

♦ Replace every term

with a fresh integer variable

♦ Add the 2 unit clauses

(encoding the meaning of ceiling: ) where is the least common multiple of the denominators of the coefficients in

dte xdte (l ¢ xdte ¡ l ¢ t + l · 0) (l ¢ t ¡ l ¢ xdte · 0) l t dte ¡ 1 < t · dte

slide-36
SLIDE 36

Outline

♦ Background ♦ Current techniques for interpolation in LA(Z) ♦ A novel interpolation technique for LA(Z) ♦ Experimental evaluation

slide-37
SLIDE 37

Experiments

♦ Implementation on top of MathSAT 5

♦ Use also algorithm for Diophantine equations and Boolean

interpolation algorithm for dealing with Branch and Bound

♦ Implemented both algorithm based on Strengthen (MathSAT-

ModEq) and on ceilings (MathSAT-Ceil)

♦ Use benchmarks that require non-trivial integer reasoning

slide-38
SLIDE 38

Results – Strengthen vs. ceilings

MathSAT-Ceil MathSAT-ModEq Execution Time MathSAT-Ceil MathSAT-ModEq Size of Interpolants

slide-39
SLIDE 39

Thank You