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.
Simply works in <strong>the</strong> spirit of SPEC2SAT [3], which transforms problem specificationswritten in NP-SPEC [1] in<strong>to</strong> SAT instances in DIMACS format. However,as said, <strong>the</strong> input language of Simply is similar <strong>to</strong> that of EaCL and, mostimportantly, it generates <strong>SMT</strong> instances according <strong>to</strong> <strong>the</strong> standard <strong>SMT</strong>-<strong>LIB</strong>language [13] instead of SAT instances. Then, <strong>the</strong> problem can be solved by usingany <strong>SMT</strong> solver supporting <strong>the</strong> required <strong>the</strong>ories. Thanks <strong>to</strong> <strong>the</strong> higher levelof expressivity of <strong>SMT</strong>, <strong>the</strong> resulting <strong>SMT</strong> instances are smaller than if <strong>the</strong>ywhere just plain SAT and, in many cases, as we show in Section 4, <strong>the</strong> problemscan be solved in a reasonable amount of time by state-of-<strong>the</strong>-art <strong>SMT</strong> solvers.Our aim is <strong>to</strong> take advantage of <strong>the</strong> race for efficiency between <strong>SMT</strong> solvers,and <strong>to</strong> expand <strong>the</strong> application of <strong>SMT</strong> techniques <strong>to</strong> new areas. The system canalso serve as a <strong>CSP</strong> benchmark genera<strong>to</strong>r for <strong>SMT</strong> solvers comparison. Currently,Simply generates quantifier-free linear integer arithmetic formulas, but <strong>the</strong>re areplans <strong>to</strong> extend <strong>the</strong> compiler in order <strong>to</strong> deal with o<strong>the</strong>r interesting <strong>the</strong>ories suchas, e.g., arrays and bit-vec<strong>to</strong>rs.The rest of <strong>the</strong> paper is structured as follows. In Section 2 we recall somebasic concepts on <strong>SMT</strong>. In Section 3 we introduce <strong>the</strong> <strong>to</strong>ol and its language, andgive some details about <strong>the</strong> compiler. In Section 4 we discuss some benchmarks.Finally, in Section 5 we conclude and discuss fur<strong>the</strong>r work.2 Satisfiability Modulo TheoriesSatisfiability Modulo Theories (<strong>SMT</strong>) is <strong>the</strong> problem of deciding <strong>the</strong> satisfiabilityof a first-order formula with respect <strong>to</strong> some background first-order <strong>the</strong>ory. Thatis, an <strong>SMT</strong> instance is a first-order formula where some function and predicatesymbols have predefined interpretations, according <strong>to</strong> <strong>the</strong> background <strong>the</strong>ories.Examples of <strong>the</strong>ories are Equality and Uninterpreted Functions, Linear IntegerArithmetic, Linear Real Arithmetic, <strong>the</strong>ir fragments Integer Difference Logicand Real Difference Logic, Arrays (useful in modeling and verifying softwareprograms), Bit-Vec<strong>to</strong>rs (useful in modeling and verifying hardware designs), orcombinations of <strong>the</strong>m (see [13] for details). Most <strong>SMT</strong> solvers are restricted <strong>to</strong>decidable quantifier free fragments of <strong>the</strong>ir logics, but this suffices for many applications.Usually, <strong>SMT</strong> solvers deal with problems with thousands of clauseslike, e.g., x + 3 < y ∨ y = f(f(x + 2)) ∨ g(y) ≤ 1, containing a<strong>to</strong>ms over combined<strong>the</strong>ories, and involving functions with no predefined interpretation, i.e.,uninterpreted functions.There are two main approaches <strong>to</strong> solve <strong>SMT</strong> instances, namely, <strong>the</strong> eagerand <strong>the</strong> lazy approach. In <strong>the</strong> eager approach, <strong>the</strong> formula is translated in<strong>to</strong>an equisatisfiable propositional formula. This allows <strong>the</strong> use of off-<strong>the</strong>-shelf SATsolvers, but has important drawbacks like, e.g., exponential memory blow-ups.For this reason most, if not all, state-of-<strong>the</strong>-art <strong>SMT</strong> solvers implement a lazyapproach, which does not involve a translation in<strong>to</strong> SAT. One of <strong>the</strong>se approachesis DPLL(T ) [12], which consists of a general DPLL(X) engine, very similar innature <strong>to</strong> a SAT solver, whose parameter X is instantiated with a specializedsolver Solver Tfor a given <strong>the</strong>ory T , producing a DPLL(T ) system. The basic