sat solving – parallel search

75
I Parallel Approaches I Abstract Description I High-Level I Problems Steffen H¨ olldobler and Norbert Manthey SAT Solving – Parallel Search 1 SAT Solving – Parallel Search Steffen H ¨ olldobler and Norbert Manthey International Center for Computational Logic Technische Universit¨ at Dresden Germany

Upload: others

Post on 11-Jun-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SAT Solving – Parallel Search

I Parallel Approaches

I Abstract Description

I High-Level

I Problems

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 1

SAT Solving – Parallel Search

Steffen Holldobler and Norbert MantheyInternational Center for Computational LogicTechnische Universitat DresdenGermany

Page 2: SAT Solving – Parallel Search

Parallelization – Warm Up

I If an algorithm has three parts that consume 80 %, 10 % and 10 %

I Which task should be parallelized?

I What is the ideal speedup for two cores?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 2

Page 3: SAT Solving – Parallel Search

Parallelization – Warm Up

I If an algorithm has three parts that consume 80 %, 10 % and 10 %

I Which task should be parallelized?

I What is the ideal speedup for two cores?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 3

Page 4: SAT Solving – Parallel Search

Parallelization – Warm Up

I If an algorithm has three parts that consume 80 %, 10 % and 10 %

I Which task should be parallelized?

I What is the ideal speedup for two cores?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 4

Page 5: SAT Solving – Parallel Search

Parallelization – Warm Up

I Assume two solvers S1 and S2 solve the formula F independently

I S1 learns C, S2 learns D

I If S1 receives D, is satisfiability preserved?

I If S1 receives D, is equivalence preserved?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 5

Page 6: SAT Solving – Parallel Search

Parallelization – Warm Up

I Assume two solvers S1 and S2 solve the formula F independently

I S1 learns C, S2 learns D

I If S1 receives D, is satisfiability preserved?

I If S1 receives D, is equivalence preserved?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 6

Page 7: SAT Solving – Parallel Search

Parallelization – Warm Up

I Assume two solvers S1 and S2 solve the formula F independently

I S1 learns C, S2 learns D

I If S1 receives D, is satisfiability preserved?

I If S1 receives D, is equivalence preserved?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 7

Page 8: SAT Solving – Parallel Search

Parallelization – Warm Up

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬a ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I How would you parallelize?

I Can the steps be run in parallel?

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬d ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I From a complexity point of view, this is an open question!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 8

Page 9: SAT Solving – Parallel Search

Parallelization – Warm Up

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬a ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I How would you parallelize?

I Can the steps be run in parallel?

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬d ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I From a complexity point of view, this is an open question!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 9

Page 10: SAT Solving – Parallel Search

Parallelization – Warm Up

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬a ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I How would you parallelize?

I Can the steps be run in parallel?

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬d ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I From a complexity point of view, this is an open question!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 10

Page 11: SAT Solving – Parallel Search

Parallelization – Warm Up

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬a ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I How would you parallelize?

I Can the steps be run in parallel?

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬d ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I From a complexity point of view, this is an open question!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 11

Page 12: SAT Solving – Parallel Search

Parallelization – Warm Up

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬a ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I How would you parallelize?

I Can the steps be run in parallel?

I Run unit propagation onF = (¬e ∨ f ) ∧ (¬d ∨ e) ∧ (¬c ∨ d) ∧ (¬b ∨ c) ∧ (¬a ∨ b) ∧ a

I From a complexity point of view, this is an open question!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 12

Page 13: SAT Solving – Parallel Search

Parallelization – Revision

I A sequential algorithm

. requires time t1 seconds

I A parallel algorithm

. utilizes p computation units (cores)

. requires time tp seconds

I The speedup Sp = t1tp

. A speedup Sp is superlinear, if Sp > p

I The efficiency Ep =Spp

I An algorithm is called scalable,

if it can solve a given problem faster when additional resources are added

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 13

Page 14: SAT Solving – Parallel Search

Abstract Visualization

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 14

