Changes between Version 1 and Version 2 of ConstraintSolving

Show
Ignore:
Timestamp:
02/19/08 10:03:54 (5 years ago)
Author:
nominolo
Comment:

begin SAT-translation thoughts

Legend:

Unmodified
Added
Removed
Modified
  • ConstraintSolving

    v1 v2  
    2020 
    2121To solve this we also need to know the possible values that bar and baz can take. These correspond to the versions of the installed or available packages. 
     22 
     23=== Translation to Propositional Formulas === 
     24 
     25SAT-solvers for propositional formulas can be very fast and compact as demonstrated by miniSAT (600 SLOC of C++ code).  To be able to use them, however, we need to be able to express our problem in a form that can be solved by miniSAT, though. 
     26 
     27A SAT-solver accepts ''clauses'' as input.  A clause is a disjunction of possibly negated variables.  A propositional variable can either be true or false.  The goal of the SAT-solver is to find an assignments to for each variable that makes all clauses true. 
     28 
     29Say we have the following versions of the package {{{bar}}} available: 
     30{{{ bar-1.2, bar-1.2.3, bar-1.3, bar-1.4 }}} 
     31Then the constraint {{{bar > 1.2 }}} can be expressed as {{{bar == 1.2.3 || bar == 1.3 || bar == 1.4}}}.  We can translate this into propositional variables: 
     32{{{ 
     33not <bar-1.2>, <bar-1.2.3>, <bar-1.3>, <bar-1.4> 
     34}}}