Parallel MUS Extraction Anton Belov 1 , Norbert Manthey 2 , and Joao - - PowerPoint PPT Presentation

parallel mus extraction
SMART_READER_LITE
LIVE PREVIEW

Parallel MUS Extraction Anton Belov 1 , Norbert Manthey 2 , and Joao - - PowerPoint PPT Presentation

Parallel MUS Extraction Anton Belov 1 , Norbert Manthey 2 , and Joao Marques-Silva 1 , 3 1 Complex and Adaptive Systems Laboratory, University College Dublin, Ireland 2 Institute of Artificial Intelligence, Technische Universit at Dresden,


slide-1
SLIDE 1

Parallel MUS Extraction

Anton Belov1, Norbert Manthey2, and Joao Marques-Silva1,3

1Complex and Adaptive Systems Laboratory, University College Dublin, Ireland 2Institute of Artificial Intelligence, Technische Universit¨

at Dresden, Germany

3IST/INESC-ID, Lisbon, Portugal

SAT 2013 July 10, 2013 Helsinki, Finland

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 1

slide-2
SLIDE 2

Minimal Unsatisfiable Subformulas (MUSes)

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (¬p ∨ r) C4 (p ∨ q) C5 (¬q ∨ ¬r) C6

M = {C1, C2, C3} is UNSAT

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 2

slide-3
SLIDE 3

Minimal Unsatisfiable Subformulas (MUSes)

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (¬p ∨ r) C4 (p ∨ q) C5 (¬q ∨ ¬r) C6

M = {C1, C2, C3} is UNSAT, and ∀C ∈ M, M \ {C} is SAT.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 2

slide-4
SLIDE 4

Minimal Unsatisfiable Subformulas (MUSes)

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (¬p ∨ r) C4 (p ∨ q) C5 (¬q ∨ ¬r) C6

M = {C1, C2, C3} is minimal unsatisfiable (MU) .

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 2

slide-5
SLIDE 5

Minimal Unsatisfiable Subformulas (MUSes)

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (¬p ∨ r) C4 (p ∨ q) C5 (¬q ∨ ¬r) C6

M = {C1, C2, C3} is minimal unsatisfiable (MU) . F = {C1, . . . , C6} is UNSAT, but not MU.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 2

slide-6
SLIDE 6

Minimal Unsatisfiable Subformulas (MUSes)

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (¬p ∨ r) C4 (p ∨ q) C5 (¬q ∨ ¬r) C6

M = {C1, C2, C3} is minimal unsatisfiable (MU) . F = {C1, . . . , C6} is UNSAT, but not MU. M is a minimal unsatisfiable subformula (MUS) of F.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 2

slide-7
SLIDE 7

Minimal Unsatisfiable Subformulas (MUSes)

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (¬p ∨ r) C4 (p ∨ q) C5 (¬q ∨ ¬r) C6

M = {C1, C2, C3} is minimal unsatisfiable (MU) . F = {C1, . . . , C6} is UNSAT, but not MU. M is a minimal unsatisfiable subformula (MUS) of F.

Applications

Identification and repair of sources of inconsistency:

  • circuit error diagnosis; error localization in product configuration

Identification of important/relevant features of systems:

  • automatic abstraction in model checking
  • environmental assumptions in formal equivalence checking

Complexity Decision: DP-complete. Function: ∈ FPNP

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 2

slide-8
SLIDE 8

MUS Extraction

Based on detection of necessary (or, transition ) clauses:

◮ C ∈ F is necessary for F if F ∈ UNSAT and F \ {C} ∈ SAT. ◮ If C is necessary for F, then C is in every MUS of F.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 3

slide-9
SLIDE 9

MUS Extraction

Based on detection of necessary (or, transition ) clauses:

◮ C ∈ F is necessary for F if F ∈ UNSAT and F \ {C} ∈ SAT. ◮ If C is necessary for F, then C is in every MUS of F.

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) st = SAT(Fw \ {C}) // Test if C is nec. for Fw if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← Fw \ {C} return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 3

