100
Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Isil Dillig, Thomas Dillig, and Alex Aiken Computer Science Department Stanford University

Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts from Proofs:A Complete and Practical Technique forSolving Linear Inequalities over Integers

Isil Dillig, Thomas Dillig, and Alex AikenComputer Science Department

Stanford University

June 26, 2009

Page 2: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Linear Arithmetic over Integers

Problem: Given an m× n matrix A with only integer entries,and a vector ~b ∈ Zn, does

A~x ≤ ~b

have any integer solutions?

Geometric interpretation:Are there any integer pointsinside the polyhedrondefined by A~x ≤ ~b?

Page 3: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Linear Arithmetic over Integers

Problem: Given an m× n matrix A with only integer entries,and a vector ~b ∈ Zn, does

A~x ≤ ~b

have any integer solutions?

Geometric interpretation:Are there any integer pointsinside the polyhedrondefined by A~x ≤ ~b?

Page 4: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Why is This an Important Problem?

Many applications in software verification, compileroptimizations, and model checking require determining thesatisfiability of a system of linear integer inequalities.

Verifying buffer accesses: Is integer i usedas an index in the range of the buffer?

Array dependence analysis: Can a[i] anda[j] refer to the same memory location?

Integer overflow checking, RTL-datapathverification, . . .

Page 5: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Why is This an Important Problem?

Many applications in software verification, compileroptimizations, and model checking require determining thesatisfiability of a system of linear integer inequalities.

Verifying buffer accesses: Is integer i usedas an index in the range of the buffer?

Array dependence analysis: Can a[i] anda[j] refer to the same memory location?

Integer overflow checking, RTL-datapathverification, . . .

Page 6: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Why is This an Important Problem?

Many applications in software verification, compileroptimizations, and model checking require determining thesatisfiability of a system of linear integer inequalities.

Verifying buffer accesses: Is integer i usedas an index in the range of the buffer?

Array dependence analysis: Can a[i] anda[j] refer to the same memory location?

Integer overflow checking, RTL-datapathverification, . . .

Page 7: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Why is This an Important Problem?

Many applications in software verification, compileroptimizations, and model checking require determining thesatisfiability of a system of linear integer inequalities.

Verifying buffer accesses: Is integer i usedas an index in the range of the buffer?

Array dependence analysis: Can a[i] anda[j] refer to the same memory location?

Integer overflow checking, RTL-datapathverification, . . .

Page 8: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

The Omega Test:

Automata-based Approaches:

Page 9: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solution

No real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution exists

The Omega Test:

Automata-based Approaches:

Page 10: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solution

Simplex yields integer solution ⇒ integer solution exists

The Omega Test:

Automata-based Approaches:

Page 11: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution exists

The Omega Test:

Automata-based Approaches:

Page 12: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

The Omega Test:

Automata-based Approaches:

Page 13: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

The Omega Test:

Extends the Fourier-Motzkin variable elimination technique forreals to integers.

Eliminates variables one by one until the problem becomesinfeasible or no variables are left.

Automata-based Approaches:

Page 14: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

The Omega Test:

Extends the Fourier-Motzkin variable elimination technique forreals to integers.Eliminates variables one by one until the problem becomesinfeasible or no variables are left.

Automata-based Approaches:

Page 15: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

The Omega Test:

Extends the Fourier-Motzkin variable elimination technique forreals to integers.Eliminates variables one by one until the problem becomesinfeasible or no variables are left.

Automata-based Approaches:

Encode the linear inequality system as an automaton.

System is satisfiable if the language accepted by theautomaton is non-empty.

Page 16: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

The Omega Test:

Extends the Fourier-Motzkin variable elimination technique forreals to integers.Eliminates variables one by one until the problem becomesinfeasible or no variables are left.

Automata-based Approaches:

Encode the linear inequality system as an automaton.System is satisfiable if the language accepted by theautomaton is non-empty.

Page 17: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

Page 18: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

This Talk

A new approach for finding better additionalconstraints to find an integer solution.

