150 likes | 388 Views
Simultaneous CNF Encoder Optimization with SAT solver Setting Selection. 0414 CAD_A. Outline. Problem Description Evaluation Conjunctive Normal Form (CNF ) DIMACS CNF MiniSat. Problem Description. CNF encoding SAT solver selection Input: Verilog netlist Output: SAT or UNSAT
E N D
Simultaneous CNF Encoder Optimization with SAT solver Setting Selection 0414 CAD_A
Outline • Problem Description • Evaluation • Conjunctive Normal Form (CNF) • DIMACS CNF • MiniSat
Problem Description • CNF encoding • SAT solver selection • Input: Verilognetlist • Output: SAT or UNSAT • Evaluation: time
Problem Description • Flow chart 3 10
Problem Description Exploration phase Solving phase SAT solver
Evaluation • Results should be correct • 2 open cases • 10 hidden cases >1800s: cost = 3000 t1 < 25s t2 < 100s cost of each “test”: 4 × t1 + t2 300 Total cost: sum of 12 cases
DIMACS CNF • p cnfNUMBER_OF_VARIABLES NUMBER_OF_CLAUSES • "c" means a comment line • clause • end of every clause -> “0” c Here is a comment. p cnf 5 3 1 -5 4 0 -1 5 3 4 0 -3 -4 0 (x1⋁¬x5⋁x4⋁)⋀(¬x1⋁x5⋁x3⋁x4)⋀(¬x3⋁¬x4)
SAT solvers • Use only one (for each case) in single command line • Lingelingats (in name lingeline) • http://fmv.jku.at/lingeling/lingeling-ats-57807c8-131016.tar.gz • Glucose 3.0 (in name glucose) • http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-3.0.tgz • Minisat 2.2 (in name minisat) • http://minisat.se/downloads/minisat-2.2.0.tar.gz
MiniSat • USAGE:./minisat[options] <input-file> <result-output-file> • where input may be either in plain or gzipped DIMACS. • CORE OPTIONS: • -rnd-init, -no-rnd-init (default: off) • Randomize the initial activity • -luby, -no-luby (default: on) • Use the Luby restart sequence • -rnd-freq = <double> [ 0 .. 1] (default: 0) • The frequency with which the decision heuristic tries to choose a random variable • -rnd-seed = <double> ( 0 .. inf) (default:9.16483e+07) • Used by the random variable selection
MiniSat • CORE OPTIONS: • -gc-frac = <double> ( 0 .. inf) (default: 0.2) • The fraction of wasted memory allowed before a garbage collection is triggered • -rinc = <double> ( 1 .. inf) (default: 2) • Restart interval increase factor • -var-decay = <double> ( 0 .. 1) (default: 0.95) • The variable activity decay factor • -cla-decay = <double> ( 0 .. 1) (default: 0.999) • The clause activity decay factor • -rfirst = <int32> [ 1 .. imax] (default: 100) • The base restart interval • -phase-saving = <int32> [ 0 .. 2] (default: 2) • Controls the level of phase saving (0=none, 1=limited, 2=full) • -ccmin-mode = <int32> [ 0 .. 2] (default: 2) • Controls conflict clause minimization (0=none, 1=basic, 2=deep)
MiniSat • MAIN OPTIONS: • -pre, -no-pre (default: on) • Completely turn on/off any preprocessing. • -cpu-lim = <int32> [ 0 .. imax] (default: 2147483647) • Limit on CPU time allowed in seconds. • -mem-lim = <int32> [ 0 .. imax] (default: 2147483647) • Limit on memory usage in megabytes. • -verb = <int32> [ 0 .. 2] (default: 1) • Verbosity level (0=silent, 1=some, 2=more). • -dimacs = <string> • If given, stop after preprocessing and write the result to this file.
MiniSat • SIMP OPTIONS: • -elim, -no-elim (default: on) • Perform variable elimination. • -rcheck, -no-rcheck(default: off) • Check if a clause is already implied. (costly) • -asymm, -no-asymm(default: off) • Shrink clauses by asymmetric branching. • -simp-gc-frac = <double> ( 0 .. inf) (default: 0.5) • The fraction of wasted memory allowed before a garbage collection is triggered during simplification. • -sub-lim = <int32> [ -1 .. imax] (default: 1000) • Do not check if subsumption against a clause larger than this. -1 means no limit. • -grow = <int32> [imin .. imax] (default: 0) • Allow a variable elimination step to grow by a number of clauses. • -cl-lim = <int32> [ -1 .. imax] (default: 20) • Variables are not eliminated if it produces a resolvent with a length above this limit. -1 means no limit
Future Work • Convert netlist into DIMACS • Tseitin transformation
Reference • http://minisat.se • http://www.msoos.org/minisat-faq • https://groups.google.com/forum/#!forum/minisat