slide-10
SLIDE 10

MUS Extraction

Based on detection of necessary (or, transition ) clauses:

◮ C ∈ F is necessary for F if F ∈ UNSAT and F \ {C} ∈ SAT. ◮ If C is necessary for F, then C is in every MUS of F.

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) (st, U, τ) = SAT(Fw \ {C}) // U - unsat. core, τ - model if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← U // Clause-set refinement: discard non-core clauses return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 3

slide-11
SLIDE 11

MUS Extraction: opportunities for parallelization

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) (st, U, τ) = SAT(Fw \ {C}) // U - unsat. core, τ - model if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← U // Clause-set refinement: discard non-core clauses return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 4

slide-12
SLIDE 12

MUS Extraction: opportunities for parallelization

  • 1. Parallelize each SAT call

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) (st, U, τ) = SAT(Fw \ {C}) // U - unsat. core, τ - model if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← U // Clause-set refinement: discard non-core clauses return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 4

slide-13
SLIDE 13

MUS Extraction: opportunities for parallelization

  • 1. Parallelize each SAT call
  • 2. Parallelize the main loop, i.e. test multiple clauses

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) (st, U, τ) = SAT(Fw \ {C}) // U - unsat. core, τ - model if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← U // Clause-set refinement: discard non-core clauses return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 4

slide-14
SLIDE 14

MUS Extraction: opportunities for parallelization

  • 1. Parallelize each SAT call
  • 2. Parallelize the main loop, i.e. test multiple clauses
  • 3. Parallel portfolio of MUS extractors

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) (st, U, τ) = SAT(Fw \ {C}) // U - unsat. core, τ - model if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← U // Clause-set refinement: discard non-core clauses return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 4

slide-15
SLIDE 15

MUS Extraction: opportunities for parallelization

  • 1. Parallelize each SAT call
  • 2. Parallelize the main loop, i.e. test multiple clauses ← this talk/paper
  • 3. Parallel portfolio of MUS extractors

Input → Output: F ∈ UNSAT → M ∈ MUS(F) Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do // Inv: M ⊆ F, and ∀C ∈ M is nec. for Fw C ← PickClause(Fw) (st, U, τ) = SAT(Fw \ {C}) // U - unsat. core, τ - model if st = true then // If SAT, C is nec. for Fw M ← M ∪ {C} RMR(Fw, M, τ) // Model rotation: find more nec. clauses else Fw ← U // Clause-set refinement: discard non-core clauses return M // M ∈ MUS(F)

◮ Hybrid MUS extraction algorithm [Marques-Silva&Lynce’11]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 4

slide-16
SLIDE 16

Parallelizing the main loop

Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do {C1, C2} ← PickClauses(Fw) (st1, U1, τ1) = SAT(Fw \ {C1}) || (st2, U2, τ2) = SAT(Fw \ {C2}) sleepUntilFinished() // Wait for both threads to finish if st1 = true and st2 = true then M ← M ∪ {C1, C2} RMR(Fw, M, τ1) ; RMR(Fw, M, τ2) else if st1 = true and st2 = false then M ← M ∪ {C1} RMR(Fw, M, τ1) ; Fw ← U2 else if st1 = false and st2 = true then M ← M ∪ {C2} RMR(Fw, M, τ2) ; Fw ← U1 else Fw ← PickCore(U1, U2) // Pick one of the cores return M // M ∈ MUS(F)

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 5

slide-17
SLIDE 17

Parallelizing the main loop

Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do {C1, C2} ← PickClauses(Fw) (st1, U1, τ1) = SAT(Fw \ {C1}) || (st2, U2, τ2) = SAT(Fw \ {C2}) sleepUntilFinished() // Wait for both threads to finish if st1 = true and st2 = true then M ← M ∪ {C1, C2} RMR(Fw, M, τ1) ; RMR(Fw, M, τ2) else if st1 = true and st2 = false then M ← M ∪ {C1} RMR(Fw, M, τ1) ; Fw ← U2 else if st1 = false and st2 = true then M ← M ∪ {C2} RMR(Fw, M, τ2) ; Fw ← U1 else Fw ← PickCore(U1, U2) // Pick one of the cores return M // M ∈ MUS(F)

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 5

