Accelerating MUS Extraction with Recursive Model Rotation Anton - - PowerPoint PPT Presentation

accelerating mus extraction with recursive model rotation
SMART_READER_LITE
LIVE PREVIEW

Accelerating MUS Extraction with Recursive Model Rotation Anton - - PowerPoint PPT Presentation

Accelerating MUS Extraction with Recursive Model Rotation Anton Belov and Joao Marques-Silva Complex and Adaptive Systems Laboratory School of Computer Science and Informatics University College Dublin, Ireland FMCAD 2011 October 31, 2011


slide-1
SLIDE 1

Accelerating MUS Extraction with Recursive Model Rotation

Anton Belov and Joao Marques-Silva

Complex and Adaptive Systems Laboratory School of Computer Science and Informatics University College Dublin, Ireland

FMCAD 2011 October 31, 2011 Austin, TX, USA

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 1 / 16

slide-2
SLIDE 2

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-3
SLIDE 3

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

◮ F ′ is minimally unsatisfiable subformula (MUS) of F

(F ′ ∈ MUS(F)) if F ′ ⊆ F and F ′ ∈ MU.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-4
SLIDE 4

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

◮ F ′ is minimally unsatisfiable subformula (MUS) of F

(F ′ ∈ MUS(F)) if F ′ ⊆ F and F ′ ∈ MU.

Example

C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z

◮ {C1, C2, C3, C4} ∈ MU.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-5
SLIDE 5

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

◮ F ′ is minimally unsatisfiable subformula (MUS) of F

(F ′ ∈ MUS(F)) if F ′ ⊆ F and F ′ ∈ MU.

Example

C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z

◮ {C1, C2, C3, C4} ∈ MU. ◮ F = {C1, . . . , C6} ∈ UNSAT, but /

∈ MU.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-6
SLIDE 6

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

◮ F ′ is minimally unsatisfiable subformula (MUS) of F

(F ′ ∈ MUS(F)) if F ′ ⊆ F and F ′ ∈ MU.

Example

C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z

◮ {C1, C2, C3, C4} ∈ MU. ◮ {C1, C2, C3, C4} ∈ MUS(F).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-7
SLIDE 7

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

◮ F ′ is minimally unsatisfiable subformula (MUS) of F

(F ′ ∈ MUS(F)) if F ′ ⊆ F and F ′ ∈ MU.

Example

C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z

◮ {C1, C2, C3, C4} ∈ MU. ◮ {C3, C4, C5, C6} ∈ MUS(F).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-8
SLIDE 8

Introduction

Minimal Unsatisfiability

◮ F is minimally unsatisfiable (F ∈ MU), if F ∈ UNSAT and for any

C ∈ F, F \ C ∈ SAT.

◮ F ′ is minimally unsatisfiable subformula (MUS) of F

(F ′ ∈ MUS(F)) if F ′ ⊆ F and F ′ ∈ MU.

Applications of MUSes (in formal methods)

◮ Abstraction refinement frameworks. ◮ Decision procedures. ◮ Design debugging.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 2 / 16

slide-9
SLIDE 9

Computation of MUSes

◮ Based on iterative calls to SAT solver (not the only way, but currently

the most effective): for each C ∈ F

◮ if F \ {C} ∈ UNSAT, then there is an MUS of F that does not contain

C → remove C from F.

◮ if F \ {C} ∈ SAT (C is necessary for F), then C is in all MUSes of F

→ keep C.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 3 / 16

slide-10
SLIDE 10

Computation of MUSes

◮ Based on iterative calls to SAT solver (not the only way, but currently

the most effective): for each C ∈ F

◮ if F \ {C} ∈ UNSAT, then there is an MUS of F that does not contain

C → remove C from F.

◮ if F \ {C} ∈ SAT (C is necessary for F), then C is in all MUSes of F

→ keep C.

◮ SAT solving is the main bottleneck of the computation, hence

reduction in the number of SAT solver calls is the key to efficiency.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 3 / 16

slide-11
SLIDE 11

Computation of MUSes

◮ Based on iterative calls to SAT solver (not the only way, but currently

the most effective): for each C ∈ F

◮ if F \ {C} ∈ UNSAT, then there is an MUS of F that does not contain

C → remove C from F.

◮ if F \ {C} ∈ SAT (C is necessary for F), then C is in all MUSes of F

→ keep C.

◮ SAT solving is the main bottleneck of the computation, hence

