29
1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university Technion IBM-HRL

1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

1

A theory-based decision heuristic for DPLL(T)

Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

Page 2: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

2

DPLL

Decide

BCPAnalyze conflict

Backtrack

SAT

UNSAT

full assignment

partial assignment

conflict

Page 3: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

3

DPLL(T)

Decide

BCP

Deduction Add Clauses

Analyze conflict

Backtrack

SAT

UNSAT

full assignment

partial assignment

conflict

T-propagation / T-conflict

Page 4: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

4

Theory propagation

Matters for efficiency, not correctness. Depending on the theory, the best strategy can

be: One T-implication at a time All possible T-implications (“exhaustive theory-

propagation”). Cheap-to-compute T-implications

Page 5: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

5

In this work we are interested in Linear Arithmetic (LA)

We will see: The potential of theory propagation Why doesn’t it work today How can it be approximated efficiently

Theory propagation for LA

Page 6: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

6

A geometric interpretation

Let H be a finite set of hyperplanes in d dimensions. Let n = |H|

An arrangement of H, denoted A(H), is a partition of Rd.

An arrangement in d=2:

# cells · nd

Page 7: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

7

A geometric interpretation

Consider a consistent partial assignment of size r. e.g. assignment to (l1,l2,l3), hence r =3.

How many such T-implications are there ?

2l

3l

l1l4

current partial assignment

(1,0,0)

n = 6r = 3

l5

T-Implied

Page 8: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

8

A geometric interpretation

Consider a consistent partial assignment of size r .

Theorem 1: O((n ¢ log r) /r) of the remaining constraints intersect the cell [HW87] with high probability (1 - 1/rc).

Some example numbers: r = 3, ~47% of the remaining constraints are implied. r = 12, ~70% of the remaining constraints are implied. r = 60, ~90% of the remaining constraints are implied.

[HW87] D. Haussler and E. Welzl. Epsilon-nets and simplex range queries. Comput. Geom., 2:127- 151, 1987.

Page 9: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

9

Assigned vs. implied in practice

Two benchmarks. Measured averages at T-consistent points

Page 10: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

10

Theory propagation for LA

Let l1, l2, l3 be asserted. Is l4 (or :l4) T-implied ?

Two techniques for finding T-implications.

1.“Plunging”: check satisfiability of (l1 Æ l2 Æ l3 Æ l4) and of (l1 Æ l2 Æ l3 Æ :l4)

Requires solving a linear system.

Too expensive in practice (see e.g. [DdM06]).

[DdM06] Integrating simplex with DPLL(T), Dutertre and De Moura, SRI-CSL-06-01

Page 11: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

11

Theory propagation for LA

Let l1, l2, l3 be asserted. Is l4 (or :l4) T-implied ?

Two techniques for finding T-implications.

2. Check if all vertices on the same side of l4

There is an exponential number of vertices.

Too expensive in practice.

Page 12: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

12

Approximating theory propagation

Problem 1: How can we use conjectured information without losing soundness ?

Problem 2: how can we find cheaply good conjectures i.e., conjectured T-implications

Page 13: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

13

Problem 1: how to use conjectures ? We use conjectured implications just to bias

decisions. SAT chooses a variable to decide, we conjecture

its value.

Might be better than the alternative: SAT’s heuristics are T-ignorant.

Page 14: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

14

Problem 2: conjecturing T-implications We examined two methods: 1. k - vertices

Find k-vertices. If they are all on the same side of l4 – conjecture that l4

is implied.

l4

In this case we conjecture :l4

Page 15: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

15

Problem 2: conjecturing T-implications We examined two methods: 1. k - vertices

Find k-vertices. If they are all on the same side of l4 – conjecture that l4

is implied.

l4

In this case we conjecture nothing

Page 16: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

16

Problem 2: conjecturing T-implications We examined two methods: 1. k - vertices

Find k-vertices. If they are all on the same side of l4 – conjecture that l4

is implied.

l4

In this case we (falsely) conjecture l4

Page 17: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

17

Problem 2: conjecturing T-implications We examined two methods: 1. k - vertices

Find k-vertices. If they are all on the same side of l4 – conjecture that l4

is implied.

Too expensive in practice

Page 18: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

18

Problem 2: conjecturing T-implications We examined two methods: 2.One approximated point

Here we always conjecture a T-implication.

l4

Page 19: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

19

Problem 2: conjecturing T-implications We examined two methods: 2.One approximated point

Here we always conjecture a T-implication.

l4

Page 20: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

20

Problem 2: conjecturing T-implications We examined two methods: 2.One approximated point

Here we always conjecture a T-implication.

l4

Page 21: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

21

Problem 2: conjecturing T-implications We examined two methods: 2.One approximated point

The idea: use the assignment maintained by Simplex. It’s for free.

Competitive SMT solvers Use general Simplex [DdM06], not classical Simplex Do not activate Simplex after each assignment They only update the assignment according to the

‘simple’ constraints (e.g. “x < c”).

Page 22: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

22

Problem 2: conjecturing T-implications The assignment maintained by general Simplex is

updated after each partial (Boolean) assignment Based on simple constraints only.

Several possibilities:

is T-inconsistent

is T-consistent doesn’t satisfy it

is T-consistent satisfies it

22%

Page 23: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

23

Problem 2: conjecturing T-implications Our hope: is ‘close’ to the polygon. Therefore it can be successful in guessing

implications. Even if l4 is not T-implied, it can guide the search.

l4

Page 24: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

24

Results

Some results for the 200 benchmarks from SMT-COMP’07

Implementation on top of ArgoLib

Each column refers to a different strategy of choosing the value.

Page 25: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

25

0-pivot vs. MinisatM

iniS

at

Page 26: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

26

Back to the future # of cells is exponential in d rather than exponential in

n nd rather than 2n

for n sufficiently larger than d, better worst-case complexity

SMT-LIB + SRI’s GDP benchmarks Examples: n : d

QF_RDL_SCHEDULING 10.9 : 1 QF_RDL_SAL 6.7 : 1 QF_LRA_SC 3.9 : 1 QF_LRA_START_UP 6.9 : 1 QF_LRA_UART 6.1 : 1 QF_LRA_CLOCK_SYNCH 3.3 : 1 QF_LRA_SPIDER_BENCHMARKS 3.2 : 1 QF_LRA_SAL 6.1 : 1 MathSAT benchmarks (difference logic) 44.5 : 1 SEP benchmarks (difference logic) 17 : 1

Page 27: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

27

P#2: a reversed lazy approach

Current SAT-based ‘lazy’ approaches Search the Boolean domain check assignment in the

theory domain A ‘reversed lazy approach’:

Search the theory domain check assignment in the Boolean domain

T-solver

SAT

Page 28: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

28

How can we enumerate the cells ?

There exists a data structure (“incidence graph”) that represents the linear arrangement

Too large in practice… Corresponds to an explicit representation of the search

space. Constructing a symbolic representation seems as hard as

building the arrangement.

For two years we worked on a random, incremental algorithm, each time adding a constraint and consulting SAT.

The short summary: we were unable to beat Yices…

Page 29: 1 A theory-based decision heuristic for DPLL(T) Dan Goldwasser Ofer Strichman Shai Fine Haifa university TechnionIBM-HRL

29

Summary

We showed how to use ‘free’ information computed by general simplex in order to improve SAT’s decision. Somewhat compensates on the fact that there is no

theory propagation.

Future research: How can we let the theory lead efficiently ?