Performs orders of magnitude better thanexisting approaches.

Complete, i.e., guaranteed to find an integersolution if one exists.

Page 19: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

This Talk

A new approach for finding better additionalconstraints to find an integer solution.

Performs orders of magnitude better thanexisting approaches.

Complete, i.e., guaranteed to find an integersolution if one exists.

Page 20: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Existing Techniques

Simplex-based Approaches:

Use Simplex to obtain a real-valued solutionNo real solution ⇒ no integer solutionSimplex yields integer solution ⇒ integer solution existsOtherwise, add additional constraints and repeat.

This Talk

A new approach for finding better additionalconstraints to find an integer solution.

Performs orders of magnitude better thanexisting approaches.

Complete, i.e., guaranteed to find an integersolution if one exists.

Page 21: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Motivating Example

Consider the system:

−3x+ 3y + z ≤ −13x− 3y + z ≤ 2

z = 0

This system has no integer solutions.

Page 22: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Motivating Example

Consider the system:

−3x+ 3y + z ≤ −13x− 3y + z ≤ 2

z = 0

Projection of this system ontothe xy plane:

1

1

0x

y

3x-3y=23x-3y=1

This system has no integer solutions.

Page 23: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Motivating Example

Consider the system:

−3x+ 3y + z ≤ −13x− 3y + z ≤ 2

z = 0

Projection of this system ontothe xy plane:

1

1

0x

y

3x-3y=23x-3y=1

This system has no integer solutions.

Page 24: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

How Do Existing Simplex-Based Approaches Deal with thisExample?

The simplest and most common Simplex-based technique isbranch and bound.

Since our algorithm can be seen as a generalization of branchand bound, we will first illustrate this technique.

If Simplex yields a solution with fractional component fi,branch and bound solves two subproblems:

A~x ≤ ~b ∪ {xi ≤ bfic}

Page 25: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

How Do Existing Simplex-Based Approaches Deal with thisExample?

The simplest and most common Simplex-based technique isbranch and bound.

Since our algorithm can be seen as a generalization of branchand bound, we will first illustrate this technique.

If Simplex yields a solution with fractional component fi,branch and bound solves two subproblems:

A~x ≤ ~b ∪ {xi ≤ bfic}

Page 26: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

How Do Existing Simplex-Based Approaches Deal with thisExample?

The simplest and most common Simplex-based technique isbranch and bound.

Since our algorithm can be seen as a generalization of branchand bound, we will first illustrate this technique.

If Simplex yields a solution with fractional component fi,branch and bound solves two subproblems:

A~x ≤ ~b ∪ {xi ≤ bfic}

Page 27: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

How Do Existing Simplex-Based Approaches Deal with thisExample?

The simplest and most common Simplex-based technique isbranch and bound.

Since our algorithm can be seen as a generalization of branchand bound, we will first illustrate this technique.

If Simplex yields a solution with fractional component fi,branch and bound solves two subproblems:

A~x ≤ ~b ∪ {xi ≤ bfic}A~x ≤ ~b ∪ {xi ≥ dfie}

Page 28: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

For instance, supposeSimplex yields the solution

(x, y, z) =(

13, 0, 0

)for the previous problem. 1

1

0x

y

3x-3y=23x-3y=1

Page 29: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

For instance, supposeSimplex yields the solution

(x, y, z) =(

13, 0, 0

)for the previous problem. 1

1

0x

y

3x-3y=23x-3y=1

Page 30: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

Branch and boundconstructs two subproblemswith additional constraintsx ≤ 0 and x ≥ 1

1

1

0x

y

3x-3y=2

3x-3y=1x≤0 x≥1

Page 31: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

For the subproblem wherex ≥ 1, we obtain a newsolution

(x, y, z) =(

1,23, 0)

1

1

0x

y

3x-3y=2

3x-3y=1x≤0 x≥1

Page 32: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

For the subproblem wherex ≥ 1, we obtain a newsolution

(x, y, z) =(

1,23, 0)

1

