Download presentation

Presentation is loading. Please wait.

Published byLane Hedrington Modified about 1 year ago

1
Order encoding x i ↔ (X ≥ i)(X = 3) = [1,1,1,0,0] Problem (hard) Problem (hard) Solution CNF Encoding Finite Domain Problem Solving Model Constraint Model Constraint Model Direct CSP solving Model Solution Model Solution Translate Decoding SAT solving Constraint Model Constraint Model Simplified CNF Simplified CNF Encoding CNF Simplified Model Simplified Model Encoding Optimized SAT Encoding CNF’’ CNF’ Partial Evaluation CNF preprocessors such: SatELite, ReVivAl Based on Unit Propagation and Resolution. CNF preprocessors such: SatELite, ReVivAl Based on Unit Propagation and Resolution. Simplified Model’ Simplified Model’ Encoding Partial Evaluation using Equi-Propagation Problems: Constraint / Bits connection lost Large CNF Problems: Constraint / Bits connection lost Large CNF Constraint ( C1, φ 1 ) Constraint ( C1, φ 1 ) … M = Constraint ( C1, φ 1 ) Constraint ( C1, φ 1 ) Constraint ( C’3, φ‘ 3 ) Constraint ( C’3, φ‘ 3 ) Constraint ( C’n, φ’ n ) Constraint ( C’n, φ’ n ) … M’ = φ = Simplify CSP techniques Boolean techniques Constraint ( C2, φ 2 ) Constraint ( C2, φ 2 ) Constraint ( C3, φ 3 ) Constraint ( C3, φ 3 ) Constraint ( Cn, φ n ) Constraint ( Cn, φ n ) Constraint ( C2, φ 2 ) Constraint ( C2, φ 2 ) φ1φ1 φ1φ1 φ' 3 φ' n … Equi-Propagation Standard encodings Modeling Finite Domain CSP representing numbers (integers) Binary Unary Direct encoding x i ↔ (X = i) (X = 3) = [0,0,0,1,0,0] x i ↔ (X = i) (X = 3) = [0,0,0,1,0,0] X ij X ≥ iX < j good for representing ranges X u u v v i good for arbitrary sets good for arithmetic operations with constants: + 3 = * 3 = div 3 = a a a a a a b b b b b b c c c c c c a a c c b b a a c c b b c c f f c c b b a a c c b b a a f f e e d d g g a a b b c c d d e e f f g g b=c e=f=g x= -y, x=y, x=0, x=1 x= -y, x=y, x=0, x=1 Equi-Propagation Equi-propagation is the process of inferring new equational consequences from a single constraint in the model (and other existing equational information). When inferring such equational consequence, x can be removed from the model by replacing x with its equivalent in all the constraints in the model. MINION v0.10SatELite (SymB)Sugar (v1.14.7) (SymB)BEE (SymB)instance SymB+ (sec.) SymB (sec.) [M’06] (sec.) SAT (sec.) CNF size (clauses) preproc (sec.) SAT (sec.) CNF size (clauses) generate (sec.) SAT (sec.) CNF size (clauses) compile (sec.) ∞ ∞ ∞ ∞∞ ∞∞∞ ∞ Balanced Incomplete Block Designs Definition: a 5-tuple of positive integers 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. Variables: B 11, …, B bv Domains: B ij {0,1} Constraints: 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 BIBD Satisfied assignment Encoding Our Approach 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 +,[B 1i,…,B ni ]) space constraint: block(R ij +,R ij+1,[-B 1i,…,-B ni ]) no overlap constraint: leq(R ij + +1, R ij+1 ) Time (sec.)Solver Wolter BGU BEE 5,000 random 30x30 puzzles There are dedicates solvers such as Jan Wolter's pbnsolve (http://webpbn.com/pbnsolve.html)http://webpbn.com/pbnsolve.html Ben-Gurion University Solver (http://www.cs.bgu.ac.il/~benr/nonograms/)http://www.cs.bgu.ac.il/~benr/nonograms/ BEE is faster than the dedicated solvers on the hard puzzles. Walt.BGUBEEInstance SAT (sec.) CNF size (clauses) compile (sec.) sizeid ∞∞ (30x30)9717 ∞∞ (50x40)10000 ∞∞ (45x65) (63x52) (63x52) (47x47) (80x80) (19x19) (25x25)6574 Selected human puzzles Experiments 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. 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. By using the Equi-Propagation technique we generates a small optimized CNF. diff(U1={ 0..4 }=[x1,x2,x3,x4], U2={ 0..4 }=[y1,y2,y3,y4]) sumBits(a,d,b,x3,y2,c,y4)=3 Constraints … …… diff(U1={ 1,3 }=[1,x2,x2,0], U2={ 1,3 }=[1,y2,y2,0]) sumBits(a,1,b,x2,y2,c,0)=3 Constraints … …… diff(U1={ 1,3 }=[1,x2,x2,0], U2={ 1,3 }=[1,-x2,-x2,0]) sumBits(a,1,b,x2,-x2,c,0)=3 Constraints … …… diff(U1={ 1,3 }=[1,x2,x2,0], U2={ 1,3 }=[1,-x2,-x2,0]) sumBits(a,b,c)=1 Constraints … …… U1 ≠ U2 (y2= -x2) U1 0, U1 ≠ 3 (x1=1, x2=x3, x4=0) d=1 U1 0, U1 ≠ 3 (x1=1, x2=x3, x4=0) d=1 Equi-Propagation Example M = M’ = Simplify

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google