clause sharing and partitioning for cloud-based smt...

16
Università della Svizzera italiana Facoltà di scienze informatiche Matteo Marescotti, Antti E. J. Hyvärinen, and Natasha Sharygina Università della Svizzera italiana Switzerland Clause Sharing and Partitioning for Cloud-Based SMT Solving SMT@IJCAR2016

Upload: others

Post on 22-Jan-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

Università della Svizzera italiana

Facoltà di scienze informatiche

Matteo Marescotti, Antti E. J. Hyvärinen, and Natasha Sharygina

Università della Svizzera italianaSwitzerland

Clause Sharing and Partitioning for Cloud-Based SMT Solving

SMT@IJCAR2016

Page 2: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Software verification tasks are a source of computationally challenging problems.

▪ SMT solvers are often used as backend for software verification techniques.

▪ Given a way to parallelise SMT solver, it would be possible to speedup software verification.

▪ Parallel computing in e.g. economics and physics-related domains has been a huge success: run time reduced from years to days.

▪ Parallel constraint solving has only recently gained success

▪ Heule et al.: Solving and Verifying the boolean Pythagorean Triples problem via Cube-and-Conquer, to appear at SAT16

Why parallel SMT

2

Page 3: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Portfolio [BCD11, WHM09]:▪ The concurrent execution of a set of solvers.▪ Each solver has a different initial seed.

▪ Divide and Conquer [REI14]:▪ Creation of a set of partitions 𝐹1, … , 𝐹n

▪ sat(𝐹 ) ⟺ sat(𝐹1 ⋁ … ⋁ 𝐹n) ⟺ sat(𝐹1) ⋁ … ⋁ sat(𝐹n)▪ First proved sat proves sat, all proved unsat proves unsat.

▪ Clause Sharing [WHM09]: ▪ Feature of parallel SAT/SMT techniques.▪ Used to prevent the search on already explored space.

Related work on parallel SMT solving

3

[BCD11] Barrett et al.: CVC4. 2011.[WHM09] Wintersteiger et al.: A concurrent portfolio approach to SMT solving. 2009.[REI14] Reisenberger et al.: PBoolector: a parallel SMT solver for QF_BV […]. 2014.

Page 4: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

4✴ data from two SAT instances solved with MiniSAT 100 times

▪ Parallel approaches try to take advantage from randomness.▪ Formulas with a more widespread run-time distribution are

better suited for Portfolio.

Portfolio

Page 5: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Given a number of partitions n, partitioning tries to formulate n partitions such that each partition’s search space is equal.

▪ Each partition is created by constraining the input formula with new clauses.

▪ Scattering based on VSIDS (Variable State Independent Decaying Sum)

▪ Formula is solved for a fixed amount of time.

▪ We choose the literals which appear most during conflict analysis (VSIDS) to construct the partitions.

▪ Lookahead

Partitioning

5

Page 6: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Depending on how the division is done, the performance might be dramatically different.

Partitioning

6✴ data from OpenSMT2: splitting NEQ016_size8 QF_UF benchmark with VSIDS and lookahead

Page 7: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ A new clause 𝑐 ⇐ 𝑭 is learnt by:

▪ SAT solver on every conflict.

▪ Theory Solver which periodically checks if the current propositional assignment is consistent with the theory.

▪ Learnt clauses are used to guide the search.

Learned clauses in DPLL(T)

7

Page 8: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Clause sharing helps the solving of:

▪ unsat to produce an unsat set of clauses.

▪ sat to reduce the number of assignment.

▪ Clause sharing could slow down all the solvers due to the high throughput of learnt clauses.

▪ More critical the more the number of solvers increases.

▪ Heuristics must be used to choose what is worth sharing.

▪ All solvers must have the same internal representation of the formula for clause sharing to be sound.

Clause sharing in DPLL(T) [MHS16]

8

[MHS16] M. Marescotti, A. E. J. Hyvärinen, and N. Sharygina.Clause Sharing and Partitioning for Cloud-Based SMT Solving. to appear at ATVA 2016, proc.

Page 9: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Server / Workers modular design.▪ Load balancing: as simpler partitions are solved, solvers are assigned to

unsolved partitions in a fair way.

Parallel Solver [HMS15, MHS16]

9

...

FIFO Channel

Filter Heuristic

Server

Clause DB

Selection Heuristic

ClusterHead node

Client

SMT Solver

Client

SMT Solver

Client

SMT Solver

C , C , ... ,C1 2 nC , C , ... ,C1 2 nC , C , ... ,C1 2 n