1

0x

y

3x-3y=2

3x-3y=1x≤0 x≥1

Page 33: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

Now branch and boundconstructs another two newsubproblems with additionalconstraints y ≥ 1 and y ≤ 0,but the solution is stillfractional. 1

1

0x

y

3x-3y=2

3x-3y=1x≤0 x≥1

y≥1

y≤0

Page 34: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

In fact, by only addingplanes parallel to the x andy planes, branch and boundwill never exclude the entirespace and will keepobtaining more and morefractional solutions. 1

1

0x

y

3x-3y=2

3x-3y=1x≤0 x≥1

y≥1

y≤0

Page 35: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Example Using Branch and Bound

While bounds on x and ycan be computed to make itterminate, these bounds areextremely large, makingbranch and boundimpractical on its own.

1

1

0x

y

3x-3y=2

3x-3y=1x≤0 x≥1

y≥1

y≤0

Page 36: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

The Problem with Branch and Bound

Branch and bound only excludes a single fractional point fromthe solution space.

But this fractional point might lie on a k-dimensionalsubspace not containing integer points.

Page 37: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

The Problem with Branch and Bound

Branch and bound only excludes a single fractional point fromthe solution space.But this fractional point might lie on a k-dimensionalsubspace not containing integer points.

Page 38: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

The Problem with Branch and Bound

Branch and bound only excludes a single fractional point fromthe solution space.But this fractional point might lie on a k-dimensionalsubspace not containing integer points.

1

1

0x

y

3x-3y=23x-3y=1 The plane 3x− 3y = 1

does not contain anyinteger points.

Page 39: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

The Problem with Branch and Bound

Branch and bound only excludes a single fractional point fromthe solution space.But this fractional point might lie on a k-dimensionalsubspace not containing integer points.

1

1

0x

y

3x-3y=23x-3y=1 Similarly, 3x− 3y = 2 also

does not contain anyinteger points.

Page 40: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

The Problem with Branch and Bound

Branch and bound only excludes a single fractional point fromthe solution space.But this fractional point might lie on a k-dimensionalsubspace not containing integer points.

Insight

Instead of excluding individual points on thissubspace, we would like to exclude exactlythis k-dimensional subspace.

Our technique systematically identifies andexcludes these higher dimensional subspacescontaining no integer points.

Page 41: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

The Problem with Branch and Bound

Branch and bound only excludes a single fractional point fromthe solution space.But this fractional point might lie on a k-dimensionalsubspace not containing integer points.

Insight

Instead of excluding individual points on thissubspace, we would like to exclude exactlythis k-dimensional subspace.

Our technique systematically identifies andexcludes these higher dimensional subspacescontaining no integer points.

Page 42: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm I

Step 1: When Simplex yields a fractional solution, identify thedefining constraints of this vertex.

Defining constraints of a vertex v are the subset of theinequalities given by A~x ≤ ~b that v satisfies as an equality.

These exist because Simplex always returns points that lie onthe boundary of the polyhedron defined by A~x ≤ ~b.

−3x+ 3y + z ≤ −1 is adefining constraint of(13 , 0, 0) because−3 · 1

3 + 3 · 0 + 0 = −1.

1

1

0x

y

3x-3y=23x-3y=1

Page 43: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm I

Step 1: When Simplex yields a fractional solution, identify thedefining constraints of this vertex.

Defining constraints of a vertex v are the subset of theinequalities given by A~x ≤ ~b that v satisfies as an equality.

These exist because Simplex always returns points that lie onthe boundary of the polyhedron defined by A~x ≤ ~b.

−3x+ 3y + z ≤ −1 is adefining constraint of(13 , 0, 0) because−3 · 1

3 + 3 · 0 + 0 = −1.

1

1

0x

y

3x-3y=23x-3y=1

Page 44: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm I

Step 1: When Simplex yields a fractional solution, identify thedefining constraints of this vertex.

Defining constraints of a vertex v are the subset of theinequalities given by A~x ≤ ~b that v satisfies as an equality.

