FINITE DOMAIN • Constraint / Bits PROBLEM SOLVING relation lost • Large CNF Problem Constraint Model Encoding CNF (hard) Model CSP solving SAT solving Direct Model Satisfied Solution Decoding Translate Solution assignment
OPTIMIZED SAT Problems: • Constraint / Bits ENCODING relation lost • Large CNF Constraint CNF Encoding Model Simplified CNF‟ Partial Evaluation Encoding Model Simplify Simplified Partial Evaluation using CNF‟‟ Encoding Equi-Propagation Model‟ Tools such as: SatELite, ReVivAl Based on Unit Propagation and Resolution. Simplified CNF
OUR APPROACH … Constraint Constraint Constraint Constraint M = ( C 1 , B 1 ) ( C 2 , B 2 ) ( C 3 , B 3 ) ( C n , B n ) Simplify Boolean techniques CSP techniques Equi-Propagation … M‟ = Constraint Constraint Constraint Constraint ( C‟ 3 , B„ 3 ) ( C‟ n , B‟ n ) ( C 1 , B 1 ) ( C 2 , B 2 ) Encoding Standard encodings … φ = φ 1 φ' 3 φ' n
OUTLINE Modeling Finite Domain CSP Equi-Propagation Experimentation Conclusions
SMALL MODELING FINITE DOMAIN CSP representing numbers (integers) Binary Unary Direct encoding Order encoding x i ↔ ( X = i) x i ↔ ( X ≥ i) (X = 3) = [0,0,0,1,0,0] (X = 3) = [1,1,1,0,0]
WHY ORDER ENCODING ? good for representing ranges X 1 0 X ≥ i i j X < j good for arbitrary sets X u v i b=c e=f=g a b c d e f g good for arithmetic operations with constants: a b c 1 1 1 a b c + 3 = a b c a a a b b b c c c * 3 = a b c d e f g c f div 3 =
EQUI-PROPAGATION Equi-propagation is the process of inferring new equational consequences from a constraint in the model (and other existing equational information). single x= -y, x=y, x=0, x=1 x can now be removed from all constraints.
EQUI-PROPAGATION EXAMPLE Learned: Partial Data: 1 ≤U 1 ≤ 3 and U1 ≠ 2 U1 ≠ U 2 (y2= -x2) U1 { 1,3 } U1 = [1,x2,x2,0] U1 { 0..4 } U1 = [x1,x2,x3,x4] U1 { 1,3 } U1 = [ 1,x2,x2,0 ] x1=1, x3=x2 , x4=0 1 ≤U 2 ≤ 3 and U2 ≠ 2 y1=1, y3=y2 , y4=0 U2 { 1,3 } U2 = [ 1,y2,y2,0 ] U2 { 0..4 } U2 = [y1,y2,y3,y4] U2 { 1,3 } U2 = [1, -x2,-x2 ,0] d = 1 d = 1 Xs = [a,1,b,x2, -x2 ,c,0] Xs = [a, 1 ,b, x2 ,y2,c, 0 ] Xs = [a,d,b,x3,y2,c,y4] … sumBits([a,b,c])=1 … … Constraints diff(U1,U2) diff(U1,U2) sumBits(Xs)=3 Constraints Constraints Encoding Encoding Encoding Simplify Simplify Simplify Simplify … … φConstraints φsumBits ([a,b,c])=1 φConstraints
EQUI-PROPAGATION A complete equi-propagator for a constraint can be implemented using binary decision diagrams (BDDs) and can be evaluate in polynomial time. When C(X1 ,…, Xk ) a constraint about (fixed) “k” integers with n bits each, the BDD representing it is of size O(n^k) Global constraints (such as allDiff) implemented using Ad-Hoc rules. There is a strong connection between Simplify and Encoding because Simplify done on the “encoding bits” and might change the encoding accordingly.
Graph Crossing BIBD MAS Kakuro B en-Gurion-University Protein E qui-propagation folding E ncoder N-Queens System Diagnostic Magic Square SCM / MCM QCP / Sudoku Nonograms
BALANCED INCOMPLETE BLOCK DESIGNS (BIBD) Definition: a 5-tuple of positive integers < v , b , r , k , l > and require to partition v distinct objects into b blocks such that each block contains k different objects, exactly r objects occur in each block, and every two distinct objects occur in exactly l blocks. b =10 Variables: B 11 , …, B bv v =6 Domains: B ij ϵ {0,1} Constraints: BIBD <6,10,5,3,2> • each row constraint: sum(B i1 ,…, B iv ) = r • each column constraint: sum(B 1i ,…, B bi ) = k • each two rows constraint: sum(B i1 *B j1 , …, B iv *B jv )= l
BALANCED INCOMPLETE BLOCK DESIGNS (BIBD) We can swap between two rows or two columns to generate another valid solution. r k l r- l < v , b , r , k , l >
BIBD – BEE VS SUGAR (CSP to CNF Encoder) instance BEE (SymB) Sugar (v1.14.7) (SymB) compile CNF size SAT generate CNF size SAT (sec.) (clauses) (sec.) (sec.) (clauses) (sec.) ∞ - - ∞ Faster time to generate CNF Smaller CNF Faster SAT solving time
BIBD – BEE VS SATELITE (CNF-Level preprocessor) instance BEE (SymB) SatELite (SymB) compile CNF size SAT preprocs CNF size SAT (sec.) (clauses) (sec.) (sec.) (clauses) (sec.) ∞ Preprocess time About the same size Solving time
BIBD – BEE VS MINION (Constraint solver) instance BEE (SymB) MINION v0.10 [M‟ 06] compile CNF size SAT SymB SymB+ (sec.) (clauses) (sec.) (sec.) (sec.) (sec.) ∞ ∞ ∞ ∞ ∞ ∞ Modeling control
CONCLUSIONS When encoding CSP model to SAT holding both representation for each constraint gives the ability to apply simplify techniques from both worlds on each constraint. Constraint Constraint Constraint Constraint … M = ( C1 , φ 1 ) ( C2 , φ 2 ) ( C3 , φ 3 ) ( Cn, φ n ) Simplify Boolean techniques CSP techniques Equi-Propagation Constraint Constraint Constraint Constraint … M‟ = ( C1 , φ 1 ) ( C2 , φ 2 ) ( C‟ 3 , φ„ 3 ) ( C‟n , φ‟ n ) Apply complete CNF simplification on each constraint is possible in polynomial time. By using the Equi-Propagation technique we generates a small optimized CNF which than can be simplify using CNF-Level simplifications. Constraint Encoding CNF Model Simplified CNF‟ Partial Evaluation Encoding Model Simplified CNF‟‟ Partial Evaluation using Equi-Propagation Encoding Model Simplified CNF
Questions ?
NONOGRAMS Definition: an nXm board of cells to color black or white and given clues per row and column of a board. A clue is a number sequence indicating blocks of cells to be colored black. Variables: B 11 , …, B nm R 11 ,…R 1k ,…,R m1 ,… R mp C 11 ,…C 1q ,…,C n1 ,…, C nr Domains: B ij ϵ {0,1} R mo ϵ {0,..,n} C no ϵ {0,..,m} Constraints: • block constraint: block(R ij ,R ij +<ij size>,[B 1i ,…, B ni ]) • space constraint: block(R ij +<ij size>,R ij+1 ,[-B 1i ,…, -B ni ]) • no overlap constraint: leq(R ij +<ij size>+1, R ij+1 )
NONOGRAMS There are dedicates solvers such as • Jan Wolter's pbnsolve (http://webpbn.com/pbnsolve.html) • Ben-Gurion University Solver (http://www.cs.bgu.ac.il/~benr/nonograms/) BEE is faster than the dedicated solvers on the hard puzzles. 5,000 random 30x30 puzzles Selected human puzzles
Recommend
More recommend