SAT Solver Descriptions : CMUSAT-Base and CMUSAT
暂无分享,去创建一个
CMUSAT-Base is a satisfiability (SAT) solver for formulas expressed in conjunctive normal form (CNF). It uses the DPLL algorithm to decide the satisfiability of CNF formulas. The basic DPLL algorithm is enhanced using various standard techniques such as watch literal scheme for efficient Boolean Constraint Propagation, conflict driven learning, non-chronological backtracking, restarts, conflict clause minimization, and variable activity based decision. The new features of CMUSAT-Base are: 1) an optimization to the watch literal scheme which leads to consistent improvement, 2) simplified data structures based on standard template library (STL), and 3) efficient usage of STL to achieve a high performance SAT solver. Modern SAT solvers employ pre-processing techniques in order to simplify a given CNF formula before the actual SAT solving starts. CMUSAT solver combines a pre-processing frontend with CMUSAT-Base. 1. WATCH LITERAL SCHEME Current SAT solvers spend 80%-90% of their runtime during Boolean Constraint propagation (BCP). The aim of this step is to find out all possible implications (variable assignments) due to a given decision by using the unit literal rule or report a clause which is falsified due to the current assignment. A major technique to make BCP efficient is the watch literal scheme first proposed by the zChaff [5] SAT solver. For simplicity let us focus only on clauses with size greater than one in the description below. In the watch literal scheme two literals l1, l2 are associated with each clause C, where l1 ∈C, l2 ∈C. We refer to literals l1, l2 as the watches for a clause C. As long as both l1 and l2 are unassigned there is no need to examine clause C during BCP. This avoids bringing C from the main memory to the caches which can require numerous clock cycles. By minimizing the number of times a clause is brought in the (L1/L2) cache the watch literal scheme improves the performance of BCP significantly. Most of the existing SAT solvers examine a clause C (or atleast a part of it) when one of its watches becomes false. Let us assume that C is stored as an array and C[i] denotes the literal at position i, where 0 ≤ i < N and N is the number of literals in C. Also without loss of generality we assume that watches l1, l2 for C are stored in the first two positions, that is, l1 =C[0] and l2 =C[1]. Now suppose that l2 becomes false. Then the following cases arise: 1. l1 is already true and C is satisfied under current assignment. 2. l1 is not true and we are able to find another literal l3 in C which is different from l1, l2 and is not false. In this case l3 replaces l2 as one of the watches for C. 3. l1 is not assigned and all the other literals in C are false. In this case l1 is implied by C 4. All literals in C are false. In this case C is a conflict clause. Observe that the four cases above are total and mutually exclusive (when l2 is false). We profiled the number of times each of the above cases occur on a large number of industrial benchmarks and found that case 1 occurs most often. Table 1 shows the results on a few industrial benchmarks. The column “#Case 1” counts the number of times case 1 holds during the SAT solving, and the column “#Cases 2,3,4” reports the total number of times other cases hold. It is easy to see that case 1 occurs most often than all the other cases combined. In order to detect when case 1 holds we only need to look at the watches for a clause and not the entire clause. That is, we can completely eliminate the need of getting C (or a part of it) into the cache when case 1 holds. Benchmark #Case 1 #Cases 2,3,4 Result goldb-heqc-desmul 3.8 ×108 1.5×108 UNSAT cache-ibm-q-full 6 ×108 1.5×108 UNSAT aloul-chnl11-13 1.6 ×109 5.6×108 UNSAT ibm-2002-11r1-k45 7.2 ×108 4.1×108 SAT ibm-2004-04-k100 6.8 ×108 3.6×108 SAT manol-pipe-c9nidw-s 8.2 ×108 4.5×108 UNSAT velev-vliw-sat-4.0-b1 1.5 ×109 3×108 SAT velev-vliw-sat-4.0-b3 8.9 ×108 1.8×108 SAT Table 1: Frequency of various possibilities when one of the watches for a clause becomes false. When case 1 holds current state-of-the-art solvers (for example, MiniSat [1]) looks only at C[0],C[1] as the watches are stored as the first two literals in the clause. However, since the first two elements of C are accessed the hardware prefetching mechanism may also bring other elements of C into the cache which are not needed whenever case 1 holds. In CMUSAT-Base C is not touched (read/written) when the case 1 holds. This is done by separating the watches and the clauses as described in the next section. 2. DATA STRUCTURES FOR ENHANCED WATCH LITERAL SCHEME Each clause is assigned a number called clause index. All the clauses are stored in an array called clauses, and clauses[i] stores the clause with index i. Another array called warray stores the watches corresponding to each clause, that is, warray[i] stores the two literals that are watches for clauses[i].
[1] Armin Biere,et al. Effective Preprocessing in SAT Through Variable and Clause Elimination , 2005, SAT.