These exist because Simplex always returns points that lie onthe boundary of the polyhedron defined by A~x ≤ ~b.

−3x+ 3y + z ≤ −1 is adefining constraint of(13 , 0, 0) because−3 · 1

3 + 3 · 0 + 0 = −1.

1

1

0x

y

3x-3y=23x-3y=1

Page 45: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm I

Step 1: When Simplex yields a fractional solution, identify thedefining constraints of this vertex.

Defining constraints of a vertex v are the subset of theinequalities given by A~x ≤ ~b that v satisfies as an equality.

These exist because Simplex always returns points that lie onthe boundary of the polyhedron defined by A~x ≤ ~b.

−3x+ 3y + z ≤ −1 is adefining constraint of(13 , 0, 0) because−3 · 1

3 + 3 · 0 + 0 = −1.

1

1

0x

y

3x-3y=23x-3y=1

Page 46: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm II

Step 2: Determine whether the intersection A′~x = ~b′ of thedefining constraints contains any integer points.

Can be done efficiently.

Step 3a: If the intersection does contain integer points, performconventional branch and bound.

There may be integer points within the feasible region that lieon this intersection.

Page 47: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm II

Step 2: Determine whether the intersection A′~x = ~b′ of thedefining constraints contains any integer points.

Can be done efficiently.

Step 3a: If the intersection does contain integer points, performconventional branch and bound.

There may be integer points within the feasible region that lieon this intersection.

Page 48: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm II

Step 2: Determine whether the intersection A′~x = ~b′ of thedefining constraints contains any integer points.

Can be done efficiently.

Step 3a: If the intersection does contain integer points, performconventional branch and bound.

There may be integer points within the feasible region that lieon this intersection.

Page 49: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm III

Idea:

If the intersection of defining constraints doesnot contain integer solutions, we want to iden-tify the smallest subset of the defining con-straints whose intersection does not contain in-teger solutions.

Smallest subset⇒

Highest dimensional subspace

Page 50: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm IV

Step 3b: If the intersection of definingconstraints does not contain an integer point,compute a proof of unsatisfiability and “brancharound” this proof.

Page 51: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm V

A proof of unsatisfiability P for a system of linear equalities

A′~x = ~b′ is a plane such that:

1 it does not contain any integer points2 it is implied by A′~x = ~b′

Branching around this proof plane ensures that we exclude atleast the intersection of the defining constraints.

Result: If there is a smaller subset of the defining constraintswhose intersection has no integer solution, we will obtain aproof of unsatisfiability for this higher-dimensional intersectionin a finite number of steps.

Page 52: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm V

A proof of unsatisfiability P for a system of linear equalities

A′~x = ~b′ is a plane such that:

1 it does not contain any integer points

2 it is implied by A′~x = ~b′

Branching around this proof plane ensures that we exclude atleast the intersection of the defining constraints.

Result: If there is a smaller subset of the defining constraintswhose intersection has no integer solution, we will obtain aproof of unsatisfiability for this higher-dimensional intersectionin a finite number of steps.

Page 53: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm V

A proof of unsatisfiability P for a system of linear equalities

A′~x = ~b′ is a plane such that:

1 it does not contain any integer points2 it is implied by A′~x = ~b′

Branching around this proof plane ensures that we exclude atleast the intersection of the defining constraints.

Result: If there is a smaller subset of the defining constraintswhose intersection has no integer solution, we will obtain aproof of unsatisfiability for this higher-dimensional intersectionin a finite number of steps.

Page 54: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm V

A proof of unsatisfiability P for a system of linear equalities

A′~x = ~b′ is a plane such that:

1 it does not contain any integer points2 it is implied by A′~x = ~b′

Branching around this proof plane ensures that we exclude atleast the intersection of the defining constraints.

Result: If there is a smaller subset of the defining constraintswhose intersection has no integer solution, we will obtain aproof of unsatisfiability for this higher-dimensional intersectionin a finite number of steps.

Page 55: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Outline of the Cuts-from-Proofs Algorithm V