slide-18
SLIDE 18

Parallelizing the main loop

Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do {C1, C2} ← PickClauses(Fw) (st1, U1, τ1) = SAT(Fw \ {C1}) || (st2, U2, τ2) = SAT(Fw \ {C2}) sleepUntilFinished() // Wait for both threads to finish if st1 = true and st2 = true then M ← M ∪ {C1, C2} RMR(Fw, M, τ1) ; RMR(Fw, M, τ2) else if st1 = true and st2 = false then M ← M ∪ {C1} RMR(Fw, M, τ1) ; Fw ← U2 else if st1 = false and st2 = true then M ← M ∪ {C2} RMR(Fw, M, τ2) ; Fw ← U1 else Fw ← PickCore(U1, U2) // Pick one of the cores return M // M ∈ MUS(F)

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 5

slide-19
SLIDE 19

Parallelizing the main loop

Fw, M ← F, ∅ // Working formula, MUS under-approx. while M = Fw do {C1, C2} ← PickClauses(Fw) (st1, U1, τ1) = SAT(Fw \ {C1}) || (st2, U2, τ2) = SAT(Fw \ {C2}) sleepUntilFinished() // Wait for both threads to finish if st1 = true and st2 = true then M ← M ∪ {C1, C2} RMR(Fw, M, τ1) ; RMR(Fw, M, τ2) else if st1 = true and st2 = false then M ← M ∪ {C1} RMR(Fw, M, τ1) ; Fw ← U2 else if st1 = false and st2 = true then M ← M ∪ {C2} RMR(Fw, M, τ2) ; Fw ← U1 else Fw ← PickCore(U1, U2) // Pick one of the cores return M // M ∈ MUS(F)

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 5

slide-20
SLIDE 20

Parallelizing the main loop

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) sequential 144 186.46 (y) parallel, 4 thr. 143 154.93

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 6

slide-21
SLIDE 21

Parallelizing the main loop

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) sequential 144 186.46 (y) parallel, 4 thr. 143 154.93

Shortcomings

(i) Threads are under-utilized because of synchronization. (ii) No communication , i.e. exchange of learned clauses between threads.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 6

slide-22
SLIDE 22

Parallelizing the main loop: de-synchronizing

Technicalities

“Outdated” SAT outcomes are OK — if C is necessary for Fw, it is also necessary for F ′

w ⊂ Fw.

“Outdated” UNSAT cores might be not — test if U ⊆ Fw, if not drop it.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 7

slide-23
SLIDE 23

Parallelizing the main loop: de-synchronizing

Technicalities

“Outdated” SAT outcomes are OK — if C is necessary for Fw, it is also necessary for F ′

w ⊂ Fw.

“Outdated” UNSAT cores might be not — test if U ⊆ Fw, if not drop it.

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) parallel, 4 thr. 143 154.93 synchronous (y) parallel, 4 thr. 146 126.45 asynchronous

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 7

slide-24
SLIDE 24

Parallelizing the main loop: communication

Would like to exchange clauses between threads Problem: threads work on different formulas → clauses learned by one might be not valid for another.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 8

slide-25
SLIDE 25

Parallelizing the main loop: communication

Would like to exchange clauses between threads Problem: threads work on different formulas → clauses learned by one might be not valid for another.

(p) C1 (q) C2 (¬p ∨ ¬q) C3

F Thread 1: solves SAT(F \ {C1}), derives (¬p). Thread 2: works on SAT(F \ {C2}), receives (¬p), returns UNSAT.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 8

slide-26
SLIDE 26

Parallelizing the main loop: communication

Would like to exchange clauses between threads Problem: threads work on different formulas → clauses learned by one might be not valid for another.

(p) C1 (q) C2 (¬p ∨ ¬q) C3