Partition Heuristic

Input instances

[HMS15] A. E. J. Hyvärinen, M. Marescotti, and N. Sharygina. Search-space partitioning for parallelizing SMT solvers. SAT 2015, Proceedings.

[MHS16] M. Marescotti, A. E. J. Hyvärinen, and N. Sharygina.Clause Sharing and Partitioning for Cloud-Based SMT Solving. to appear at ATVA 2016, proc.

Page 10: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ The modular system runs in a computing cloud.

▪ Partition heuristics:▪ The VSIDS-based heuristic used in MiniSat.▪ A look-ahead heuristic.

▪ Filter heuristic:▪ Statically based on clause size

▪ Selection heuristic:▪ Random fixed number of clauses

▪ SMT Solver: ▪ OpenSMT supporting QF_UF and QF_LRA.

Parallel Solver [HMS15, MHS16]

10

[HMS15] A. E. J. Hyvärinen, M. Marescotti, and N. Sharygina. Search-space partitioning for parallelizing SMT solvers. SAT 2015, Proceedings.

[MHS16] M. Marescotti, A. E. J. Hyvärinen, and N. Sharygina.Clause Sharing and Partitioning for Cloud-Based SMT Solving. to appear at ATVA 2016, proc.

Page 11: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ SMT solver represent the instance as DAG of terms.

▪ Several simplifications applied. The result is a set of clauses.

▪ Hard to connect the clauses and the DAG representation.

▪ We solve this by having a binary format that describes the state of the solver.

▪ Binary format used both for learned clauses and the clauses used as constraints.

▪ Our naïve implementation consists of a memory dump.

▪ As a downside it is difficult to plug in other solvers to the framework.

Binary format for SMT

11

Page 12: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

s1

Experiments

12

64

s2

0

3232

[HMS15] A. E. J. Hyvärinen, M. Marescotti, and N. Sharygina. Search-space partitioning for parallelizing SMT solvers. SAT 2015, Proceedings.

s8

0

88 …

▪ Combination using the parallelisation tree framework [HMS15].

Page 13: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Works better with pure portfolio.

Experiments: Clause Sharing

13

10

100

1000

10 100 1000timeout

s1CS

s1

10

100

1000

10 100 1000timeout

s8CS

s8

10

100

1000

10 100 1000timeout

s2CS

s2

✴ data from OpenSMT2 Parallel Framework using 8 nodes on QF_UF and QF_LRA benchmarks. s1: Portfolio of 64 solvers.s2: Partition in 2 and portfolio of 32 on each. s8: Partition in 8 and portfolio of 8 on each.

2.05x 1 more QF_LRA 9 more QF_UF

1.97x 1 more QF_LRA 7 more QF_UL

1.67x 0 more QF_LRA 4 more QF_UF

Page 14: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

Experiments: Clause Sharing Heuristics

14

10

100

1000

10 100 1000timeout

s1CS(filter

>30)

s1

s1: portfolio of 64 solverss1 CS: portfolio of 64 solvers with clause sharing

✴ data from OpenSMT2 Parallel Framework using 8 nodes on QF_LRA benchmarks.[MHS16] Matteo Marescotti, Antti E. J. Hyvärinen, and Natasha Sharygina.

Clause Sharing and Partitioning for Cloud-Based SMT Solving. to appear at ATVA 2016, proc.

QF_LRA

10

100

1000

10 100 1000

s1

CS

s1timeout

QF_LRA

Page 15: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

Experiments: Against sequential

15

10

100

1000

10 100 1000timeout

s1CS

OpenSMT2

10

100

1000

10 100 1000timeout

s1CS

Z3

s1 CS: portfolio of 64 solvers with clause sharing

✴ data from OpenSMT2 Parallel Framework using 8 nodes on QF_UF and QF_LRA benchmarks.

Page 16: Clause Sharing and Partitioning for Cloud-Based SMT Solvingsmt-workshop.cs.uiowa.edu/2016/slides/marescotti.pdfFirst proved sat proves sat, all proved unsat proves unsat. Clause Sharing

▪ Loose clause sharing heuristics result in slowdown:

▪ how to improve these heuristics.

▪ Full iterative partitioning support in the implementation:

▪ currently limited to the first level.

▪ Global clause sharing:

▪ now limited to the tree rooted at the node who learnt them.

▪ Integration in model checker.

▪ OpenSMT2 GIT Repo at:

https://scm.ti-edu.ch/repogit/opensmt2.git

Future work

16