Page 15: SAT Solving – Parallel Search

Finding an Exit in a Maze

I Some rules

. starting point is located in the left column

. exit is on the right side (if there exists one)

. search decisions can be done only when moving right

. when moving left, use backtracking

I Parallel approaches: multiple searches, search space splitting

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 15

Page 16: SAT Solving – Parallel Search

Finding an Exit in a Maze

I Some rules

. starting point is located in the left column

. exit is on the right side (if there exists one)

. search decisions can be done only when moving right

. when moving left, use backtracking

I Parallel approaches: multiple searches, search space splitting

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 16

Page 17: SAT Solving – Parallel Search

Solve With Multiple Solvers

I Use a solver per computing resource

. Use different heuristics

. Solvers work independently

a b c d e f g h

1

2

3

4

5

6

7

8

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 17

Page 18: SAT Solving – Parallel Search

Solve With Multiple Solvers

I Learned clauses can be shared

. All solvers work on the same formula

. No simplification involved

a b c d e f g h

1

2

3

4

5

6

7

8

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 18

Page 19: SAT Solving – Parallel Search

Solve With Multiple Solvers

I Arising questions:

. How scalable is the presented approach?

. What influences scalability?

. How long is clause sharing valid wrt simplification?

. Is there a good alternative?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 19

Page 20: SAT Solving – Parallel Search

Solve With Multiple Solvers

I Arising questions:

. How scalable is the presented approach?

. What influences scalability?

. How long is clause sharing valid wrt simplification?

. Is there a good alternative?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 20

Page 21: SAT Solving – Parallel Search

Solve With Multiple Solvers

I Arising questions:

. How scalable is the presented approach?

. What influences scalability?

. How long is clause sharing valid wrt simplification?

. Is there a good alternative?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 21

Page 22: SAT Solving – Parallel Search

Solve With Multiple Solvers

I Arising questions:

. How scalable is the presented approach?

. What influences scalability?

. How long is clause sharing valid wrt simplification?

. Is there a good alternative?

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 22

Page 23: SAT Solving – Parallel Search

Partition Search Space

I Create a partition per computing resource

. Assign a solver to each partition

. Solvers work independently

a b c d e f g h

1

2

3

4

5

6

7

8

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 23

Page 24: SAT Solving – Parallel Search

Partition Search Space

I Learned clauses can be shared

. with respect to the partition

. carefully

a b c d e f g h

1

2

3

4

5

6

7

8

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 24

Page 25: SAT Solving – Parallel Search

Partition Search Space

I Learned clauses can be shared

. with respect to the partition

. carefully

a b c d e f g h

1

2

3

4

5

6

7

8

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 25

Page 26: SAT Solving – Parallel Search

Partition Search Space

I Partitions can be re-partitioned

. Ensure load balancing and applies many resources to hard partitions

. Possible to use learned clauses of parent partition

a b c d e f g h

1

2

3

4

5

6

7

8

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 26

Page 27: SAT Solving – Parallel Search

High Level Parallelization Approaches

Parallel Portfolio Solvers

Search Space Partitioning Solvers

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 27

Page 28: SAT Solving – Parallel Search

Parallel Portfolio Solvers

I Solve a formula F with n resources

I Idea: solve F with multiple solvers

. With different configurations

. With knowledge sharing (learned clauses)

I Drawbacks:

. Known to not scale well

. A small set of configurations is already robust

. Scalability is independent of formula size

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 28

Page 29: SAT Solving – Parallel Search

Parallel Portfolio Solvers

I Solve a formula F with n resources

I Idea: solve F with multiple solvers

. With different configurations

. With knowledge sharing (learned clauses)

I Drawbacks:

. Known to not scale well

. A small set of configurations is already robust

. Scalability is independent of formula size

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 29

Page 30: SAT Solving – Parallel Search

Parallel Portfolio Solvers

I Solve a formula F with n resources

I Idea: solve F with multiple solvers

. With different configurations