F Thread 1: solves SAT(F \ {C1}), derives (¬p). Thread 2: works on SAT(F \ {C2}), receives (¬p), returns UNSAT. Solution: assumption-based, incremental SAT [E´

en, S¨

  • rensson, ENTCS 2003]

Note: most modern MUS extractors use assumption-based incremental SAT anyway.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 8

slide-27
SLIDE 27

Assumption-based incremental SAT [E´

en, S¨

  • rensson, ENTCS 2003]

SAT solver interface add({C1, . . . , Cn}) — add clauses C1, . . . , Cn to the SAT solver. solve({l1, . . . , lk}) — determine the satisfiability of the current set of clauses under a partial assignment defined by literals {l1, . . . , lk}.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 9

slide-28
SLIDE 28

Assumption-based incremental SAT [E´

en, S¨

  • rensson, ENTCS 2003]

SAT solver interface add({C1, . . . , Cn}) — add clauses C1, . . . , Cn to the SAT solver. solve({l1, . . . , lk}) — determine the satisfiability of the current set of clauses under a partial assignment defined by literals {l1, . . . , lk}.

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (p ∨ q) C4

F

(a1 ∨ p) C1 (a2 ∨ q) C2 (a3 ∨ ¬p ∨ ¬q) C3 (a4 ∨ p ∨ q) C4

FA

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 9

slide-29
SLIDE 29

Assumption-based incremental SAT [E´

en, S¨

  • rensson, ENTCS 2003]

SAT solver interface add({C1, . . . , Cn}) — add clauses C1, . . . , Cn to the SAT solver. solve({l1, . . . , lk}) — determine the satisfiability of the current set of clauses under a partial assignment defined by literals {l1, . . . , lk}.

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (p ∨ q) C4

F

(a1 ∨ p) C1 (a2 ∨ q) C2 (a3 ∨ ¬p ∨ ¬q) C3 (a4 ∨ p ∨ q) C4

FA To test F \ {C1}: add(FA); solve({a1, ¬a2, ¬a3, ¬a4}) → SAT, model To test F \ {C4}: add(FA); solve({¬a1, ¬a2, ¬a3, a4}) → UNSAT, core

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 9

slide-30
SLIDE 30

Assumption-based incremental SAT [E´

en, S¨

  • rensson, ENTCS 2003]

SAT solver interface add({C1, . . . , Cn}) — add clauses C1, . . . , Cn to the SAT solver. solve({l1, . . . , lk}) — determine the satisfiability of the current set of clauses under a partial assignment defined by literals {l1, . . . , lk}.

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (p ∨ q) C4

F

(a1 ∨ p) C1 (a2 ∨ q) C2 (a3 ∨ ¬p ∨ ¬q) C3 (a4 ∨ p ∨ q) C4

FA To test F \ {C1}: add(FA); solve({a1, ¬a2, ¬a3, ¬a4}) → SAT, model To test F \ {C4}: add(FA); solve({¬a1, ¬a2, ¬a3, a4}) → UNSAT, core Note: learned clauses are entailed by input clauses — can be exchanged.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 9

slide-31
SLIDE 31

Assumption-based incremental SAT [E´

en, S¨

  • rensson, ENTCS 2003]

SAT solver interface add({C1, . . . , Cn}) — add clauses C1, . . . , Cn to the SAT solver. solve({l1, . . . , lk}) — determine the satisfiability of the current set of clauses under a partial assignment defined by literals {l1, . . . , lk}.

(p) C1 (q) C2 (¬p ∨ ¬q) C3 (p ∨ q) C4

F

(a1 ∨ p) C1 (a2 ∨ q) C2 (a3 ∨ ¬p ∨ ¬q) C3 (a4 ∨ p ∨ q) C4

FA To test F \ {C1}: add(FA); solve({a1, ¬a2, ¬a3, ¬a4}) → SAT, model To test F \ {C4}: add(FA); solve({¬a1, ¬a2, ¬a3, a4}) → UNSAT, core Note: learned clauses are entailed by input clauses — can be exchanged. To “remove” C4 from FA : add({ (a4) }). To finalize C1 in FA : add({ (¬a1) }).