A proof of unsatisfiability P for a system of linear equalities

A′~x = ~b′ is a plane such that:

1 it does not contain any integer points2 it is implied by A′~x = ~b′

Branching around this proof plane ensures that we exclude atleast the intersection of the defining constraints.

Result: If there is a smaller subset of the defining constraintswhose intersection has no integer solution, we will obtain aproof of unsatisfiability for this higher-dimensional intersectionin a finite number of steps.

Page 56: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Hermite Normal Forms

Charles Hermite

(1822-1901)

We can determine whether the definingconstraints A′~x = ~b′ have an integer solutionand also compute proofs of unsatisfiabilityefficiently (in polynomial time) by using theHermite Normal Form of A′.

Page 57: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Determining whether Defining Constraints Have IntegerSolutions

Compute H, the Hermite normal form of A′, and H−1.

Page 58: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Determining whether Defining Constraints Have IntegerSolutions

Compute H, the Hermite normal form of A′, and H−1.

A′~x = ~b′

Page 59: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Determining whether Defining Constraints Have IntegerSolutions

Compute H, the Hermite normal form of A′, and H−1.

H−1A′~x = H−1~b′

Page 60: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Determining whether Defining Constraints Have IntegerSolutions

Compute H, the Hermite normal form of A′, and H−1.

H−1A′~x = H−1~b′

Important property:

H−1A′ is always integral.

Page 61: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Determining whether Defining Constraints Have IntegerSolutions

Compute H, the Hermite normal form of A′, and H−1.

H−1A′~x = H−1~b′

Important property:

A′~x = ~b′ has integer solutions⇔

H−1~b′ integral.

Page 62: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Computing Proofs of Unsatisfiability

r1. . .ri. . .rm

︸ ︷︷ ︸

H−1A′

~x =

c1. . .ci. . .cm

︸ ︷︷ ︸H−1~b′

Page 63: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Computing Proofs of Unsatisfiability

r1. . .

a1 . . . an

. . .rm

︸ ︷︷ ︸

H−1A′

~x =

c1. . .nidi

. . .cm

︸ ︷︷ ︸H−1~b′

Page 64: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Computing Proofs of Unsatisfiability

r1. . .

a1 . . . an

. . .rm

︸ ︷︷ ︸

H−1A′

~x =

c1. . .nidi

. . .cm

︸ ︷︷ ︸H−1~b′

Proof of Unsatisfiability

A proof of unsatisfiability of A′~x = ~b′ is:

a1di · x1 + . . .+ andi · xn = ni

Page 65: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

Page 66: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

Page 67: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

Then, the closest planes parallel to and on either side ofΣaixi = ci containing integer points are:

Σ(ai/g)xi = bci/gc and Σ(ai/g)xi = dci/ge

Projection of planes containinginteger points on either side of3x− 3y = 1

1

1

0x

y

3x-3y=1

x-y≤0

x-y≥1

Page 68: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

Then, the closest planes parallel to and on either side ofΣaixi = ci containing integer points are:

Σ(ai/g)xi = bci/gc and Σ(ai/g)xi = dci/ge

Projection of planes containinginteger points on either side of3x− 3y = 1

1

1

0x

y

3x-3y=1

x-y≤0

x-y≥1

Page 69: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

“Branching around” the proof of unsatisfiabilty means solvingthe two subproblems:

Page 70: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

“Branching around” the proof of unsatisfiabilty means solvingthe two subproblems:

A~x ≤ ~b ∪ {Σ(ai/g)xi ≤ bci/gc}

Page 71: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Branching around Proofs of Unsatisfiability

Let P = Σaixi = ci be a proof of unsatisfiability for thedefining constraints of a vertex v.

Compute the greatest common divisor g = gcd(a1, . . . , an).

“Branching around” the proof of unsatisfiabilty means solvingthe two subproblems:

A~x ≤ ~b ∪ {Σ(ai/g)xi ≤ bci/gc}A~x ≤ ~b ∪ {Σ(ai/g)xi ≥ dci/ge}