. With knowledge sharing (learned clauses)

I Drawbacks:

. Known to not scale well

. A small set of configurations is already robust

. Scalability is independent of formula size

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 30

Page 31: SAT Solving – Parallel Search

Parallel Portfolio Solvers

I Solve a formula F with n resources

I Idea: solve F with multiple solvers

. With different configurations

. With knowledge sharing (learned clauses)

I Drawbacks:

. Known to not scale well

. A small set of configurations is already robust

. Scalability is independent of formula size

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 31

Page 32: SAT Solving – Parallel Search

Parallel Portfolio Solvers – Sharing

I Given two solvers S1 and S2, and let S1 learn a clause C

I Let F 1 and F 2 be the working formulas of S1 and S2, respectively

I When is S2 allowed to receive C

. If F 2 ≡ F 2 ∧ C

. If F 2 ≡SAT F 2 ∧ C

. The check is done implicitely, as it is too expensive

II No simplification, then all clauses are entailedII Only clause elimination / model increasing techniques, then sharing

preserves equisatisfiability

. Addition of redundant, but not entailed, clauses

II Extra care, otherwise:II F 1 = x , and S2 applies simplification:

F 2 = x ;modelInc F 2 = ∅ ;modelDec F 2 = xII Solver S2 reveices (x) from S1: F 2 = x ∧ xII Satisfiable formula is found to be unsatisfiable

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 32

Page 33: SAT Solving – Parallel Search

Parallel Portfolio Solvers – Sharing

I Given two solvers S1 and S2, and let S1 learn a clause C

I Let F 1 and F 2 be the working formulas of S1 and S2, respectively

I When is S2 allowed to receive C

. If F 2 ≡ F 2 ∧ C

. If F 2 ≡SAT F 2 ∧ C

. The check is done implicitely, as it is too expensive

II No simplification, then all clauses are entailedII Only clause elimination / model increasing techniques, then sharing

preserves equisatisfiability

. Addition of redundant, but not entailed, clauses

II Extra care, otherwise:II F 1 = x , and S2 applies simplification:

F 2 = x ;modelInc F 2 = ∅ ;modelDec F 2 = xII Solver S2 reveices (x) from S1: F 2 = x ∧ xII Satisfiable formula is found to be unsatisfiable

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 33

Page 34: SAT Solving – Parallel Search

Parallel Portfolio Solvers – Sharing

I Given two solvers S1 and S2, and let S1 learn a clause C

I Let F 1 and F 2 be the working formulas of S1 and S2, respectively

I When is S2 allowed to receive C

. If F 2 ≡ F 2 ∧ C

. If F 2 ≡SAT F 2 ∧ C

. The check is done implicitely, as it is too expensive

II No simplification, then all clauses are entailedII Only clause elimination / model increasing techniques, then sharing

preserves equisatisfiability

. Addition of redundant, but not entailed, clauses

II Extra care, otherwise:II F 1 = x , and S2 applies simplification:

F 2 = x ;modelInc F 2 = ∅ ;modelDec F 2 = xII Solver S2 reveices (x) from S1: F 2 = x ∧ xII Satisfiable formula is found to be unsatisfiable

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 34

Page 35: SAT Solving – Parallel Search

Parallel Portfolio Solvers – Sharing

I Given two solvers S1 and S2, and let S1 learn a clause C

I Let F 1 and F 2 be the working formulas of S1 and S2, respectively

I When is S2 allowed to receive C

. If F 2 ≡ F 2 ∧ C

. If F 2 ≡SAT F 2 ∧ C

. The check is done implicitely, as it is too expensive

II No simplification, then all clauses are entailedII Only clause elimination / model increasing techniques, then sharing

preserves equisatisfiability

. Addition of redundant, but not entailed, clauses

II Extra care, otherwise:II F 1 = x , and S2 applies simplification:

F 2 = x ;modelInc F 2 = ∅ ;modelDec F 2 = xII Solver S2 reveices (x) from S1: F 2 = x ∧ xII Satisfiable formula is found to be unsatisfiable

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 35

