31
1 Decision heuristics based on an Abstraction/Refinement model Ofer Strichman Roman Gershman An earlier version was presented in IBM’s verification conference (Haifa, Oct. 05). Technion (HaifaSat)

Decision heuristics based on an Abstraction/Refinement model

  • Upload
    grazia

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

Decision heuristics based on an Abstraction/Refinement model. (HaifaSat). Ofer Strichman Roman Gershman An earlier version was presented in IBM’s verification conference (Haifa, Oct. 05). Technion. SAT solving. “Naïve” point of view: Searches in the decision tree, prunes subspaces . - PowerPoint PPT Presentation

Citation preview

Page 1: Decision heuristics based on an Abstraction/Refinement model

1

Decision heuristics based on an Abstraction/Refinement model

Ofer Strichman

Roman Gershman

An earlier version was presented in IBM’s verification conference (Haifa, Oct. 05). Technion

(HaifaSat)

Page 2: Decision heuristics based on an Abstraction/Refinement model

2

TechnionTechnion

SAT solving “Naïve” point of view:

Searches in the decision tree, prunes subspaces. Creates “blocking clauses” that do not allow the solver

to choose the same path again.

This point of view fails to explain why We can solve many formulas with 105 variables, We cannot solve other formulas with 103 variables

Page 3: Decision heuristics based on an Abstraction/Refinement model

3

TechnionTechnion

A different point of view

Modern solvers act as proof engines based on resolution, rather than as search engines, with structured problems.

Evidence: adding the shortest conflict clauses is not the best strategy [R04].

Furthermore: certain strategies resemble a proof by abstraction-refinement.

Page 4: Decision heuristics based on an Abstraction/Refinement model

4

TechnionTechnion

Abstraction of models and formulas

Model is an (over approximating) abstraction of M if:

A QF formula is an (over-approximating) abstraction of F if:

F !or simply:

Page 5: Decision heuristics based on an Abstraction/Refinement model

5

TechnionTechnion

Model refines if:

Formula refines if:

Refinement of models and formulas

F ! , ! or simply:

Page 6: Decision heuristics based on an Abstraction/Refinement model

6

TechnionTechnion

Abstraction of formulas

Now consider Binary Resolution:

(A _ x) ^ (B _ :x) ! (A _ B)

Conflict Clauses are derived through a process of Binary Resolution.

over-approximates

F !

Page 7: Decision heuristics based on an Abstraction/Refinement model

7

TechnionTechnion

Resolution Graph

O1 O2

O3O4

O6

O7

i1

C-1

i2

i3

O5

C-2

C-3

i4

Binary DAG with intermediate and conflict clauses.

Each node in the graph is an abstraction of its antecedents

Collapsed DAG with multi-degree nodes

C-1

C-3

C-2

O1 O2 O3 O4O5 O6

O7

Page 8: Decision heuristics based on an Abstraction/Refinement model

8

TechnionTechnion

Conflict clauses

Several modern Decision Heuristics are guided by the Conflict Clauses (e.g. Berkmin)

Hence, we can analyze them with the Abstraction/Refinement model.

Page 9: Decision heuristics based on an Abstraction/Refinement model

9

TechnionTechnion

Berkmin’s heuristic

Push conflict clauses to a ‘stack’. Find the first unsatisfied clause and choose a

variable from this clause. Secondary heuristic: VSIDS (Zchaff).

Page 10: Decision heuristics based on an Abstraction/Refinement model

10

TechnionTechnion

Berkmin heuristic

tail-first conflict clause

A new conflict clause

Page 11: Decision heuristics based on an Abstraction/Refinement model

11

TechnionTechnion

Let F denote the original formula abstracts F (F ! ) refines (F ! , ! )

Berkmin heuristic

tail-first conflict clause

Check of abstract assignment fails

Page 12: Decision heuristics based on an Abstraction/Refinement model

12

TechnionTechnion Does not focus on a specific Abstraction/Refinement

path.

Generally: hundreds of clauses can be between a clause and its resolving clauses.

Berkmin heuristic

C-1

C-3

C-2

Page 13: Decision heuristics based on an Abstraction/Refinement model

13

TechnionTechnion

Choosing the next clause by traversing the resolution graph: a general scheme

1. Mark all sinks.

2. Choose an unresolved marked clause C (If there are none - exit)

3. process C // attempt to satisfy C.

4. Mark C ’s antecedents.

Berkmin chooses a clause only if all its descendents are already satisfied.

Page 14: Decision heuristics based on an Abstraction/Refinement model

14

TechnionTechnion

Progressing on the resolve graph

Progress with “Best-First” according to some criterion.

Must store the whole resolve graph in memory – this is frequently infeasible.

HaifaSat’s strategy: Do not store graph Be more abstraction-focused than Berkmin

Page 15: Decision heuristics based on an Abstraction/Refinement model

15

TechnionTechnion

The CMTF heuristic

Position conflict clauses together with their resolving clauses in the end of a list.