Note: there is another approach [Marques-Silva, Sakallah, FTCS 1997; Nadel, Ryvchin, SAT 2012]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 9

slide-32
SLIDE 32

Incremental SAT and Parallel MUS Extraction (sync)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA

F 2

w = FA

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT UNSAT add({(a1), (¬a2)}) add({(a1), (¬a2)}) solve({a3, ¬a4, ¬a5, . . . }) solve({¬a3, a4, ¬a5, . . . })

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 10

slide-33
SLIDE 33

Incremental SAT and Parallel MUS Extraction (sync)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA ∪ {(a1), (¬a2)}

F 2

w = FA ∪ {(a1), (¬a2)}

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT UNSAT add({(a1), (¬a2)}) add({(a1), (¬a2)}) solve({a3, ¬a4, ¬a5, . . . }) solve({¬a3, a4, ¬a5, . . . })

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 10

slide-34
SLIDE 34

Incremental SAT and Parallel MUS Extraction (sync)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA ∪ {(a1), (¬a2)}

F 2

w = FA ∪ {(a1), (¬a2)}

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT UNSAT add({(a1), (¬a2)}) add({(a1), (¬a2)}) solve({a3, ¬a4, ¬a5, . . . }) solve({¬a3, a4, ¬a5, . . . })

Threads always work on the same formula → unrestricted clause exchange.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 10

slide-35
SLIDE 35

Incremental SAT and Parallel MUS Extraction (async)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA

F 2

w = FA

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT add({(¬a2)}) UNSAT solve({¬a1, a3, ¬a4, . . . })

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 11

slide-36
SLIDE 36

Incremental SAT and Parallel MUS Extraction (async)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA

F 2

w = FA ∪ {(¬a2)}

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT add({(¬a2)}) UNSAT solve({¬a1, a3, ¬a4, . . . })

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 11

slide-37
SLIDE 37

Incremental SAT and Parallel MUS Extraction (async)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA

F 2

w = FA ∪ {(¬a2)}

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT add({(¬a2)}) UNSAT solve({¬a1, a3, ¬a4, . . . })

Threads work on different formulas: Thread 1 → Thread 2 is ok.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 11

slide-38
SLIDE 38

Incremental SAT and Parallel MUS Extraction (async)

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . }

F 1

w = FA

F 2

w = FA ∪ {(¬a2)}

Thread 1 Master Thread 2

add(FA) add(FA) solve({a1, ¬a2, ¬a3, . . . }) solve({¬a1, a2, ¬a3, . . . }) SAT add({(¬a2)}) UNSAT solve({¬a1, a3, ¬a4, . . . })

Threads work on different formulas: Thread 2 → Thread 1 ?

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 11

slide-39
SLIDE 39

Soundness of “back” communication

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . } Thread 1 (“behind”): F 1

w = FA, solve({a1, ¬a2, ¬a3, . . . })

Thread 2 (“ahead”): F 2

w = FA ∪ {(¬a2)}, solve({¬a1, a3, ¬a4, . . . })

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 12

slide-40
SLIDE 40

Soundness of “back” communication

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . } Thread 1 (“behind”): F 1

w = FA, solve({a1, ¬a2, ¬a3, . . . })

Thread 2 (“ahead”): F 2

w = FA ∪ {(¬a2)}, solve({¬a1, a3, ¬a4, . . . })

C – a clause learned by Thread 2. We have FA ∪ {(¬a2)} C. C is not entailed by FA, but since Thread 1 is solving under assumption ¬a2, it is valid for the duration of the call. Before the next call (¬a2) will be added to Thread 1 by the Master, and C will be again entailed by the input clauses.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 12

slide-41
SLIDE 41

Soundness of “back” communication

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . } Thread 1 (“behind”): F 1

w = FA, solve({a1, ¬a2, ¬a3, . . . })

Thread 2 (“ahead”): F 2