Page 36: SAT Solving – Parallel Search

Parallel Portfolio Solvers – Sharing

I Given two solvers S1 and S2, and let S1 learn a clause C

I Let F 1 and F 2 be the working formulas of S1 and S2, respectively

I When is S2 allowed to receive C

. If F 2 ≡ F 2 ∧ C

. If F 2 ≡SAT F 2 ∧ C

. The check is done implicitely, as it is too expensive

II No simplification, then all clauses are entailedII Only clause elimination / model increasing techniques, then sharing

preserves equisatisfiability

. Addition of redundant, but not entailed, clauses

II Do not receive clauses, if a model decreasing has been used

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 36

Page 37: SAT Solving – Parallel Search

Solving SAT in parallel with the Portfolio approach

runtime

Solver1(F ) Solver2(F ) Solver3(F ) Solver4(F ) Portfolio1234(F )

I Different SAT solvers compete

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 37

Page 38: SAT Solving – Parallel Search

Solving SAT in parallel with the Portfolio approach

runtime

Solver1(F ) Solver2(F ) Solver3(F ) Solver4(F ) Portfolio1234(F )

SAT or UNSAT

I The portfolio of these solvers requires the smallest run time

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 38

Page 39: SAT Solving – Parallel Search

Solving SAT in parallel with the Portfolio approach

runtime

Solver1(F ) Solver2(F ) Solver3(F ) Solver4(F ) Portfolio1234(F )

SAT or UNSAT

I By adding communication among the solvers, the performance can beimproved

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 39

Page 40: SAT Solving – Parallel Search

High Level Parallelization Approaches

Parallel Portfolio Solvers

Search Space Partitioning Solvers

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 40

Page 41: SAT Solving – Parallel Search

Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 < i ≤ r , such that

II their disjunction is equal to the initial formula F ≡∨

F i

II a partition constraint K i in CNF is added, F i := F ∧ K i

. To obtain a partition, additionally ensure

II that the child-formulas represent disjoint search spaces

F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve each child-formula with a sequential solver

. If a solver proofed unsatisfiability of a sub formula

II assign a new child formula

. Load-balancing is usually handled by providing sufficiently many childformulas

. Can scale with the number of created child formulas, if partitioning works

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 41

Page 42: SAT Solving – Parallel Search

Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 < i ≤ r , such that

II their disjunction is equal to the initial formula F ≡∨

F i

II a partition constraint K i in CNF is added, F i := F ∧ K i

. To obtain a partition, additionally ensure

II that the child-formulas represent disjoint search spaces

F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve each child-formula with a sequential solver

. If a solver proofed unsatisfiability of a sub formula

II assign a new child formula

. Load-balancing is usually handled by providing sufficiently many childformulas

. Can scale with the number of created child formulas, if partitioning works

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 42

Page 43: SAT Solving – Parallel Search

Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 < i ≤ r , such that

II their disjunction is equal to the initial formula F ≡∨

F i

II a partition constraint K i in CNF is added, F i := F ∧ K i

. To obtain a partition, additionally ensure

II that the child-formulas represent disjoint search spaces

F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve each child-formula with a sequential solver

. If a solver proofed unsatisfiability of a sub formula

II assign a new child formula

. Load-balancing is usually handled by providing sufficiently many childformulas

. Can scale with the number of created child formulas, if partitioning works

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 43

Page 44: SAT Solving – Parallel Search

Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 < i ≤ r , such that

II their disjunction is equal to the initial formula F ≡∨

F i

II a partition constraint K i in CNF is added, F i := F ∧ K i

. To obtain a partition, additionally ensure

II that the child-formulas represent disjoint search spaces

F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve each child-formula with a sequential solver

. If a solver proofed unsatisfiability of a sub formula

II assign a new child formula

. Load-balancing is usually handled by providing sufficiently many childformulas

. Can scale with the number of created child formulas, if partitioning works

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 44