Find the first unsatisfied clause and choose a variable from this clause. secondary strategy: the VMTF (Siege) heuristic.

Gives us the ‘first-layer approximation’ of the graph.

Page 16: Decision heuristics based on an Abstraction/Refinement model

16

TechnionTechnion

CMTF

When C-3 is created, C-0, C-1 are moved to the head of the list together with C-3.

C-2 is left in place.

C-1

C-3

C-2

C-0

Page 17: Decision heuristics based on an Abstraction/Refinement model

17

TechnionTechnion

News

A new technique developed in IBM-Haifa allows to shrink the graph stored in memory by ~ an order of magnitude.

So, assuming the graph is in memory, the search for new strategies is now open…

A contention between conflict-driven and abstraction-driven.

Page 18: Decision heuristics based on an Abstraction/Refinement model

18

TechnionTechnion

DecisionConflict

Decision Level

Time

Activity Score

Cx=1

C1

C5

C4

C3

C2

time dedicated for refuting x=1

time dedicated for creating C

T1(C)

Time C is asserting

T2(C)

Page 19: Decision heuristics based on an Abstraction/Refinement model

19

TechnionTechnion

Given a clause: choose a variable.The activity score.

The Activity of a variable v: Let V be the set of variables that were resolved on in

T1(C) on the resolution path of C. Add +1 for each v 2 V in the interval T2(C) Occasionally, divide all scores.

A cheap recursive computation embedded in the First-UIP scheme.

Page 20: Decision heuristics based on an Abstraction/Refinement model

20

TechnionTechnion

Results

165 industrial hard benchmarks from previous SAT competitions.

All heuristics (Berkmin, VSIDS) implemented inside HaifaSat for fair comparison.

Comparing… Time Fails

CMTF Berkmin 10% 12-25%

RBS VSIDS 23% 20-30%

Berkmin a little better than zChaff 2004

Page 21: Decision heuristics based on an Abstraction/Refinement model

21

TechnionTechnion

(CMTF + RBS) Vs. Berkmin(both implemented inside HaifaSat)

Berkmin + VSIDS Vs. CMTF + RBS (HaifaSat)

0

500

1000

1500

2000

2500

3000

3500

0500100015002000250030003500

Berkmin + VSIDS

CM

TF

+ R

BS

Page 22: Decision heuristics based on an Abstraction/Refinement model

22

TechnionTechnion

HaifaSat Vs. zChaff 2004

HaifaSat Vs. zChaff

0

500

1000

1500

2000

2500

3000

3500

0500100015002000250030003500

zChaff 2004

Hai

faS

at

h-c-rbs

Page 23: Decision heuristics based on an Abstraction/Refinement model

23

TechnionTechnion

Results –SAT05 (Industrial)

Page 24: Decision heuristics based on an Abstraction/Refinement model

24

TechnionTechnion

Results –SAT05 (Industrial)

Page 25: Decision heuristics based on an Abstraction/Refinement model

25

TechnionTechnion

Competition...

Independently, very similar principles were discovered by Dershowitz, Hanna and Nadel [SAT’05]

Reached very similar conclusions Their ‘black-box’ Eureka SAT solver took several

first and second places in last year’s competition.

Page 26: Decision heuristics based on an Abstraction/Refinement model

26

TechnionTechnion

What we explore now

We are currently investigating the possibility to use Hints for dealing with hard instances

Hints: a yet-unpublished work by Kroening, Yorav, Shacham.

The original use of hints: using presumed high-level knowledge to speed SAT.

Page 27: Decision heuristics based on an Abstraction/Refinement model

27

TechnionTechnion

Hints

Hints are constraints (clauses) that are conjectured to be true.

A separate BCP processes the set of conjectured clauses. An implied literal becomes the next decision. A conflict is only used for deriving more hints.

Page 28: Decision heuristics based on an Abstraction/Refinement model

28

TechnionTechnion

Hints (cont.)

Use hints to prune ‘seemingly hopeless branches (SHB)’

Define a monotonically decreasing function

f: decision-level time-interval

If time at decision level dl > f(dl) move to another branch. It is seemingly hopeless. Actively: force backtracking Passively: wait for a restart

Page 29: Decision heuristics based on an Abstraction/Refinement model

29

TechnionTechnion

Hints: Example

A hint clause: (:l1 :l2 :l3).

Option #1: hint = negation of partial assignment Option #2: hint = projection of #1 to literals that were

used in the SHB.

l1

l2

l3 : l3

SHB

Page 30: Decision heuristics based on an Abstraction/Refinement model

30

TechnionTechnion

Combining Hints and restarts

Some heuristics to be tried: Change restart policy, using f. Local restarts: only from a certain decision level …

Page 31: Decision heuristics based on an Abstraction/Refinement model

31

TechnionTechnion

Hints and restarts

A restart is effective because of randomization and/or learning. Hints will add new conjectures.

Bart Selman: “You can not restart too much” Perhaps now: “You can not hint too much”