10.07.2015 Views

SIMPLY: a Compiler from a CSP Modeling Language to the SMT-LIB ...

SIMPLY: a Compiler from a CSP Modeling Language to the SMT-LIB ...

SIMPLY: a Compiler from a CSP Modeling Language to the SMT-LIB ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

like, e.g., f(f(x) − f(y)) ≠ f(z) ∧ x + z ≤ y ∧ y ≤ x ⇒ z < 0, providing a muchricher modeling language than plain propositional formulas. Adaptations of SATtechniques <strong>to</strong> <strong>the</strong> <strong>SMT</strong> framework have been described in [15].The main application area of <strong>SMT</strong> is hardware and software verification.However, <strong>the</strong> available <strong>the</strong>ories do not restrict <strong>the</strong> usage of <strong>SMT</strong> <strong>to</strong> verificationproblems and, in fact, <strong>the</strong>y allow <strong>to</strong> encode many problems outside <strong>the</strong> verificationarea in a very natural way. There are already promising results in <strong>the</strong>direction of adapting <strong>SMT</strong> techniques for solving <strong>CSP</strong>s, even in <strong>the</strong> case of combina<strong>to</strong>rialoptimization (see, e.g., [10] for an application of an <strong>SMT</strong> solver onan optimization problem, being competitive with <strong>the</strong> best weighted <strong>CSP</strong> solverwith its best heuristic on that problem). Fundamental challenges on <strong>SMT</strong> forConstraint Programming (CP) and Optimization are detailed in [11].Since <strong>the</strong> beginning of <strong>CSP</strong> solving, its holy grail has been <strong>to</strong> obtain a declarativelanguage that allows users <strong>to</strong> easily specify <strong>the</strong>ir problem and forget about<strong>the</strong> techniques required <strong>to</strong> solve it. There are a lot of successful systems in thisdirection, just <strong>to</strong> comment on two of <strong>the</strong>m: MiniZinc [9] proposes <strong>to</strong> be a standard<strong>CSP</strong> modeling language that can be translated in<strong>to</strong> a kind of intermediatecode called FlatZinc, for which several solvers provide specialized front-ends;ESSENCE [5] allows <strong>the</strong> user <strong>to</strong> specify combina<strong>to</strong>rial problems in a formal languagewith natural language and discrete ma<strong>the</strong>matics facilities.Simply is intended <strong>to</strong> be a declarative programming system for easy modelingand solving of <strong>CSP</strong>s. Although <strong>the</strong> richness of its input language does not reach<strong>the</strong> level of ESSENCE or MiniZinc, its simplicity makes it really practical. Theinput language of Simply (see Fig. 1) is similar <strong>to</strong> that of EaCL [8] and MiniZinc,and its main implemented features are arrays, Forall sentences, comprehensionlists, and some global constraints.Problem:queens_8Datan:=8;DomainsDom rows=[1..n];VariablesIntVar q[n]::rows;ConstraintsAllDifferent([q[i] | i in [1..n]]);Forall(i in [1..n-1]) {Forall(j in [i+1..n]) {q[i]-q[j]j-i;q[j]-q[i]j-i;}}Fig. 1. queens 8.y: A naive encoding for <strong>the</strong> 8-Queens problem.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!