Page 45: SAT Solving – Parallel Search

(Plain) Search Space Partitioning

F

F 2F 1 F 3 F 4

runtime

Solver(F 1) Solver(F 2) Solver(F 3) Solver(F 4)

>

SAT

I finds models as fast as the fastest solver

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 45

Page 46: SAT Solving – Parallel Search

(Plain) Search Space Partitioning

F

F 2F 1 F 3 F 4

runtime

Solver(F 1) Solver(F 2) Solver(F 3) Solver(F 4)

UNSAT

I proofs unsatisfiability as slow as the slowest solver

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 46

Page 47: SAT Solving – Parallel Search

(Plain) Search Space Partitioning

F

F 2F 1 F 3 F 4

runtime

Solver(F 1) Solver(F 2) Solver(F 3) Solver(F 4)

I not ensured:max(tSolver(F 1), tSolver(F 2), tSolver(F 3), tSolver(F 4)) ≤ (tSolver(F ))

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 47

Page 48: SAT Solving – Parallel Search

Iterative Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 ≤ i ≤ r , such that

II F ≡∨

F i

II F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve all formulas with a sequential solver (not only child formulas)

. If a solver proofed unsatisfiability of a sub formula, assign a new childformula

II assign a new child formula

II or by recursively applying the partitioning procedure to child formulas

. Creates a breadth first search in the search space

. Can assign new child-formulas to new resources by iterative partitioning

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 48

Page 49: SAT Solving – Parallel Search

Iterative Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 ≤ i ≤ r , such that

II F ≡∨

F i

II F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve all formulas with a sequential solver (not only child formulas)

. If a solver proofed unsatisfiability of a sub formula, assign a new childformula

II assign a new child formula

II or by recursively applying the partitioning procedure to child formulas

. Creates a breadth first search in the search space

. Can assign new child-formulas to new resources by iterative partitioning

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 49

Page 50: SAT Solving – Parallel Search

Iterative Search Space Partitioning

I Partition search space of formula F into sub spaces:

. For some r > 0 create r “child”-formulas F i , 0 ≤ i ≤ r , such that

II F ≡∨

F i

II F i ∧ F j ≡ ⊥, for all 0 ≤ i < j ≤ r .

. Solve all formulas with a sequential solver (not only child formulas)

. If a solver proofed unsatisfiability of a sub formula, assign a new childformula

II assign a new child formula

II or by recursively applying the partitioning procedure to child formulas

. Creates a breadth first search in the search space

. Can assign new child-formulas to new resources by iterative partitioning

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 50

Page 51: SAT Solving – Parallel Search

Iterative Search Space Partitioning

F

F 2F 1 F 3 F 4

runtime

Solver(F 1) Solver(F 2) Solver(F 3) Solver(F 4)

Solver(F )

>

⊥>

SAT

I finds models as fast as the fastest solver

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 51

Page 52: SAT Solving – Parallel Search

Iterative Search Space Partitioning

F

F 2F 1 F 3 F 4

runtime

Solver(F 1) Solver(F 2) Solver(F 3) Solver(F 4)

Solver(F )

⊥⊥UNSAT

I proofs unsatisfiability as fast as the slowest “necessary” solver

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 52

Page 53: SAT Solving – Parallel Search

Iterative Search Space Partitioning

F

F 2F 1 F 3 F 4

runtime

Solver(F 1) Solver(F 2) Solver(F 3) Solver(F 4)

Solver(F )

>/⊥

⊥>/⊥

SAT

UNSAT

I by iteratively partitioning the search space, new child formulasbecome more constrained

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 53

Page 54: SAT Solving – Parallel Search

Iterative Partitioning – Dependencies

I Solve formula F

I Create a tree. Create partitioning constraints K i with 1 ≤ i ≤ r , for some r. F ≡

∨1≤i≤k (F ∧ K i)

. K i ∧ K j ≡ ⊥ for all 1 ≤ i < j ≤ k