Page 72: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

Consider the vertex (13 , 0, 0)

and its defining constraints:

z = 0−3x+ 3y + z = −1

1

1

0x

y

3x-3y=23x-3y=1

Page 73: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

The system A′~x = ~b′ is:[0 0 1−3 3 1

]~x =

[0−1

]

1

1

0x

y

3x-3y=23x-3y=1

Page 74: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

Multiply both sides by H−1:

13

[3 02 1

] [0 0 1−3 3 1

]~x

= 13

[3 02 1

] [0−1

]1

1

0x

y

3x-3y=23x-3y=1

Page 75: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

Here, H−1A′x = H−1~b is:[0 0 1−1 1 1

]x =

[0−1

3

]

Therefore−3x+ 3y + 3z = −1 is aproof of unsatisfiability.

1

1

0x

y

3x-3y=23x-3y=1

Page 76: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

Here, H−1A′x = H−1~b is:[0 0 1−1 1 1

]x =

[0−1

3

]Therefore−3x+ 3y + 3z = −1 is aproof of unsatisfiability. 1

1

0x

y

3x-3y=23x-3y=1

Page 77: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

The planes closest to and oneither side of the proof plane−3x+ 3y + 3z = −1 are:

−x+ y + z = −1−x+ y + z = 0

1

1

0x

y

3x-3y=23x-3y=1

x-y≤0

x-y≥1

Page 78: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

Therefore, theCuts-from-Proofs algorithmsolves the two subproblemsshown in the figure.

1

1

0x

y

3x-3y=23x-3y=1

x-y≤0

x-y≥1

Page 79: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Cuts-from-Proofs Example

Neither subproblem has areal-valued solution,therefore Cuts-from-Proofsterminates in just one step.

1

1

0x

y

3x-3y=23x-3y=1

x-y≤0

x-y≥1

Page 80: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Completeness

To guarantee completeness, it is necessary to restrict thecoefficients allowed in the proofs of unsatisfiability to amaximum constant α ≥ n · |amax|

n is the number of variables and |amax| the maximum absolutevalue of coefficients in the original matrix A.

This is necessary to prevent the volume “cut” by a proof ofunsatisfiability from becoming infinitesimally small over time.

The constant n · |amax| ensures that if all the proofs ofunsatisfiability with coefficients less than or equal to n · |amax|are added, the system will either become infeasible or itcontains integer points.

Page 81: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Completeness

To guarantee completeness, it is necessary to restrict thecoefficients allowed in the proofs of unsatisfiability to amaximum constant α ≥ n · |amax|

n is the number of variables and |amax| the maximum absolutevalue of coefficients in the original matrix A.

This is necessary to prevent the volume “cut” by a proof ofunsatisfiability from becoming infinitesimally small over time.

The constant n · |amax| ensures that if all the proofs ofunsatisfiability with coefficients less than or equal to n · |amax|are added, the system will either become infeasible or itcontains integer points.

Page 82: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Completeness

To guarantee completeness, it is necessary to restrict thecoefficients allowed in the proofs of unsatisfiability to amaximum constant α ≥ n · |amax|

n is the number of variables and |amax| the maximum absolutevalue of coefficients in the original matrix A.

This is necessary to prevent the volume “cut” by a proof ofunsatisfiability from becoming infinitesimally small over time.

The constant n · |amax| ensures that if all the proofs ofunsatisfiability with coefficients less than or equal to n · |amax|are added, the system will either become infeasible or itcontains integer points.

Page 83: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

We compare the performance of the Cuts-from-Proofsalgorithm against the top four competitors of SMT-COMP’08:Z3, Yices, MathSAT, and CVC3.

Among these tools,

Z3 and Yices use the Simplex-based branch-and-cut algorithm,which is a combination of branch and bound and Gomory’scutting planes method.CVC3 uses the Omega Test.MathSAT uses a combination of branch-and-cut and theOmega test.

