SAT Solving - PowerPoint PPT Presentation

1 / 50
About This Presentation
Title:

SAT Solving

Description:

Asserts the value of the unassigned variable. cl implies and is its antecedent. ... No unassigned variables SAT. No decision variable to flip un-SAT. Optimized BCP ... – PowerPoint PPT presentation

Number of Views:119
Avg rating:3.0/5.0
Slides: 51
Provided by: aviy6
Category:

less

Transcript and Presenter's Notes

Title: SAT Solving


1
SAT Solving
Presented by Avi Yadgar
2
The SAT Problem
  • Given a Boolean formula , look for
    assignment A for such that
    .
  • A is a solution for .
  • A partial assignment assigns a subset of .
  • CNF representation of
  • is a conjunction of clauses
  • A clause is a disjunction of literals

3
The SAT Problem
  • ? (v1? v2? ? v5) ? (?v1? v7? ? v9) (v5? v7)
  • A satisfies ? A satisfies all its
    clauses.
  • Each clause needs one true literal
  • NP-Complete
  • Many applications
  • Very efficient solvers
  • Search / Proof engine

4
Boolean Constraint Propagation
  • Unit Clause A clause with exactly one unassigned
    literal, while all the rest are false.
  • Asserts the value of the unassigned variable.

v1 0 v2 1 v3 ?
v1 ?
cl ( v3)
v3 1
?v2 ?
v1 0
?v2 0
5
Boolean Constraint Propagation
  • Unit Clause A clause with exactly one unassigned
    literal, while all the rest are false.
  • Asserts the value of the unassigned variable.
  • cl implies and is its antecedent.
  • v1 and v2 are the antecedent variables of
  • BCP() Calculates all the possible implications.

v1 0 v2 1 v3 ?
v3 1
6
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.

7
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()

8
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()

9
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()
  • If a conflict occurs
  • Flip the highest decision variable not yet
    flipped.

10
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()
  • If a conflict occurs
  • Flip the highest decision variable not yet
    flipped.
  • Mark as flipped.

11
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()
  • If a conflict occurs
  • flip the highest decision variable not yet
    flipped.
  • Mark as flipped
  • Run bcp().

12
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()
  • If a conflict occurs
  • flip the highest decision variable not yet
    flipped.
  • Mark as flipped
  • Run bcp().

13
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Choose a decision variable and value.
  • Run bcp()
  • If a conflict occurs
  • flip the highest decision variable not yet
    flipped.
  • Mark as flipped
  • Run bcp().

14
DPLL Davis Putnam Logemann Loveland Backtrack
Search
  • Termination
  • No unassigned variables SAT
  • No decision variable to flip un-SAT

15
Optimized BCP
  • Solver spends 90 in BCP

16
The SAT Problem - Resolution
v2? ? v5
  • c1 (v1? v2? ? v5) , c2(?v1? v7? ? v9)

v7? ? v9
cres(c1 , c2) (v2? ? v5 ? v7? ? v9)
? ? cres ? ? ? ? cres
17
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
18
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v9
19
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v5
v9
20
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v5
v9
v8
21
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v5
v9
v8
v12
22
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v9
v8
v12
23
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
24
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
v4
25
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
v4
v1
26
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
v19
v4
v1
27
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
v19
v4
v1
v6
28
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
v19
v4
v1
v15
v6
29
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
v19
v3
v4
v1
v15
v6
30
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
Conflict
v19
v3
v4
v1
v15
v6
31
SAT Solving - Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12

v4
32
Learning Cuts
  • CUT A bi-partition of the graph.
  • The conflict is on the conflict side.
  • The decisions are on the reason side
  • No edge from the conflict side to the reason
    side.
  • The edges which cut the cut represent the reason
    to the conflict.

33
Learning Cuts
v9
Conflict
v4
34
Learning Conflict Clauses
Reason Side
Conflict Side
v7
v5
v3
v9
(v5,v7,v3) (v7,v15,v3)
Conflict
(v7,v5,v15)
v4
v15
  • v7,v5,v15 are the reason for the conflict.
  • Adding the clause will
    prevent it in the future.

35
Learning Conflict Clauses
v1
0
1
v2
v2
The clause (v2,v3) is created after a conflict
0
0
1
1
v3
v3
v3
v3
0
0
The search tree is pruned accordingly
36
Learning Conflict Clauses
  • Prevent the reason to the conflict.
  • Consists of the negation to the reason literals.
  • Prunes the search tree.
  • Different cuts yield different conflict clauses.
  • We choose cuts such that
  • Conflict clause includes one variable from the
    top level.
  • ? It is a unit clause after backtracking one
    level.
  • The new problem is equivalent to the original.

37
Learning Implication Graph
(v9,v5) (v9,v8) (v9,v12) (v5,v7) (v5,v7,v3) (v
4,v1) (v1,v12,v19) (v1,v6) (v6,v19,v8,v15) (v
7,v15,v3)
v7
v5
v3
v9
v8
v12
Conflict
v19
v3
v4
v1
v15
v6
38
Non Chronological Backtracking
  • Backtrack multiple levels instead of one.
  • Use conflict clause to determine the level
  • Backtrack to the minimum level where the clause
    is still asserting.
  • Emphasis on recent learning.

Conflict Clause (v10,v7,v2,v9)
39
Non Chronological Backtracking
v8
v8
1
1
v2
v2
0
0
v4
v9
0
1
v19
1
v6
1
40
Branching - VSIDS(Variable State Independent
Decaying Sum)
  • Counter for each literal
  • Updated when clauses are added
  • Branch on the literal with the highest rank
  • Divide counters periodically
  • Favors recent conflict clauses.
  • Recent gained knowledge

41
Restarts
  • After a fixed interval
  • Lengthen interval after each restart
  • Nullify all branching and implications
  • Keep conflict clauses
  • Leads to a new branching order
  • New score for the literals
  • Hopefully a better order

42
Branching for BMC
  • Add static ordering
  • Forward
  • backward
  • Branch on latches \ inputs

43
Branching for BMC
  • Create independent sub-problems

44
un-SAT Core
Conflict
45
un-SAT Core
v2
Conflict
46
un-SAT Core
47
un-SAT Core
  • Easily obtained from a DPLL SAT solver
  • Requires saving the resolution graph

48
Branching BerkMin \HaifaSAT
  • SAT as abstraction / refinement
  • Stack of added conflict clauses
  • Order clauses chronologically (BerkMin)
  • Order on clauses topologically (HaifaSAT)
  • Branch on a literal from the top clause

49
The Rise and Fall of Parallel SAT Solving
  • VERY appealing!
  • Obstacles
  • Dependencies
  • Communication
  • Parallelized BCP()
  • Centralized
  • Appealing since bcp() is 90 of the runtime
  • Useless since bcp() is only 90 of the runtime

50
The Rise and Fall of Parallel SAT Solving
  • Parallelize for BMC
  • Create independent formulae
  • Take advantage of symmetry
  • Share learned clauses
  • Inference is local
Write a Comment
User Comments (0)
About PowerShow.com