w = FA ∪ {(a2)}, solve({¬a1, a3, ¬a4, . . . })

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 13

slide-42
SLIDE 42

Soundness of “back” communication

FA = {(a1 ∨ C1), (a2 ∨ C2), (a3 ∨ C3), (a4 ∨ C4), . . . } Thread 1 (“behind”): F 1

w = FA, solve({a1, ¬a2, ¬a3, . . . })

Thread 2 (“ahead”): F 2

w = FA ∪ {(a2)}, solve({¬a1, a3, ¬a4, . . . })

C – a clause learned by Thread 2. Since a2 appears only positively in FA, no clause with a2 will participate in the conflict. So, FA C, and C can be used by Thread 1.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 13

slide-43
SLIDE 43

Soundness of “back” communication

The devil is in the details (and the details are in the paper)

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 14

slide-44
SLIDE 44

Soundness of “back” communication

The devil is in the details (and the details are in the paper)

In the presence of model rotation and clause set refinement a worker may become “redundant”. Redundant workers must be aborted to ensure soundness.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 14

slide-45
SLIDE 45

Soundness of “back” communication

The devil is in the details (and the details are in the paper)

In the presence of model rotation and clause set refinement a worker may become “redundant”. Redundant workers must be aborted to ensure soundness. Workers that are “behind” may return a subset of UNSAT core — the Master can handle this with no overhead.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 14

slide-46
SLIDE 46

Soundness of “back” communication

The devil is in the details (and the details are in the paper)

In the presence of model rotation and clause set refinement a worker may become “redundant”. Redundant workers must be aborted to ensure soundness. Workers that are “behind” may return a subset of UNSAT core — the Master can handle this with no overhead. Formal description of the algorithm and the correctness proof are in the paper.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 14

slide-47
SLIDE 47

Soundness of “back” communication

The devil is in the details (and the details are in the paper)

In the presence of model rotation and clause set refinement a worker may become “redundant”. Redundant workers must be aborted to ensure soundness. Workers that are “behind” may return a subset of UNSAT core — the Master can handle this with no overhead. Formal description of the algorithm and the correctness proof are in the paper. Bottom line: unrestricted communication is possible — due to the assumption-based incremental SAT.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 14

slide-48
SLIDE 48

Improving communication

Would like to exchange promising clauses only.

◮ Restrict clause size (def: ≤ 10) ◮ Restrict clause LBD (def: ≤ 5) ◮ Optionally: change the limits dynamically ◮ Initialize (“bump”) activity of received clauses.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 15

slide-49
SLIDE 49

Improving communication

Would like to exchange promising clauses only.

◮ Restrict clause size (def: ≤ 10) ◮ Restrict clause LBD (def: ≤ 5) ◮ Optionally: change the limits dynamically ◮ Initialize (“bump”) activity of received clauses.

Important observation: assumptions are “second-class” citizens

A clause (a1 ∨ · · · ∨ ak ∨ x) is essentially a unit clause. But might be either too long, or have a high LBD (each assumption has its own level).

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 15

slide-50
SLIDE 50

Improving communication

Would like to exchange promising clauses only.

◮ Restrict clause size (def: ≤ 10) ◮ Restrict clause LBD (def: ≤ 5) ◮ Optionally: change the limits dynamically ◮ Initialize (“bump”) activity of received clauses.

Important observation: assumptions are “second-class” citizens

A clause (a1 ∨ · · · ∨ ak ∨ x) is essentially a unit clause. But might be either too long, or have a high LBD (each assumption has its own level). Assumption “protection”: ignore assumptions when computing the values for filters.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 15

slide-51
SLIDE 51

Improving communication

Would like to exchange promising clauses only.

◮ Restrict clause size (def: ≤ 10) ◮ Restrict clause LBD (def: ≤ 5) ◮ Optionally: change the limits dynamically ◮ Initialize (“bump”) activity of received clauses.

Important observation: assumptions are “second-class” citizens