reduction in the number of SAT solver calls is the key to efficiency.

◮ On UNSAT outcomes – clause set refinement : remove C and all

clauses outside the unsatisfiable core of F \ {C}.

[Dershowitz et al’06]

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 3 / 16

slide-12
SLIDE 12

Computation of MUSes

◮ Based on iterative calls to SAT solver (not the only way, but currently

the most effective): for each C ∈ F

◮ if F \ {C} ∈ UNSAT, then there is an MUS of F that does not contain

C → remove C from F.

◮ if F \ {C} ∈ SAT (C is necessary for F), then C is in all MUSes of F

→ keep C.

◮ SAT solving is the main bottleneck of the computation, hence

reduction in the number of SAT solver calls is the key to efficiency.

◮ On UNSAT outcomes – clause set refinement : remove C and all

clauses outside the unsatisfiable core of F \ {C}.

[Dershowitz et al’06]

◮ On SAT outcomes – model rotation : detect additional necessary

clauses without SAT solver calls.

[Marques-Silva&Lynce’11]

Recursive model rotation (RMR) – very effective improvement of model rotation.

[this paper]

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 3 / 16

slide-13
SLIDE 13

Impact of RMR

◮ 500 benchmarks submitted to MUS track of SAT Competition 2011. ◮ Time limit 1200 sec, memory limit 4 GB.

1 10 100 1000 10000 1 10 100 1000 10000 MUSer2 (with RMR), # SAT solver calls MUSer2 w/o RMR, # SAT solver calls

◮ MUS computation without RMR (x-axis) vs with RMR (y-axis)

◮ Left: number of SAT solver calls (on instances solved in both cases).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 4 / 16

slide-14
SLIDE 14

Impact of RMR

◮ 500 benchmarks submitted to MUS track of SAT Competition 2011. ◮ Time limit 1200 sec, memory limit 4 GB.

1 10 100 1000 10000 1 10 100 1000 10000 MUSer2 (with RMR), # SAT solver calls MUSer2 w/o RMR, # SAT solver calls 0.1 1 10 100 1000 0.1 1 10 100 1000 MUSer2 (with RMR), CPU time (sec) MUSer2 w/o RMR, CPU time (sec)

◮ MUS computation without RMR (x-axis) vs with RMR (y-axis)

◮ Left: number of SAT solver calls (on instances solved in both cases). ◮ Right: CPU time (sec).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 4 / 16

slide-15
SLIDE 15

Computation of MUSes

Use SAT solver to identify necessary (or, transition ) clauses

◮ C ∈ F is necessary for F, if F ∈ UNSAT and F \ {C} ∈ SAT.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 5 / 16

slide-16
SLIDE 16

Computation of MUSes

Use SAT solver to identify necessary (or, transition ) clauses

◮ C ∈ F is necessary for F, if F ∈ UNSAT and F \ {C} ∈ SAT. ◮ F ∈ MU iff every clause C ∈ F is necessary for F.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 5 / 16

slide-17
SLIDE 17

Computation of MUSes

Use SAT solver to identify necessary (or, transition ) clauses

◮ C ∈ F is necessary for F, if F ∈ UNSAT and F \ {C} ∈ SAT. ◮ F ∈ MU iff every clause C ∈ F is necessary for F. ◮ If C is necessary for F then C is necessary for every unsatisfiable

subset of F.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 5 / 16

slide-18
SLIDE 18

Computation of MUSes

Use SAT solver to identify necessary (or, transition ) clauses

◮ C ∈ F is necessary for F, if F ∈ UNSAT and F \ {C} ∈ SAT. ◮ F ∈ MU iff every clause C ∈ F is necessary for F. ◮ If C is necessary for F then C is necessary for every unsatisfiable

subset of F.

Deletion-based MUS Computation

Input : F — an unsatisfiable CNF formula M ← F // Inv: M is a superset of some MUS of F foreach C ∈ F do if M \ {C} ∈ UNSAT then // is C necessary for M ? // no - delete it M ← M \ {C} // yes - keep it return M // Every C ∈ M is necessary for M

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 5 / 16

