Download presentation
Presentation is loading. Please wait.
1
Building Structure into Local Search for SAT 1 Chris Reeson Advanced Constraint Processing Fall 2009 By Duc Nghia Pham, John Thornton, and Abdul Sattar, IJCAI 2007 Focus on How It Works
2
Outline Background – SAT & Local Search Building blocks – Modeling Structure in SAT with Logic Gates – Variables: Independent, Internal, External – Dependency Lattice Solving Structured SAT w/ Local Search – Computing costs with variables sets Conclusion 2
3
SAT Given a SAT sentence (in CNF= conjunction of clauses) Find an assignment to the Boolean variables that satisfies each clause. 3 ( a b c) (a b) (a c) clause variable abc a b ca ba c( a b c) (a b) (a c) 0001111 0011100 0101010 0111000 1000110 1011111 1101111 1111111
4
Quick Review of Local Search Process 1.Start from a random state (complete assignment of values to variables) 2.Evaluate quality of state 3.Explore neighborhood 4.Move to a neighbor 5.Goto 1 unless you’ve reached desired solution quality max # of iterations time limit Restart process to your heart’s content Two types of moves – Improvement – Random 4 States State Quality
5
Outline Background – SAT & Local Search Building blocks – Modeling Structure in SAT with Logic Gates – Variables: Independent, Internal, External – Dependency Lattice Solving Structured SAT w/ Local Search – Computing costs with variables sets Conclusion 5
6
Idea: Structure in SAT The variables are partitioned into – Independent variables – Dependent variables – External variables A solution is determined – By the assignment of only the independent variables – Such as all external variables evaluate to 1 Advantage: smaller problem, quicker convergence 2 |Indpdt vars| 6 0001 111 0 0 11 1
7
Logic Gates & Dependencies Dependencies between variables are modeled by logic gates Four types of logic gates are used: OR, AND, XOR, EQUIV Transformation of SAT problem – Cost of transformation? – # & size of alternative transformations? – For details, read [Ostrowski+ CP02][Ostrowski+ CP02] 7 OR AND XOR EQUIV (XNOR)
8
OR Gate 8 ( a b c) (a b) (a c) is equivalent to (b c a) ( b c a) b c a a = (b,c) abc a b ca ba c( a b c) (a b) (a c) 0001111 0011100 0101010 0111000 1000110 1011111 1101111 1111111
9
AND Gate 9 (a b c) ( a b) ( a c) Is equivalent to (b c a) ( b c a) b c a a = (b,c) abc a b c a b a c(a b c) ( a b) ( a c) 0001111 0011111 0101111 0110110 1001000 1011010 1101100 1111111
10
XOR Gate 10 ( a b c) (a b c) (a b c) ( a b c) is equivalent to ( b c a) (b c a) (b c a) ( b c a) abc a b ca b ca b c abcabc ( a b c) (a b c) (a b c) ( a b c) 00011111 00110110 01011010 01111111 10011100 10111111 11011111 11101110 b c a a = (b,c)
11
EQUIV Gate 11 (a b c) ( a b c) ( a b c) (a b c) is equivalent to (b c a) ( b c a) ( b c a) (b c a) b c a a = (b,c) abc abcabc a b c a b ca b c (a b c) ( a b c) ( a b c) (a b c) 00001110 00111111 01011111 01111100 10011111 10111010 11010110 11111111
12
EQUIV Gate = XNOR Gate 12 abc EQUIVXOR 00001 00110 01010 01101 10010 10101 11001 11110 ( a b c) (a b c) (a b c) ( a b c) is equivalent to ( b c a) (b c a) (b c a) ( b c a) Equivalence (a b c) ( a b c) ( a b c) (a b c) is equivalent to (b c a) ( b c a) ( b c a) (b c a)
13
Extending to Three or More Inputs AND & OR extend naturally – a = (b,c,d) or a = (b,c,d) EQUIV in pairwise fashion – a= (b,c,d) is a= (d, (b,c)) 13 bcd ANDOREQUIV 00000 00101 01001 01101 10001 10101 11001 11111 0 1 1 0 1 0 0 1 b c d a a b c d a d c b
14
Outline Background – SAT & Local Search Building blocks – Modeling Structure in SAT with Logic Gates – Variables: Independent, Internal, External – Dependency Lattice Solving Structured SAT w/ Local Search – Computing costs with variables sets Conclusion 14
15
Categorizing Variables (1) An independent variable is one – That is never dependent A dependent variable is one – Whose value is determined by one or more gates 15 b c a dependent independent b c a dependent d c b independent dependent independent
16
16 Dependency Lattice ( a b c) (a b) (a c) (b d c) ( b d) ( b c) cd b a or and Independent Dependent cdb a 0000 0100 1001 1111 b c a independent d c b dependent
17
Categorizing Variables (2) An independent variable is one – That is never dependent An internal gate is one – That can be recognized within the structure of the original CNF formula – All dependent variables from the original problem An external gate is one – Where the dependent variable is a clause from the original problem – Newly created dependent variables 17 S 1 =( a b c) (a b) (a c) (b d c) ( b d) ( b c) cd b a or and Independent Internal S 2 =( a b c) (a b) (a c) (b d c) ( b d) ( b c) (b d) e cd b a or and Independent Internal and External
18
Solving SAT Instantiate all independent variables such that all the external nodes evaluate to true 18 cd b a or and Independent Dependent cdb aS1S1 00001 01001 10011 11111 e cd b a or and Independent Internal and External cdb aeS2S2 000000 010000 100100 111111
19
Outline Background – SAT & Local Search Building blocks – Modeling Structure in SAT with Logic Gates – Variables: Independent, Internal, External – Dependency Lattice Solving Structured SAT w/ Local Search – Computing costs with variables sets Conclusion 19
20
Local Search for ‘Structured’ SAT 1.Instantiate the independent variables 2.Propagate values in the lattice & compute variable sets 3.Compute the make & break cost for each independent variable 4.Flip the independent variable w/ the smallest flip cost (make break?) or do a random move 5.Goto Step 2 6.Repeat until solution is found (external variables are all T) or run out of time.. 20
21
Start with an assignment of the independent variables Store at each gate as a variable set – The independent variables that, when flipped, will change the gate’s value Calculate the make cost of flipping an independent variable – The number of external variables that will be made true Calculate the break cost of flipping an independent variable – The number of external variables that will be made false 21 Make & Break Costs & Variable Sets e cd b a or and F F F F F {} {c} {} e cd b a or and F T F F F {c} {} e cd b a or and T T T T T {c, d} {} {c, d}
22
Updating Variable Sets Start from the independent variable – Flip its value – Propagate change downwards – Stop when a gate’s value and its variable list do not change 22 v1v1 v2v2 v4v4 v3v3 g1g1 g2g2 g3g3 c1c1 or and ↔ FFFT F T F F {v 3 } {v 2, v 3 } {v 1,v 2,v 3 } {v 2 } AND gate is T V ∪ {parents=T) F V ∩{parents=F} \ ∪ {parents=T} OR gate is F V ∪ {parents=F} T V ∩{parents=T} \ ∪ {parents=F} EQUIV V ∪ {parents} \ ∩ {parents}
23
Conclusion [Ostrowski+ CP02] used approach in BT search [Ostrowski+ CP02] [Pham+ IJCAI07] used approach in local search Experiments show strategy is competitive 23
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.