I Definition. A clause C depends on a path p, if p is the longest path of all clauses that

participated in the derivation of C.

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 54

Page 55: SAT Solving – Parallel Search

Iterative Partitioning – Dependencies

F p := ((x1 ∨ x2 ∨ x5) ∧ (x3 ∨ x4) ∧ (x2, x6, x1) ∧ (x2 ∨ x6))

F p1 := ((x2 ∨ x5) ∧ (x3 ∨ x4) ∧ (x2 ∨ x6) ∧ . . .)

(x1)

F p2 := ((x3 ∨ x4) ∧ . . .)

(x1)

I The clauses (x2 ∨ x5) and (x2 ∨ x6) depend on the partitioning constraint

I Their label has to be adapted accordingly!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 55

Page 56: SAT Solving – Parallel Search

Iterative Partitioning – Dependencies

F p := ((x1 ∨ x2 ∨ x5) ∧ (x3 ∨ x4) ∧ (x2, x6, x1) ∧ (x2 ∨ x6))

F p1 := ((x2 ∨ x5) ∧ (x3 ∨ x4) ∧ (x2 ∨ x6) ∧ . . .)

(x1)

F p2 := ((x3 ∨ x4) ∧ . . .)

(x1)

I The clauses (x2 ∨ x5) and (x2 ∨ x6) depend on the partitioning constraint

I Their label has to be adapted accordingly!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 56

Page 57: SAT Solving – Parallel Search

Iterative Partitioning – Dependencies

F p := ((x1 ∨ x2 ∨ x5) ∧ (x3 ∨ x4) ∧ (x2, x6, x1) ∧ (x2 ∨ x6))

F p1 := ((x2 ∨ x5) ∧ (x3 ∨ x4) ∧ (x2 ∨ x6) ∧ . . .)

(x1)

F p2 := ((x3 ∨ x4) ∧ . . .)

(x1)

I The clauses (x2 ∨ x5) and (x2 ∨ x6) depend on the partitioning constraint

I Their label has to be adapted accordingly!

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 57

Page 58: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Solve formula F

I Create a tree. Create partitioning constraints K i with 1 ≤ i ≤ r , for some r. F ≡

∨1≤i≤k (F ∧ K i)

. K i ∧ K j ≡ ⊥ for all 1 ≤ i < j ≤ k

II e.g. K 1 = x ∧ y , K 2 = ((¬x ∨ ¬y) ∧ c) and K 3 = ((¬x ∨ ¬y) ∧ ¬c). Label each node with its path to the root node,

e.g. F 132 = F ∧ K 1 ∧ K 13 ∧ K 132

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 58

Page 59: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Solve formula F

I Create a tree. Create partitioning constraints K i with 1 ≤ i ≤ r , for some r. F ≡

∨1≤i≤k (F ∧ K i)

. K i ∧ K j ≡ ⊥ for all 1 ≤ i < j ≤ k

II e.g. K 1 = x ∧ y , K 2 = ((¬x ∨ ¬y) ∧ c) and K 3 = ((¬x ∨ ¬y) ∧ ¬c). Label each node with its path to the root node,

e.g. F 132 = F ∧ K 1 ∧ K 13 ∧ K 132

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 59

Page 60: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Solve formula F

I Create a tree. Create partitioning constraints K i with 1 ≤ i ≤ r , for some r. F ≡

∨1≤i≤k (F ∧ K i)

. K i ∧ K j ≡ ⊥ for all 1 ≤ i < j ≤ k

II e.g. K 1 = x ∧ y , K 2 = ((¬x ∨ ¬y) ∧ c) and K 3 = ((¬x ∨ ¬y) ∧ ¬c). Label each node with its path to the root node,

e.g. F 132 = F ∧ K 1 ∧ K 13 ∧ K 132

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 60

Page 61: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Created 4 nodes with their partitioning constraints

I Assign all 5 solvers S1 to S5 to nodes

F , S1

F 1, S2 F 2, S3 F 3, S4 F 4, S5