slide-19
SLIDE 19

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-20
SLIDE 20

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-21
SLIDE 21

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-22
SLIDE 22

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-23
SLIDE 23

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-24
SLIDE 24

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-25
SLIDE 25

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-26
SLIDE 26

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5 M \ {C2} ∈ UNSAT, hence C2 is not necessary

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-27
SLIDE 27

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5 M \ {C2} ∈ UNSAT, hence C2 is not necessary → M = M \ {C2}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-28
SLIDE 28

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5 M \ {C2} ∈ UNSAT, hence C2 is not necessary → M = M \ {C2} M \ {C4} ∈ SAT, hence C4 is necessary

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-29
SLIDE 29

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5 M \ {C2} ∈ UNSAT, hence C2 is not necessary → M = M \ {C2} M \ {C4} ∈ SAT, hence C4 is necessary → keep C4

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-30
SLIDE 30

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5 M \ {C2} ∈ UNSAT, hence C2 is not necessary → M = M \ {C2} M \ {C4} ∈ SAT, hence C4 is necessary → keep C4 M \ {C6} ∈ SAT, hence C6 is necessary

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-31
SLIDE 31

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = F ∈ UNSAT M \ {C1} ∈ UNSAT, hence C1 is not necessary → M = M \ {C1} M \ {C3} ∈ SAT, hence C3 is necessary → keep C3 M \ {C5} ∈ SAT, hence C5 is necessary → keep C5 M \ {C2} ∈ UNSAT, hence C2 is not necessary → M = M \ {C2} M \ {C4} ∈ SAT, hence C4 is necessary → keep C4 M \ {C6} ∈ SAT, hence C6 is necessary → keep C6

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-32
SLIDE 32

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = {C3, C4, C5, C6} is an MUS of F.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-33
SLIDE 33

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = {C3, C4, C5, C6} is an MUS of F.

◮ Each clause in F \ M costs one SAT solver call.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-34
SLIDE 34

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = {C3, C4, C5, C6} is an MUS of F.

◮ Each clause in F \ M costs ≤ 1 SAT solver call – clause set

refinement.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-35
SLIDE 35

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = {C3, C4, C5, C6} is an MUS of F.

◮ Each clause in F \ M costs ≤ 1 SAT solver call – clause set

refinement.

◮ Each clause in M costs one SAT solver call.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-36
SLIDE 36

Example

