
Topic 7: Solving Technologies (Version of 22nd September 2021) Jean-Noel¨ Monette and Pierre Flener Optimisation Group Department of Information Technology Uppsala University Sweden Course 1DL441: Combinatorial Optimisation and Constraint Programming, whose part 1 is Course 1DL451: Modelling for Combinatorial Optimisation Outline 1. The MiniZinc Toolchain The MiniZinc Toolchain 2. Comparison Criteria Comparison Criteria 3. SAT SAT 4. SMT & OMT SMT & OMT IP & MIP 5. IP & MIP CP LS & CBLS 6.CP Hybrid Technologies 7. LS & CBLS Case Study 8. Hybrid Technologies Choosing a Technology and Backend 9. Case Study 10. Choosing a Technology and Backend COCP/M4CO 7 - 2 - Outline 1. The MiniZinc Toolchain The MiniZinc Toolchain 2. Comparison Criteria Comparison Criteria 3. SAT SAT 4. SMT & OMT SMT & OMT IP & MIP 5. IP & MIP CP LS & CBLS 6.CP Hybrid Technologies 7. LS & CBLS Case Study 8. Hybrid Technologies Choosing a Technology and Backend 9. Case Study 10. Choosing a Technology and Backend COCP/M4CO 7 - 3 - MiniZinc: Model Once, Solve Everywhere! The MiniZinc instance Toolchain data Comparison Criteria SAT SMT & OMT flat backend model flattening IP & MIP model & solver CP LS & CBLS Hybrid Technologies techno&solver-specific (optimal) Case Study predicate definitions solution Choosing a Technology and Backend From a single language, one has access transparently to a wide range of solving technologies from which to choose. COCP/M4CO 7 - 4 - Outline 1. The MiniZinc Toolchain The MiniZinc Toolchain 2. Comparison Criteria Comparison Criteria 3. SAT SAT 4. SMT & OMT SMT & OMT IP & MIP 5. IP & MIP CP LS & CBLS 6.CP Hybrid Technologies 7. LS & CBLS Case Study 8. Hybrid Technologies Choosing a Technology and Backend 9. Case Study 10. Choosing a Technology and Backend COCP/M4CO 7 - 5 - Objectives The MiniZinc Toolchain An overview of some solving technologies: Comparison Criteria SAT SMT & OMT to understand their advantages and limitations; IP & MIP CP LS & CBLS to help you choose a technology for a particular model; Hybrid Technologies Case Study Choosing a Technology to help you adapt a model to a particular technology. and Backend COCP/M4CO 7 - 6 - Examples (Solving technologies) With general-purpose solvers, taking model&data as input: Boolean satisfiability (SAT) The MiniZinc SAT (resp. optimisation) modulo theories (SMT & OMT) Toolchain (Mixed) integer linear programming (IP & MIP) Comparison Criteria Constraint programming (CP) + part 2 of 1DL441 SAT ... SMT & OMT IP & MIP Hybrid technologies (LCG = CP + SAT, . ) CP Methodologies, usually without modelling and solvers: LS & CBLS Dynamic programming (DP) Hybrid Technologies Greedy algorithms Case Study Choosing a Approximation algorithms Technology and Backend Local search (LS) Genetic algorithms (GA) ... COCP/M4CO 7 - 7 - How to Compare Solving Technologies? Modelling Language: The MiniZinc What types of decision variables are available? Toolchain Comparison Which constraint predicates are available? Criteria Can there be an objective function? SAT SMT & OMT Guarantees: IP & MIP Are solvers exact, given enough time: will they find all CP LS & CBLS solutions, prove optimality, and prove unsatisfiability? Hybrid If not, is there an approximation ratio? Technologies Case Study Features: Choosing a Technology Can the modeller guide the solving? If yes, then how? and Backend In which areas has the techno been successfully used? How do solvers work? COCP/M4CO 7 - 8 - How Do Solvers Work? (Hooker, 2012) Definition (Solving = Search + Inference + Relaxation) The MiniZinc Toolchain Search: Explore the space of candidate solutions. Comparison Criteria Inference: Reduce the space of candidate solutions. SAT Relaxation: Exploit solutions to easier problems. SMT & OMT IP & MIP Definition (Systematic Search) CP LS & CBLS Progressively build a solution, and backtrack if necessary. Hybrid Use inference and relaxation to reduce the search effort. Technologies It is used in most SAT, SMT, OMT, CP, LCG, & MIP solvers. Case Study Choosing a Technology and Backend Definition (Local Search) Start from a candidate solution and iteratively modify it a bit. It is the basic idea behind LS and GA solvers. COCP/M4CO 7 - 9 - Outline 1. The MiniZinc Toolchain The MiniZinc Toolchain 2. Comparison Criteria Comparison Criteria 3. SAT SAT 4. SMT & OMT SMT & OMT IP & MIP 5. IP & MIP CP LS & CBLS 6.CP Hybrid Technologies 7. LS & CBLS Case Study 8. Hybrid Technologies Choosing a Technology and Backend 9. Case Study 10. Choosing a Technology and Backend COCP/M4CO 7 - 10 - Boolean Satisfiability Solving (SAT) Modelling Language: Only Boolean variables. The MiniZinc Toolchain A set of clauses, denoting their conjunction (/\): Comparison • A clause is a disjunction (\/) of literals. Criteria • A literal is a Boolean variable or its negation. SAT Only for satisfaction problems: no objective function; SMT & OMT otherwise: iterate over candidate objective values. IP & MIP CP Example (in MiniZinc syntax) LS & CBLS Variables: var bool: w, x, y, z; Hybrid Technologies Clauses: Case Study Choosing a constraint(not w \/ not y) /\ (not x \/ y) Technology /\ (not w \/ x \/ not z) and Backend /\ (x \/ y \/ z) /\ (w \/ not z); A solution: w=false, x=true, y=true, z=false COCP/M4CO 7 - 11 - The SAT Problem Given a clause set, find a valuation, that is Boolean values The MiniZinc Toolchain for all the variables, so that all the clauses are satisfied. Comparison Criteria The decision version of this problem is NP-complete. SAT SMT & OMT IP & MIP Any combinatorial problem can be encoded into SAT. CP Careful: “encoded into” 6= “reduced from”. LS & CBLS There are recipes to clausify non-Boolean constraints. Hybrid Technologies Case Study There has been intensive research since the 1960s. Choosing a Technology and Backend We focus here on systematic search, namely DPLL [Davis-Putnam-Logemann-Loveland, 1962]. COCP/M4CO 7 - 12 - DPLL Tree Search, upon starting from the empty valuation: The MiniZinc Toolchain 1 Perform inference (see below). Comparison 2 If some clause is unsatisfied, then backtrack. Criteria SAT 3 If all variables have a value, then we have a solution. SMT & OMT 4 Select an unvalued variable b and make two branches: IP & MIP one with b = true, and the other one with b = false. CP LS & CBLS 5 Recursively explore each of the two branches. Hybrid Technologies Inference: Case Study Unit propagation: If all the literals in a clause evaluate Choosing a Technology to false, except one whose variable has no value yet, and Backend then that literal is made to evaluate to true so that the clause becomes satisfied. COCP/M4CO 7 - 13 - Strategies and Improvements over DPLL Search Strategies: The MiniZinc Toolchain On which variable to branch next? Comparison Criteria Which branch to explore next? SAT Which search (depth-first, breadth-first, . ) to use? SMT & OMT IP & MIP CP Improvements: LS & CBLS Backjumping Hybrid Technologies Clause learning Case Study Restarts Choosing a Technology A lot of implementation details and Backend ... COCP/M4CO 7 - 14 - SAT Solving The MiniZinc Guarantee: exact, given enough time. Toolchain Comparison Criteria Mainly black-box: limited ways to guide the solving. SAT SMT & OMT It can scale to millions of variables and clauses. IP & MIP CP LS & CBLS Encoding a problem can yield a huge SAT model. Hybrid Technologies Some solvers can extract an unsatisfiable core, that is Case Study a subset of clauses that make the model unsatisfiable. Choosing a Technology and Backend It is mainly used in hardware and software verification. COCP/M4CO 7 - 15 - SAT @ MiniZinc and Uppsala University The MiniZinc The MiniZinc toolchain was extended with the PicatSAT Toolchain backend, which uses the SAT solver Plingeling. Comparison Criteria SAT Several research groups at Uppsala University SMT & OMT use SAT solvers, such as: IP & MIP • Algorithmic Program Verification CP • Embedded Systems LS & CBLS • Programming Languages Hybrid • Theory for Concurrent Systems Technologies Case Study Choosing a My Algorithms & Datastructures 3 (1DL481) course Technology and Backend discusses SAT solving and has a homework where a SAT model is designed and fed to a SAT solver. COCP/M4CO 7 - 16 - Outline 1. The MiniZinc Toolchain The MiniZinc Toolchain 2. Comparison Criteria Comparison Criteria 3. SAT SAT 4. SMT & OMT SMT & OMT IP & MIP 5. IP & MIP CP LS & CBLS 6.CP Hybrid Technologies 7. LS & CBLS Case Study 8. Hybrid Technologies Choosing a Technology and Backend 9. Case Study 10. Choosing a Technology and Backend COCP/M4CO 7 - 17 - SAT Modulo Theories (SMT) and OMT Modelling Language: The MiniZinc Language of SAT: Boolean variables and clauses. Toolchain Comparison Several theories extend the language, say bit vectors, Criteria uninterpreted functions, or linear integer arithmetic. SAT SMT & OMT SMT is only for satisfaction problems. IP & MIP OMT (optimisation modulo theories) extends SMT. CP LS & CBLS Definition Hybrid Technologies A theory Case Study defines variable types and constraint predicates, and Choosing a Technology is associated with a sub-solver for any conjunction of and Backend the supported constraint predicates. Different SMT/OMT solvers may have different theories. COCP/M4CO 7 - 18 - Example (Linear integer arithmetic; in MiniZinc syntax) Variables: var int: x; var int: y; Constraints: The MiniZinc Toolchain constraint x >= 0; constraint y <= 0; Comparison constraint x = y + 1 \/ x = 2 * y; Criteria constraint x = 2 \/ y = -2 \/ x = y; SAT SMT & OMT Unique solution: x = 0, y = 0 IP & MIP Decomposition: CP • Theory constraints, using reified constraints: LS & CBLS Hybrid a <-> x >= 0; b <-> y <= 0; Technologies c <-> x = y + 1; d <-> x = 2 * y; Case Study e <-> x = 2; f <-> y = -2; g <-> x = y; Choosing a Technology • and Backend Boolean skeleton: a /\ b /\ (c \/ d) /\ (e \/ f \/ g); COCP/M4CO 7 - 19 - SMT Solving: DPLL(T ) Basic Idea: The MiniZinc Toolchain Separate the theory constraints and Boolean skeleton: Comparison each variable in the Boolean skeleton represents Criteria whether a constraint holds or not. SAT SMT & OMT Use DPLL to solve the Boolean skeleton. IP & MIP CP If a constraint must hold as per DPLL, LS & CBLS then submit it to the relevant theory solver.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages74 Page
-
File Size-