K 1

K 2 K 3K 4

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 61

Page 62: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Solver S2 and S4 find their formula to be unsatisfiable

I Partition F 2, and assign the solvers again

F , S1

F 1, S2 F 2, S3 F 3, S4 F 4, S5

K 1

K 2 K 3K 4

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 62

Page 63: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

F , S1

F 1 ≡ ⊥ F 2, S3 F 3 ≡ ⊥ F 4, S5

K 1

K 2 K 3K 4

F 21, S2 F 22, S4 F 23

K 21 K 22 K 23

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 63

Page 64: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Solver S2 and S4 find their formula to be unsatisfiable

I Assign S2 to F 21, partition F 4, and assign S4 to F 41

F , S1

F 1 ≡ ⊥ F 2, S3 F 3 ≡ ⊥ F 4, S5

K 1

K 2 K 3K 4

F 21, S2 F 22, S4 F 23

K 21 K 22 K 23

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 64

Page 65: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

F , S1

F 1 ≡ ⊥ F 2, S3 F 3 ≡ ⊥ F 4, S5

K 1

K 2 K 3K 4

F 21 ≡ ⊥ F 22 ≡ ⊥ F 23,S2

K 21 K 22 K 23

F 41, S4 F 42

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 65

Page 66: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Solver S2 finds F 23 to be unsatisfiable

I F 2 has to be unsatisfiable as well

F , S1

F 1 ≡ ⊥ F 2, S3 F 3 ≡ ⊥ F 4, S5

K 1

K 2 K 3K 4

F 21 ≡ ⊥ F 22 ≡ ⊥ F 23,S2

K 21 K 22 K 23

F 41, S4 F 42

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 66

Page 67: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Solver S2 finds F 23 to be unsatisfiable

I F 2 has to be unsatisfiable as well

F , S1

F 1 ≡ ⊥ F 2 ≡ ⊥ F 3 ≡ ⊥ F 4, S5

K 1

K 2 K 3K 4

F 21 ≡ ⊥ F 22 ≡ ⊥ F 23 ≡ ⊥

K 21 K 22 K 23

F 41, S4 F 42, S2

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 67

Page 68: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Solver S4 finds F 41 to be satisfiable

I Then F 4 and F are satisfiable as well

F , S1

F 1 ≡ ⊥ F 2 ≡ ⊥ F 3 ≡ ⊥ F 4, S5

K 1

K 2 K 3K 4

F 21 ≡ ⊥ F 22 ≡ ⊥ F 23 ≡ ⊥

K 21 K 22 K 23

F 41, S4 F 42, S2

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 68

Page 69: SAT Solving – Parallel Search

Iterative Partitioning – A Abstract Example

I Have one solver for each core, assign a node to each solver

I Partition nodes recursively if resources become available again

I Solver S4 finds F 41 to be satisfiable

I Then F 4 and F are satisfiable as well

F ≡ >

F 1 ≡ ⊥ F 2 ≡ ⊥ F 3 ≡ ⊥ F 4 ≡ >

K 1

K 2 K 3K 4

F 21 ≡ ⊥ F 22 ≡ ⊥ F 23 ≡ ⊥

K 21 K 22 K 23

F 41 ≡ > F 42, S2

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 69

Page 70: SAT Solving – Parallel Search

Iterative Partitioning – Downward Sharing

I Solver S1 learns clause C

I Downward clause sharing is safe, F |= C, then F ∧ K i |= C

I Assumption: no simplification

F , S1 F |= C

F 3 ≡ ⊥ F 4, S5 F 4 = F ∧ K 4 |= C

K 3K 4

F 41, S4 F 42, S2 F 41 = F ∧ K 4 ∧ K 41 |= C

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 70

Page 71: SAT Solving – Parallel Search

Iterative Partitioning – Upward Sharing

I Solver S2 learns clause C, F ∧ K 4 ∧ K 42 |= C

I Suppose C depends only on F and K 4

I Upward clause sharing to F 4 is safe

