230 likes | 392 Views
SymChaff: A Structure-Aware Satisfiability Solver. Ashish Sabharwal University of Washington, Seattle AAAI, July 2005. SAT: The Satisfiability Problem. Input: Boolean formula F in CNF F = (x 1 OR x 2 ) AND (x 1 OR x 3 OR x 4 ) AND … Output: “satisfying assignment” or “unsat”
E N D
SymChaff:A Structure-Aware Satisfiability Solver Ashish Sabharwal University of Washington, Seattle AAAI, July 2005
SAT: The Satisfiability Problem • Input: Boolean formula F in CNF • F = (x1 OR x2) AND (x1 OR x3 OR x4) AND … • Output: “satisfying assignment” or “unsat” • NP-complete, hence difficult but useful! Problem instance sat CNF Encoder F SAT Solver unsat e.g. planning, verification, design, … domain dependent general purpose
SAT: The Satisfiability Problem • Numerous real-world applications • hardware verification, testing, planning, scheduling, design automation, … • Dozens of academic/industrial SAT solvers • e.g. Grasp [MarquesSilva-Sakallah-96], Relsat [Bayardo-Schrag-97], SATO [Zhang-97], zChaff [Moskewicz-etal-01], Berkmin [Goldberg-Novikov-02], March-eq [Huele-vanMaaren] Most don’t exploit problem structure well!
Planning Example: Logistics CityA CityC CityD CityB Each city has several boxes Each box has a destination city Several trucks at a base station Domain knowledge: All trucks are equal! Task: use trucks to move boxes to their resp. destinations
SAT and Symmetry • Natural symmetry in many domains, e.g. • planning: all trucks at a base station, all nails in assembly • circuit design: all wires connecting two switch boxes • multi-processor scheduling: all processors • cache coherency protocols: all caches • “If k trucks need to be sent from CityA to CityB, w.l.o.g. send the first k.” • Proposed techniques have several drawbacks Easy for humans, hard for SAT solvers!
SYM module SYM module symm. info Our Solution: SymChaff • Captures a wide class of natural symmetries by incorporating variable semantics • Exploits high level problem structurerather than “flat” CNF formulation Problem instance sat CNF Encoder F SAT Solver unsat
Problem instance CNF Encoder Previous Approaches – 1/4 • Symmetry Breaking Predicates [Crawford-etal-96] • e.g. Shatter [Aloul-Markov-Sakallah-03] F sat SAT Solver F’ unsat SBP SBP generator • SBPs can be prohibitively many, too large, difficult to compute (graph isomorphism)
Previous Approaches – 2/4 • pseudoBoolean tools: counting constraints • e.g. PBS [Aloul-Ramani-Markov-Sakallah-02], pbChaff [Dixon-Ginsberg-Parkes-04], Galena [Chai-Kuehlmann-03] Problem instance pbCNF sat pbCNF Encoder pbSAT Solver unsat • some domains provably hard (e.g. clique color) • implicit counting representation not always suitable
Problem instance CNF Encoder Previous Approaches – 3/4 • Handle symmetries dynamically in search • e.g. sEqSatz [Li-Jurkowiak-Purdom-02], another solver [Dixon-Ginsberg-Luks-Parkes-04] F sat SYM-SAT Solver unsat • expensive group-theoretic computations
Previous Approaches – 4/4 • Domain specific solutions • Testing [MarquesSilva-Sakallah-97], model checking [Shtrichman-04], planning [Rintanen-03, Fox-Long-99] • Domain specific • Cannot exploit advances in SAT solvers • [Fox-Long-99] Very similar to our technique; yields non-optimal parallel plans
Our Contribution • New framework for symmetry in SAT • Low overhead, top-down approach • Seamless integration with current SAT solvers • Foundation in many-sorted First Order logic • SAT solver SymChaff that extends zChaff • Outperforms previous approaches on several domains from theory, planning, and design • Philosophical: a tiny bit of non-CNF input can dramatically speed up SAT solvers
Key Ideas • Symmetry Representation • Multi-way Branching • Symmetric Learning
Planning Example: Logistics CityA CityC CityD CityB Task: use n trucks to move boxes to their resp. destinations Problem variables: mv_tr3_cD_time1 load_boxA1_tr1_time1 … Possible solution: begin by sending some trucks to cityA
SymChaff: • all n trucks are symmetric • w.l.o.g. branch n+1 ways on ALL mv_tr?_ cA variables simultaneously n+1 … The j-th branch sets first j of mv_tr?_cA to true, the rest to false 0 j n Idea #1: Multi-way Branching Typical SAT solver: - effectively explore 2n branches for mv_tr?_cA mv_tr1_cA 1 0 mv_tr2_cA 1 0
Idea #1: Multi-way Branching • Idea is extended to “multi-class symmetry” • e.g. let boxA1, boxA2 be symmetric as well • variable load_boxA1_tr1 symmetric tovariable load_boxA?_tr? • Issues: • How is symmetry information provided? • How is it maintained as we branch?
Idea #2: Symmetry Representation • Input to SymChaff includes: • Symmetry classes for objectse.g. tr1, …, trnbelong to class TR • Semantics for variablese.g. mv_tr1_cA is indexed by class TR • Symmetry sets of objects; dynamic • initially: {tr1, …, trn} is a symmetry set • branch and send tr1, tr2 to cityA:split/refine set into {tr1, tr2}, {tr3, …, trn} • backtrack: re-unite these two sets
Idea #3: Symmetric Learning A “sym-conflict clause” is learnt NOTE: this replaces the triedGroups approach of [Fox-Long-99]; doesn’t suffer from non-optimality of parallel plans send jtrucks to cityA … Fail Fail: too few trucks left for other cities! SymChaff learns that these branches need not be explored
Experimental Results • Compared SymChaff with • zChaff(winner of SAT’04 competition; industrial category) • March-eq-100(winner of SAT’04 competition; hand-made category) • zChaff + Shatter (using SBP) • Galena and pbChaff (pseudoBoolean solvers) (on some domains; see paper) • Problem domains • Theory: pigeonhole, clique coloring • Planning: gripper, logistics (2) • Circuit design: channel routing
Best SAT solvers don’t do very well! Computing SBPsmay be expensive! Computing SBPsmay not help! Problem may bereally hard! Representative Runtime Samples * denotes > 6 hours
Original STRIPS specification: (objects tr1 tr2 tr3 boxA1 boxA2 boxB1 boxB2 ...) (actions ...) (init ...) ... New STRIPS specification: (objects tr1 tr2 tr3 – symTrucks boxA1 boxA2 – symBoxA boxB1 boxB1 – symBoxB ...) (actions ...) (init ...) ... And all this from…
Conclusion • New framework that efficiently incorporates symmetry into SAT solvers • Domain independent • Low overhead • Exploits high level problem description • Can this framework help local search? • Can we extend it to handle new symmetries that arise during the search? E.g. AirLock domain[Fox-Long-02]
Ongoing and Future Work • Use symmetry framework elsewhere • local search techniques like Walksat • improved variable selection heuristic • Handle new symmetries as they arise • e.g. AirLock domain of [Fox-Long-02] • Easy extensions • implement in pseudoBoolean solver • create PDDL-to-SYM converter for planning • Improvements to SymChaff • other symmetric learning schemes • dynamic selection in multi-way branches