We did not compare against tools specialized in mixedinteger-linear programming, such as CPLEX and GLPK

because they do not support infinite precision arithmetic andyield unsound results.

Page 84: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

We compare the performance of the Cuts-from-Proofsalgorithm against the top four competitors of SMT-COMP’08:Z3, Yices, MathSAT, and CVC3.

Among these tools,

Z3 and Yices use the Simplex-based branch-and-cut algorithm,which is a combination of branch and bound and Gomory’scutting planes method.

CVC3 uses the Omega Test.MathSAT uses a combination of branch-and-cut and theOmega test.

We did not compare against tools specialized in mixedinteger-linear programming, such as CPLEX and GLPK

because they do not support infinite precision arithmetic andyield unsound results.

Page 85: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

We compare the performance of the Cuts-from-Proofsalgorithm against the top four competitors of SMT-COMP’08:Z3, Yices, MathSAT, and CVC3.

Among these tools,

Z3 and Yices use the Simplex-based branch-and-cut algorithm,which is a combination of branch and bound and Gomory’scutting planes method.CVC3 uses the Omega Test.

MathSAT uses a combination of branch-and-cut and theOmega test.

We did not compare against tools specialized in mixedinteger-linear programming, such as CPLEX and GLPK

because they do not support infinite precision arithmetic andyield unsound results.

Page 86: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

We compare the performance of the Cuts-from-Proofsalgorithm against the top four competitors of SMT-COMP’08:Z3, Yices, MathSAT, and CVC3.

Among these tools,

Z3 and Yices use the Simplex-based branch-and-cut algorithm,which is a combination of branch and bound and Gomory’scutting planes method.CVC3 uses the Omega Test.MathSAT uses a combination of branch-and-cut and theOmega test.

We did not compare against tools specialized in mixedinteger-linear programming, such as CPLEX and GLPK

because they do not support infinite precision arithmetic andyield unsound results.

Page 87: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

We compare the performance of the Cuts-from-Proofsalgorithm against the top four competitors of SMT-COMP’08:Z3, Yices, MathSAT, and CVC3.

Among these tools,

Z3 and Yices use the Simplex-based branch-and-cut algorithm,which is a combination of branch and bound and Gomory’scutting planes method.CVC3 uses the Omega Test.MathSAT uses a combination of branch-and-cut and theOmega test.

We did not compare against tools specialized in mixedinteger-linear programming, such as CPLEX and GLPK

because they do not support infinite precision arithmetic andyield unsound results.

Page 88: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Implementation

Cuts-from-Proofs is implemented as part of the Mistralconstraint solver.

Mistral implements the combinedtheory of linear integer arithmetic anduninterpreted functions.

Mistral is used to solve large arithmeticconstraints that arise from analyzingunbounded data structures like arrays.

Implementation utilizes an infinite precision arithmetic librarybased on GNU MP

Performs computation natively on 64-bit valuesBut switches to infinite precision representation when overflowis detected.

Page 89: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Implementation

Cuts-from-Proofs is implemented as part of the Mistralconstraint solver.

Mistral implements the combinedtheory of linear integer arithmetic anduninterpreted functions.

Mistral is used to solve large arithmeticconstraints that arise from analyzingunbounded data structures like arrays.

Implementation utilizes an infinite precision arithmetic librarybased on GNU MP

Performs computation natively on 64-bit valuesBut switches to infinite precision representation when overflowis detected.

Page 90: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Implementation

Cuts-from-Proofs is implemented as part of the Mistralconstraint solver.

Mistral implements the combinedtheory of linear integer arithmetic anduninterpreted functions.

Mistral is used to solve large arithmeticconstraints that arise from analyzingunbounded data structures like arrays.

Implementation utilizes an infinite precision arithmetic librarybased on GNU MP

Performs computation natively on 64-bit valuesBut switches to infinite precision representation when overflowis detected.

Page 91: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Implementation

Cuts-from-Proofs is implemented as part of the Mistralconstraint solver.

Mistral implements the combinedtheory of linear integer arithmetic anduninterpreted functions.