F = {C1, . . . , C6} M (an overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M = {C3, C4, C5, C6} is an MUS of F.

◮ Each clause in F \ M costs ≤ 1 SAT solver call – clause set

refinement.

◮ Each clause in M costs ≤ 1 SAT solver call – model rotation.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 6 / 16

slide-37
SLIDE 37

Model Rotation [Marques-Silva&Lynce, SAT’11]

◮ Fact: C is necessary for F iff F ∈ UNSAT and ∃τ such that

Unsat(F, τ) = {C}. τ is a witness (of necessity) for C.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 7 / 16

slide-38
SLIDE 38

Model Rotation [Marques-Silva&Lynce, SAT’11]

◮ Fact: C is necessary for F iff F ∈ UNSAT and ∃τ such that

Unsat(F, τ) = {C}. τ is a witness (of necessity) for C.

◮ During MUS extraction: when M \ {C} ∈ SAT, the assignment τ

found by the SAT solver is a witness for C.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 7 / 16

slide-39
SLIDE 39

Model Rotation [Marques-Silva&Lynce, SAT’11]

◮ Fact: C is necessary for F iff F ∈ UNSAT and ∃τ such that

Unsat(F, τ) = {C}. τ is a witness (of necessity) for C.

◮ During MUS extraction: when M \ {C} ∈ SAT, the assignment τ

found by the SAT solver is a witness for C.

◮ Model rotation: given a witness τ for C, try to modify it into a

witness τ ′ for another clause C ′. How ?

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 7 / 16

slide-40
SLIDE 40

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-41
SLIDE 41

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-42
SLIDE 42

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-43
SLIDE 43

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-44
SLIDE 44

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-45
SLIDE 45

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-46
SLIDE 46

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip x in τ ′: back to τ. C3 is already known to be necessary.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-47
SLIDE 47

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip x in τ ′: back to τ. C3 is already known to be necessary. Flip y in τ ′: τ ′′ = {x, ¬y, z}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-48
SLIDE 48

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip x in τ ′: back to τ. C3 is already known to be necessary. Flip y in τ ′: τ ′′ = {x, ¬y, z}, Unsat(M, τ ′′) = {C2, C6}.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-49
SLIDE 49

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip x in τ ′: back to τ. C3 is already known to be necessary. Flip y in τ ′: τ ′′ = {x, ¬y, z}, Unsat(M, τ ′′) = {C2, C6}. Tried all variables in C4 — stop.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-50
SLIDE 50

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip x in τ ′: back to τ. C3 is already known to be necessary. Flip y in τ ′: τ ′′ = {x, ¬y, z}, Unsat(M, τ ′′) = {C2, C6}. C4 is necessary, without SAT solver call.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 8 / 16

slide-51
SLIDE 51

Recursive Model Rotation (RMR) [this paper]

◮ Simple idea: when model rotation stops, backtrack to a necessary

clause detected earlier and flip another variable.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 9 / 16

slide-52
SLIDE 52

Recursive Model Rotation (RMR) [this paper]

◮ Simple idea: when model rotation stops, backtrack to a necessary

clause detected earlier and flip another variable.

◮ Fact: let τ be a witness for C in F, that is Unsat(F, τ) = {C}.

Then, the sets Unsat(F, τ|¬x) for x ∈ Var(C) are pairwise disjoint.

◮ By flipping different variables we are likely to detect new necessary

clauses.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 9 / 16

slide-53
SLIDE 53

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip x in τ ′: back to τ. C3 is already known to be necessary. Flip y in τ ′: τ ′′ = {x, ¬y, z}, Unsat(M, τ ′′) = {C2, C6}. Tried all variables in C4 — ///// stop go back to C3 and τ.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-54
SLIDE 54

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-55
SLIDE 55

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip y in τ: τ ′ = {¬x, ¬y, z}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-56
SLIDE 56

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip y in τ: τ ′ = {¬x, ¬y, z}, Unsat(M, τ ′) = {C6} → C6 is necessary.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-57
SLIDE 57

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip y in τ: τ ′ = {¬x, ¬y, z}, Unsat(M, τ ′) = {C6} → C6 is necessary. Flip z in τ ′: τ ′′ = {¬x, ¬y, ¬z}

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-58
SLIDE 58

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip y in τ: τ ′ = {¬x, ¬y, z}, Unsat(M, τ ′) = {C6} → C6 is necessary. Flip z in τ ′: τ ′′ = {¬x, ¬y, ¬z}, Unsat(M, τ ′′) = {C5} → C5 is necessary.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-59
SLIDE 59

Example

F = {C1, . . . , C6} M (the overapproximation of some MUS of F): C1 = x ∨ y C3 = x ∨ ¬y C5 = y ∨ z C2 = ¬x ∨ y C4 = ¬x ∨ ¬y C6 = y ∨ ¬z M \ {C3} ∈ SAT, hence C3 is necessary. SAT solver returns τ = {¬x, y, z}, Unsat(M, τ) = {C3}. Flip x in τ: τ ′ = {x, y, z}, Unsat(M, τ ′) = {C4} → C4 is necessary. Flip y in τ: τ ′ = {¬x, ¬y, z}, Unsat(M, τ ′) = {C6} → C6 is necessary. Flip z in τ ′: τ ′′ = {¬x, ¬y, ¬z}, Unsat(M, τ ′′) = {C5} → C5 is necessary. C4, C5, C6 are necessary, without SAT solver call.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 10 / 16

slide-60
SLIDE 60

Recursive Model Rotation (RMR)

Input: M — an over-approximation of an MUS : C — a clause necessary for M : τ — a witness for C (i.e. Unsat(M, τ) = {C}) foreach x ∈ Var(C) do τ ′ ← τ|¬x // flip x if Unsat(M, τ ′) = {C ′} and C ′ is not known to be necessary for M then mark C ′ as necessary RMR(M,C ′,τ ′)

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 11 / 16

slide-61
SLIDE 61

Recursive Model Rotation (RMR)

Input: M — an over-approximation of an MUS : C — a clause necessary for M : τ — a witness for C (i.e. Unsat(M, τ) = {C}) foreach x ∈ Var(C) do τ ′ ← τ|¬x // flip x if Unsat(M, τ ′) = {C ′} and C ′ is not known to be necessary for M then mark C ′ as necessary RMR(M,C ′,τ ′)

◮ The second condition of if keeps the number of the recursive calls

linear in the size of computed MUS.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 11 / 16

slide-62
SLIDE 62

Recursive Model Rotation (RMR)

◮ 500 benchmarks submitted to MUS track of SAT Competition 2011. ◮ Time limit 1200 sec, memory limit 4 GB.

0.1 1 10 100 1000 0.1 1 10 100 1000 MUSer2 recursive model rotation, CPU time (sec) MUSer2 model rotation, CPU time (sec)

◮ Left: model rotation (x-axis) vs. RMR (y-axis), CPU time (sec).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 12 / 16

slide-63
SLIDE 63

Recursive Model Rotation (RMR)

◮ 500 benchmarks submitted to MUS track of SAT Competition 2011. ◮ Time limit 1200 sec, memory limit 4 GB.

0.1 1 10 100 1000 0.1 1 10 100 1000 MUSer2 recursive model rotation, CPU time (sec) MUSer2 model rotation, CPU time (sec) 10 20 30 40 50 60 70 80 90 100 50 100 150 200 250 300 350 400 450 % of clauses in the computed MUS detected by (recusrive) model rotation Number of solved instances recursive MR MR

◮ Left: model rotation (x-axis) vs. RMR (y-axis), CPU time (sec). ◮ Right: % of clauses in the computed MUS detected by RMR (red)

and by (non-recursive) model rotation (blue).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 12 / 16

slide-64
SLIDE 64

MUSer2 — MUS extractor with RMR

◮ 295 benchmarks used in the MUS track of SAT Competition 2011. ◮ Time limit 1800 sec, memory limit 4 GB.

100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 CPU time (sec) number of solved instances (out of 295) MoUsSaka (SAT Comp 3rd place) Haifa-MUC, no-pre (SAT Comp 1st place) Haifa-MUC (SAT Comp 2nd place) MUSer2

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 13 / 16

slide-65
SLIDE 65

Summary

◮ Recursive Model Rotation (RMR) — simple but powerful technique

for acceleration of MUS extraction.

◮ Clause reordering (see the paper) — gives a slight performance edge. ◮ MUSer2 — state-of-the-art MUS extractor

◮ Download at http://logos.ucd.ie/wiki/doku.php?id=muser

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 14 / 16

slide-66
SLIDE 66

Summary

◮ Recursive Model Rotation (RMR) — simple but powerful technique

for acceleration of MUS extraction.

◮ Clause reordering (see the paper) — gives a slight performance edge. ◮ MUSer2 — state-of-the-art MUS extractor

◮ Download at http://logos.ucd.ie/wiki/doku.php?id=muser

Thank you for your attention !

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 14 / 16

slide-67
SLIDE 67

Impact of RMR

◮ 295 benchmarks used in the MUS track of SAT Competition 2011. ◮ Time limit 1800 sec, memory limit 4 GB.

1 10 100 1000 10000 100000 1 10 100 1000 10000 100000 MUSer2 (with RMR), # SAT solver calls MUSer2 w/o RMR, # SAT solver calls

◮ MUS computation without RMR (x-axis) vs with RMR (y-axis)

◮ Left: number of SAT solver calls (instances solved in both cases).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 15 / 16

slide-68
SLIDE 68

Impact of RMR

◮ 295 benchmarks used in the MUS track of SAT Competition 2011. ◮ Time limit 1800 sec, memory limit 4 GB.

1 10 100 1000 10000 100000 1 10 100 1000 10000 100000 MUSer2 (with RMR), # SAT solver calls MUSer2 w/o RMR, # SAT solver calls 0.1 1 10 100 1000 0.1 1 10 100 1000 MUSer2 (with RMR), CPU time (sec) MUSer2 w/o RMR, CPU time (sec)

◮ MUS computation without RMR (x-axis) vs with RMR (y-axis)

◮ Left: number of SAT solver calls (instances solved in both cases). ◮ Right: CPU time (sec).

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 15 / 16

slide-69
SLIDE 69

Model Rotation [Marques-Silva&Lynce, SAT’11]

◮ 500 benchmarks submitted to MUS track of SAT Competition 2011. ◮ Time limit 1200 sec, memory limit 4 GB.

0.1 1 10 100 1000 0.1 1 10 100 1000 MUSer2 model rotation, CPU time (sec) MUSer2 no model rotation, CPU time (sec) 10 20 30 40 50 60 70 80 90 100 50 100 150 200 250 300 350 400 450 % of clauses in the computed MUS detected by model rotation Number of solved instances

◮ Left: no model rotation (x-axis) vs. model rotation (y-axis). ◮ Right: % of clauses in computed MUS detected by model rotation.

  • A. Belov, J. Marques-Silva (UCD, Dublin)

Recursive Model Rotation FMCAD 2011 16 / 16