A clause (a1 ∨ · · · ∨ ak ∨ x) is essentially a unit clause. But might be either too long, or have a high LBD (each assumption has its own level). Assumption “protection”: ignore assumptions when computing the values for filters.

Note: a good idea for non-parallel MUS extraction as well [Audemard, Lagniez, Simon, SAT 2013] (tomorrow morning).

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 15

slide-52
SLIDE 52

Parallelizing the main loop: communication

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) parallel, 4 thr. 146 126.45 no communication (y) parallel, 4 thr. 153 133.98 communication

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 16

slide-53
SLIDE 53

Parallelizing the main loop: communication

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) parallel, 4 thr. 146 126.45 no communication (y) parallel, 4 thr. 153 133.98 communication

Communication is essential for performance. Sound communication is enabled by incremental SAT.

Note: interestingly, sound resolution-based preprocessing for MUS extraction is also enabled by incremental SAT [Belov, J¨

arvisalo, Marques-Silva, TACAS 2013]

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 16

slide-54
SLIDE 54

Impact of “back” communication

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) parallel, 4 thr. 147 130.63 no back comm. (y) parallel, 4 thr. 153 133.98 full comm

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 17

slide-55
SLIDE 55

Impact of “back” communication

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) parallel, 4 thr. 147 130.63 no back comm. (y) parallel, 4 thr. 153 133.98 full comm

“Back” communication is actually quite crucial.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 17

slide-56
SLIDE 56

Parallelizing the main loop: communication

175 benchs, MUS track, SC’11. wall-clock limit 1800 sec memory limit 16 GB. #sol. avg.time (x) sequential 144 186.46 (y) parallel, 4 thr. 153 133.98

  • async. + comm.
  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 18

slide-57
SLIDE 57

Performance and scalability from 4 to 8 cores

  • Min. speedup
  • Avg. sp.
  • Max. sp.
  • Med. sp.
  • Seq. vs 4 cores

0.49x 4.09x 132.59x 2.94x

  • Seq. vs 8 cores

0.28x 4.01x 97.66x 3.38x

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 19

slide-58
SLIDE 58

Performance and scalability from 4 to 8 cores

  • Min. speedup
  • Avg. sp.
  • Max. sp.
  • Med. sp.
  • Seq. vs 4 cores

0.49x 4.09x 132.59x 2.94x

  • Seq. vs 8 cores

0.28x 4.01x 97.66x 3.38x Possible reasons: (i) duplication of work; (ii) parallelization overhead on easy SAT calls.

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 19

slide-59
SLIDE 59

Final Remarks

Also in the paper ...

◮ “Core-based” scheduling — a slight improvement on 8 cores. ◮ Results for group-MUS — less exciting than for plain-MUS. ◮ Comparison with TarmoMUS [Wieringa, CP 2012 and Wieringa, Heljanko, TACAS 2013] ...

see the paper

Main points

◮ Incremental SAT is a key technology for for enabling efficient parallel

MUS extraction.

◮ Assumptions should be treated as superfluous during clause exchange. ◮ Good scalability to 4 cores; but not 8. Possible approaches:

◮ A good partitioning/job distribution heuristic. ◮ Parallel portfolio of MUS extractors ?

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 20

slide-60
SLIDE 60

Final Remarks

Also in the paper ...

◮ “Core-based” scheduling — a slight improvement on 8 cores. ◮ Results for group-MUS — less exciting than for plain-MUS. ◮ Comparison with TarmoMUS [Wieringa, CP 2012 and Wieringa, Heljanko, TACAS 2013] ...

see the paper

Main points

◮ Incremental SAT is a key technology for for enabling efficient parallel

MUS extraction.

◮ Assumptions should be treated as superfluous during clause exchange. ◮ Good scalability to 4 cores; but not 8. Possible approaches:

◮ A good partitioning/job distribution heuristic. ◮ Parallel portfolio of MUS extractors ?

Thank you for your attention !

  • A. Belov, N. Manthey, J. Marques-Silva

Parallel MUS Extraction SAT 2013 # 20