Mistral is used to solve large arithmeticconstraints that arise from analyzingunbounded data structures like arrays.

Implementation utilizes an infinite precision arithmetic librarybased on GNU MP

Performs computation natively on 64-bit valuesBut switches to infinite precision representation when overflowis detected.

Page 92: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Implementation

Cuts-from-Proofs is implemented as part of the Mistralconstraint solver.

Mistral implements the combinedtheory of linear integer arithmetic anduninterpreted functions.

Mistral is used to solve large arithmeticconstraints that arise from analyzingunbounded data structures like arrays.

Implementation utilizes an infinite precision arithmetic librarybased on GNU MP

Performs computation natively on 64-bit values

But switches to infinite precision representation when overflowis detected.

Page 93: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Implementation

Cuts-from-Proofs is implemented as part of the Mistralconstraint solver.

Mistral implements the combinedtheory of linear integer arithmetic anduninterpreted functions.

Mistral is used to solve large arithmeticconstraints that arise from analyzingunbounded data structures like arrays.

Implementation utilizes an infinite precision arithmetic librarybased on GNU MP

Performs computation natively on 64-bit valuesBut switches to infinite precision representation when overflowis detected.

Page 94: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

0

200

400

600

800

1000

1200

10 15 20 25 30 35 40 45

Average running time (seconds)

Number of variables

MistralYicesZ3

MathSATCVC3

Number of variables vs. average running time. All systems arerandomly generated inequalities with fixed coefficient size.

Page 95: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

0

200

400

600

800

1000

1200

10 15 20 25 30 35 40 45

Average running time (seconds)

Number of variables

MistralYicesZ3

MathSATCVC3

345s

3.47s

Number of variables vs. average running time. All systems arerandomly generated inequalities with fixed coefficient size.

Page 96: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

0

20

40

60

80

100

10 15 20 25 30 35 40 45

Success rate (%)

Number of variables

MistralYices

Z3MathSAT

CVC3

Number of variables vs. percent of successful runs. All systems arerandomly generated inequalities with fixed coefficient size.

Page 97: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

0

20

40

60

80

100

10 15 20 25 30 35 40 45

Success rate (%)

Number of variables

MistralYices

Z3MathSAT

CVC3

100%

36%

Number of variables vs. percent of successful runs. All systems arerandomly generated inequalities with fixed coefficient size.

Page 98: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Experiments

0.01

0.1

1

10

100

1000

10 20 30 40 50 60 70 80 90 100

Ave

rage running tim

e in

 log sca

le (se

conds)

Maximum Coefficient Size (10 variables, 20 inequalities)

MistralYices

Z3MathSAT

CVC3

Maximum coefficient vs. average running time for a 10x20 system.

Page 99: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Any Questions?

Page 100: Cuts from Proofs: A Complete and Practical …isil/cav2009-talk.pdfCuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers Linear Arithmetic

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Related Work

Pugh, W.:The Omega Test: A Fast and Practical Integer Programming Algorithm for Dependence Analysis.Communications of the ACM (1992)

Ganesh, V., Berezin, S., Dill, D.:Deciding Presburger Arithmetic by Model Checking and Comparisons with Other Methods.In: FMCAD ’02: Proceedings of the 4th International Conference on Formal Methods in Computer-Aided Design,London, UK, Springer-Verlag (2002) 171–186

Nemhauser, G.L., Wolsey, L.:Integer and Combinatorial Optimization.John Wiley & Sons (1988)

Storjohann, A., Labahn, G.:Asymptotically Fast Computation of Hermite Normal Forms of Integer Matrices.In: Proc. Int’l. Symp. on Symbolic and Algebraic Computation: ISSAC ’96, ACM Press (1996) 259–266

Jain, H., Clarke, E., Grumberg, O.:Efficient Craig Interpolation for Linear Diophantine (Dis)equations and Linear Modular Equations.In: CAV ’08, Berlin, Heidelberg, Springer-Verlag (2008) 254–267