Download presentation
Presentation is loading. Please wait.
Published byAdrian Mason Modified over 9 years ago
1
“Predicting Learnt Clauses Quality in Modern SAT Solvers” & “Blocked Clause Elimination” Ateeq Sharfuddin CS 297: Championship Algorithms
2
Topics 1. Audemard, G. and Simon, L. “Predicting Learnt Clauses Quality in Modern SAT Solvers.” 2. Järvisalo, M. et al. “Blocked Clause Elimination.”
3
Basic SAT Background Given a Boolean variable x, there are two literals: Given a Boolean variable x, there are two literals: x(a positive literal) -x(a negative literal) A clause is a disjunction of literals: A clause is a disjunction of literals: -x + y A CNF formula is a conjunction of clauses: A CNF formula is a conjunction of clauses: (-x + y) (a + x + -b)
4
Audemard and Simon’s paper (1) Specific to Conflict Directed Clause Learning (CDCL) solvers. Specific to Conflict Directed Clause Learning (CDCL) solvers. Describes results of experiments exploiting a phenomenon in CDCL solvers (on industrial problems). Describes results of experiments exploiting a phenomenon in CDCL solvers (on industrial problems). Describes a static measure to quantify “learnt clause” usefulness. Describes a static measure to quantify “learnt clause” usefulness. Introduces this measure to CDCL solvers. Introduces this measure to CDCL solvers. Compares performance of the GLUCOSE solvers with other current state-of-art solvers. Compares performance of the GLUCOSE solvers with other current state-of-art solvers.
5
Conflict Directed Clause Learning (CDCL) Basic Idea: Basic Idea: When backtracking, add new clauses corresponding to causes of failure of the search. When backtracking, add new clauses corresponding to causes of failure of the search. A typical branch of a CDCL solver: a sequence of decisions followed by propagations, repeated until a conflict is reached [1]. A typical branch of a CDCL solver: a sequence of decisions followed by propagations, repeated until a conflict is reached [1].
6
Modern SAT Solvers (1) Not much new development since: Not much new development since: zChaff (2001), an efficient implementation of DPLL zChaff (2001), an efficient implementation of DPLL MINISAT (2005) MINISAT (2005) Most solvers are essentially a rehash of zChaff, with data structure tricks and a few minor improvements like Most solvers are essentially a rehash of zChaff, with data structure tricks and a few minor improvements like Phase caching (Pipatsrisawat et al. 2007) Phase caching (Pipatsrisawat et al. 2007) Luby restarts (Huang, 2007) Luby restarts (Huang, 2007) Modern SAT solvers focus on reaching conflicts as soon as possible: Modern SAT solvers focus on reaching conflicts as soon as possible: Boolean Constraint Propagation (BCP) Boolean Constraint Propagation (BCP) Variable State Independent Decaying Sum (VSIDS) heuristics. Variable State Independent Decaying Sum (VSIDS) heuristics.
7
Boolean Constraint Propagation The iterative process of setting all unit literals the value true until encountering an empty clause or no unit clause remains in the formula. The iterative process of setting all unit literals the value true until encountering an empty clause or no unit clause remains in the formula. “Heart” of modern SAT solvers [1]. “Heart” of modern SAT solvers [1].
8
Variable State Independent Decaying Sum (VSIDS) heuristics Favors variables that are used recently and used often. Favors variables that are used recently and used often. Used in conflict analysis and determining future learnt clause usefulness. Used in conflict analysis and determining future learnt clause usefulness. Solvers tend to let the maximum number of learnt clauses grow exponentially, as deleting a useful clause can have dramatic effect on performance. Solvers tend to let the maximum number of learnt clauses grow exponentially, as deleting a useful clause can have dramatic effect on performance.
9
Audemard and Simon’s First Experiment Ran MINISAT on a selection of benchmarks from last SAT contests and races. Ran MINISAT on a selection of benchmarks from last SAT contests and races. Each time a conflict x c is reached for a benchmark, store decision level y l. Each time a conflict x c is reached for a benchmark, store decision level y l. Limit the search to two million conflicts. Limit the search to two million conflicts. Compute a simple least-square linear regression (characteristic line, formula: y = mx + b) on the set of points (x c, y l ). Compute a simple least-square linear regression (characteristic line, formula: y = mx + b) on the set of points (x c, y l ). If m is negative, decision levels decrease during the search. If m is negative, decision levels decrease during the search. If m is negative, when the solver will finish the search can be trivially “predicted.” If m is negative, when the solver will finish the search can be trivially “predicted.” If the solver follows the characteristic line, the solver will finish when this line intersects the x-axis. If the solver follows the characteristic line, the solver will finish when this line intersects the x-axis. This point is called the “look-back justification” point and has coordinates (-b/m, 0). This point is called the “look-back justification” point and has coordinates (-b/m, 0).
10
Table 1: Decision Level Decrease Series#Benchs% Decr. −b/m(> 0) Reduc. een862%1.1e31762% goldb11100%1.4e693% grieu771%1.3e6 − hoons5100%7.2e4 123% ibm-2002771%4.6e428% ibm-2004 1392%1.9e5 52% manol-pipe 5591%1.9e5 64% miz 130%−− schup 580%4.8e5 32% simon 1090%1.1e6 50% vange 366%4.0e5 6% velev 5492%1.5e5 81% all 19983%3.2e568% # of benchmarks in series % of benchmarks that exhibit a decreasing of decision levels Median values of x c Always increasing
11
Hypotheses 1. The solver follows a linear decreasing of its decision levels (this was found to be false). 2. Finding a contradiction or a solution gives the same look-back justification 3. The solution (or contradiction) is not found by chance at any point of the computation.
12
Experimental Results The phenomenon seems to hold true for almost all industrial problems. The phenomenon seems to hold true for almost all industrial problems. The phenomenon does hold for the “mizh” series of industrial problems, which encode cryptographic problems (100% increasing for this series). The phenomenon does hold for the “mizh” series of industrial problems, which encode cryptographic problems (100% increasing for this series). Strong relationship between look-back justification and effective number of conflicts needed to solve the problem: bounded between 0.90 and 8.33 times the real number of conflicts needed to solve the problem. Strong relationship between look-back justification and effective number of conflicts needed to solve the problem: bounded between 0.90 and 8.33 times the real number of conflicts needed to solve the problem. In most cases, the justification is 1.37 times the effective number of conflicts. In most cases, the justification is 1.37 times the effective number of conflicts. CDCL solvers enforce the decision level to decrease along the line. CDCL solvers enforce the decision level to decrease along the line.
13
Justification vs Conflicts Historical justification of needed conflicts vs effective # of conflicts reached
14
Conclusions from First Experiment Results indicates that CDCL solvers do not come to the solution suddenly. Results indicates that CDCL solvers do not come to the solution suddenly. On SAT instances, the solver does not correctly guess a value for a literal, but learns that the opposite value leads to a contradiction. On SAT instances, the solver does not correctly guess a value for a literal, but learns that the opposite value leads to a contradiction. If the part of the learning schema that enforces this decreasing can be identified: If the part of the learning schema that enforces this decreasing can be identified: Perhaps speed-up the decreasing Perhaps speed-up the decreasing Perhaps identify in advance the clauses that play this part and protect them against clause deletion. Perhaps identify in advance the clauses that play this part and protect them against clause deletion.
15
Measuring Learnt Clause Quality All literals from the same level are called “blocks” of literals. All literals from the same level are called “blocks” of literals. There is a chance they are linked with each other by direct dependencies. There is a chance they are linked with each other by direct dependencies. The learning schema should add links between these independent blocks of literals. The learning schema should add links between these independent blocks of literals.
16
Literals Blocking Distance Given a clause C and a partition of its literals into n subsets according to the current assignment such that the literals are partitioned with respect to their decision level, the LBD of C is exactly n. Given a clause C and a partition of its literals into n subsets according to the current assignment such that the literals are partitioned with respect to their decision level, the LBD of C is exactly n. LBD for each learnt clause is stored – this is static. LBD for each learnt clause is stored – this is static. “Glue Clauses” “Glue Clauses” learnt clauses of LBD 2 learnt clauses of LBD 2 Only contain one variable of the last decision level (First Unique Implication Point). Only contain one variable of the last decision level (First Unique Implication Point). This variable will be “glued” with the block of literals propagated above. This variable will be “glued” with the block of literals propagated above.
17
Unique Implication Point A vertex in the implication graph that dominates both vertices corresponding to the literals of the conflicting variable. A vertex in the implication graph that dominates both vertices corresponding to the literals of the conflicting variable.
18
Experiment on LBD Run MINISAT on the set of SAT-Race 06 benchmarks. Run MINISAT on the set of SAT-Race 06 benchmarks. For each learnt clause, measure the number of times “it” (glue clause) was useful in unit-propagation and conflict analysis. For each learnt clause, measure the number of times “it” (glue clause) was useful in unit-propagation and conflict analysis.
19
LBD Experiment Result
20
Conclusions of LBD Experiment 40% of the unit propagation on learnt clauses are done on glue clauses 40% of the unit propagation on learnt clauses are done on glue clauses Whereas 20% are done on clauses of size 2. Whereas 20% are done on clauses of size 2. Half of the learnt clauses used in the resolution mechanism during all conflict analysis have LBD < 6. Half of the learnt clauses used in the resolution mechanism during all conflict analysis have LBD < 6. Whereas clauses of size smaller than 13 are needed for the same result. Whereas clauses of size smaller than 13 are needed for the same result.
21
Aggressive clauses deletion CDCL solvers performance is tied to clause database management. CDCL solvers performance is tied to clause database management. Keeping too many clauses will decrease the BCP efficiency. Keeping too many clauses will decrease the BCP efficiency. Cleaning too many will break the overall learning benefit. Cleaning too many will break the overall learning benefit. Good learnt clauses are identified by VSIDS heuristics. Good learnt clauses are identified by VSIDS heuristics. Solvers often let clauses set grow exponentially to prevent good clauses from being deleted. Solvers often let clauses set grow exponentially to prevent good clauses from being deleted. This scheme deteriorates on hard instances, making some hard instances even harder to solve. This scheme deteriorates on hard instances, making some hard instances even harder to solve.
22
Aggressive cleaning strategy No matter the size of the initial formula, remove half of the learnt clauses (asserting clauses are kept) every 20,000 + 500x conflicts, where x is the number of times this deletion was previously performed.
23
MINISAT with different deletion strategies #N (sat-unsat)#avg time MINISAT70 (35 – 35)209 MINISAT +ag74 (41 – 33)194 MINISAT +lbd79 (47 – 32)145 MINISAT +ag+lbd82 (45 – 37)175 (200 benchmarks from SAT Race 2006, time out of 1000 seconds)
24
GLUCOSE The ideas described in previous slides were embedded into MINISAT with Luby restarts strategy with phase savings. The ideas described in previous slides were embedded into MINISAT with Luby restarts strategy with phase savings. This solver is called “GLUCOSE” for its ability to detect and keep “Glue Clauses.” This solver is called “GLUCOSE” for its ability to detect and keep “Glue Clauses.” Two tricks were added: Two tricks were added: Each time a learnt clause is used in unit-propagation, a new LBD score is computed and updated. Each time a learnt clause is used in unit-propagation, a new LBD score is computed and updated. Increase the score of variables of the learnt clause that were propagated by a glue clause. Increase the score of variables of the learnt clause that were propagated by a glue clause. Table comparing performances against other SAT solvers. Table comparing performances against other SAT solvers.
25
Performance
26
Data Solver#N (SAT-UNSAT)#U#B ZCHAFF 0184 (47 – 37)013 ZCHAFF 0480 (39 – 41)05 MINISAT+136 (66 – 74)015 MINISAT132 (53 – 79)116 PICOSAT153 (75 – 78)126 RSAT 139(63 – 75)114 GLUCOSE176 (75 – 101)2268 #U: number of times where the solver is the only one to solve an instance #B: number of times where the solver is the fastest solver
27
Blocked Clause Elimination Conceived by Matti Järvisalo, Armin Biere, Marijn Heule. Conceived by Matti Järvisalo, Armin Biere, Marijn Heule. Studies the effectiveness of BCE on standard CNF encodings of circuits Studies the effectiveness of BCE on standard CNF encodings of circuits Achieves the same level of simplifications as a combination of : Achieves the same level of simplifications as a combination of : CNF encodings CNF encodings Tseitin CNF encoding for circuits Tseitin CNF encoding for circuits Plaisted-Greenbaum encoding Plaisted-Greenbaum encoding Circuit-Level simplifications Circuit-Level simplifications cone of influence cone of influence non-shared input elimination non-shared input elimination monotone input reduction monotone input reduction
28
Blocking Literal / Clause A literal x in a clause C of a CNF F blocks C if for every clause C’ F with -x C’, the resolvent (C \ {x}) ∪ (C’ \ {-x}) obtained from resolving C and C’ on x is a tautology. A literal x in a clause C of a CNF F blocks C if for every clause C’ F with -x C’, the resolvent (C \ {x}) ∪ (C’ \ {-x}) obtained from resolving C and C’ on x is a tautology. A clause is blocked if it has a literal that blocks it. A clause is blocked if it has a literal that blocks it.
29
Example Given CNF F: (a + b) (a - b - c)(-a + c) Clauses: C 1 = {a, b}, C 2 = {a, -b, -c}, C 3 = {-a, c}. Literal a does not block C 1 since {b}∪{c} is not a tautology. Literal a does not block C 1 since {b}∪{c} is not a tautology. Literal b does not block C 1 since {a}∪{a, -c} is not a tautology. Literal b does not block C 1 since {a}∪{a, -c} is not a tautology. Literal a blocks C 2 since {-b, -c}∪{c} is a tautology. Literal a blocks C 2 since {-b, -c}∪{c} is a tautology. Literal -c blocks C 2 since {a, -b}∪{-a} is a tautology. Literal -c blocks C 2 since {a, -b}∪{-a} is a tautology. Literal c blocks C 3 since as is {a,-b} ∪{-a} is a tautology. Literal c blocks C 3 since as is {a,-b} ∪{-a} is a tautology.
30
BCE (continued) Removal of an arbitrary blocked clause by BCE still preserves satisfiability. Removal of an arbitrary blocked clause by BCE still preserves satisfiability. A literal x cannot block any clause if the CNF contains the unit clause {-x}. A literal x cannot block any clause if the CNF contains the unit clause {-x}. If clause C in CNF F is blocked, any clause C’ F where C’ ≠ C that is blocked in F is also blocked in F\{C}. If clause C in CNF F is blocked, any clause C’ F where C’ ≠ C that is blocked in F is also blocked in F\{C}.
31
Pure Literal Elimination by BCE Given a CNF F, a literal x occurring in F is pure if -x does not occur in F. Given a CNF F, a literal x occurring in F is pure if -x does not occur in F. Pure Literal Elimination (PL): While there is a pure literal x in F, remove all clauses containing x from F. Pure Literal Elimination (PL): While there is a pure literal x in F, remove all clauses containing x from F. BCE is at least as effective as PL: A pure literal blocks all clauses which contain it by definition. BCE is at least as effective as PL: A pure literal blocks all clauses which contain it by definition.
32
Experiments Evaluated how much reduction can be achieved using BCE with VE and various circuit encoding techniques. Evaluated how much reduction can be achieved using BCE with VE and various circuit encoding techniques. Reduction measured in the size of the CNF before and after preprocessing, and gain in the number of instances solved. Reduction measured in the size of the CNF before and after preprocessing, and gain in the number of instances solved. 292 CNFs from SAT 2009 application track. 292 CNFs from SAT 2009 application track. Time limit of 900 seconds. Time limit of 900 seconds. Used PrecoSAT v236 and PicoSAT v918. Used PrecoSAT v236 and PicoSAT v918.
33
Results Umm, results… inconclusive. Umm, results… inconclusive. Reducing the size of a CNF by preprocessing does not necessarily lead to faster running times. Reducing the size of a CNF by preprocessing does not necessarily lead to faster running times. Running preprocessing until completion takes a considerable portion of the 90 seconds limit. Running preprocessing until completion takes a considerable portion of the 90 seconds limit.
34
Results S = SAT’09 competition, A = structural SAT track, H = HWMCC’08, B = bit-blasted bit-vector problems from SMT-Lib, T = Tseitin, P = Plaisted-Greenbaum, M = Minicirc, N = NiceDAG, U = unknown for S, t = time in seconds spent in one encoding/preprocessing phase, V = sum of number of variables (in millions), C = sum of number of clauses in millions, b = BCE, e = VE.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.