I Store dependency level for each clause

I Assumption: no simplification

F , S1

F 3 ≡ ⊥ F 4, S5 F 4 = F ∧ K 4 |= C

K 3K 4

F 41, S4 F 42, S2 F 41 = F ∧ K 4 ∧ K 41 |= C

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 71

Page 72: SAT Solving – Parallel Search

Iterative Partitioning – Abort Redundant

I Solver S2 learns empty clause⊥, F ∧ K 4 ∧ K 42 |= ⊥I Suppose the empty clause depends only on F and K 4

I Upward clause sharing to F 4 is safe

I Abort all solvers below F 4 (S2, S4 and S5)

F , S1 F |= ⊥

F 3 ≡ ⊥ F 4, S5 F 4 = F ∧ K 4 |= ⊥

K 3K 4

F 41, S4 F 42, S2 F 41 = F ∧ K 4 ∧ K 41 |= ⊥

K 41 K 42

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 72

Page 73: SAT Solving – Parallel Search

Partition Tree With Shared Clauses

F = ((x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x2)

∧(x2 ∨ x4 ∨ x1) ∧ (x2 ∨ x4 ∨ x1)

∧(x4 ∨ x2 ∨ x5 ∨ x7) ∧ (x4 ∨ x2 ∨ x5) ∧ (x7 ∨ x8))

F 1 = (. . . ∧ (x2 ∨ x4 ∨ x1) ∧ (x4 ∨ x2 ∨ x5) ∧ (x4 ∨ x2 ∨ x5))

((x3 ∨ x2) ∧ (x2 ∨ x4)

∧(x2 ∨ x4) ∧ . . .)

(x1)

((x2 ∨ x3) ∧ (x3 ∨ x2) ∧ . . .)

F 121 = ((x2) ∧ (x4 ∨ x2 ∨ x5)

∧(x4 ∨ x2 ∨ x5))

(x3)

((x2) ∧ (x4 ∨ x2 ∨ x5)

∧(x4 ∨ x2 ∨ x5))

(x3)

(x1)

(x7)

F 2

(x7)

I D = (x4 ∨ x2) is learned by (x4 ∨ x2 ∨ x5)⊗ (x4 ∨ x2 ∨ x5) in formula F 121

I D depends on the partition constraint x7

I Hence, D can be shared in the subtree of F 1

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 73

Page 74: SAT Solving – Parallel Search

Partition Tree With Shared Clauses

F = ((x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x2)

∧(x2 ∨ x4 ∨ x1) ∧ (x2 ∨ x4 ∨ x1)

∧(x4 ∨ x2 ∨ x5 ∨ x7) ∧ (x4 ∨ x2 ∨ x5) ∧ (x7 ∨ x8))

F 1 = (. . . ∧ (x2 ∨ x4 ∨ x1) ∧ (x4 ∨ x2 ∨ x5) ∧ (x4 ∨ x2 ∨ x5))

((x3 ∨ x2) ∧ (x2 ∨ x4)

∧(x2 ∨ x4) ∧ . . .)

(x1)

((x2 ∨ x3) ∧ (x3 ∨ x2) ∧ . . .)

F 121 = ((x2) ∧ (x4 ∨ x2 ∨ x5)

∧(x4 ∨ x2 ∨ x5))

(x3)

((x2) ∧ (x4 ∨ x2 ∨ x5)

∧(x4 ∨ x2 ∨ x5))

(x3)

(x1)

(x7)

F 2

(x7)

I D = (x4 ∨ x2) is learned by (x4 ∨ x2 ∨ x5)⊗ (x4 ∨ x2 ∨ x5) in formula F 121

I D depends on the partition constraint x7I Hence, D can be shared in the subtree of F 1

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 74

Page 75: SAT Solving – Parallel Search

Not Discussed Here

I Sharing and Simplification

I Low-Level Parallelization

I Parallel Simplification

Steffen Holldobler and Norbert MantheySAT Solving – Parallel Search 75