<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">On the Benefits of Enhancing Optimization Modulo Theories with Sorting Networks for MaxSMT</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Roberto</forename><surname>Sebastiani</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">DISI</orgName>
								<orgName type="institution">University of Trento</orgName>
								<address>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Patrick</forename><surname>Trentin</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">DISI</orgName>
								<orgName type="institution">University of Trento</orgName>
								<address>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">On the Benefits of Enhancing Optimization Modulo Theories with Sorting Networks for MaxSMT</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">5CFC716099F754D06BB83CCDB3C3232A</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-23T22:40+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Optimization Modulo Theories (OMT) is an extension of SMT, which combines SMT with optimization, finding models that make given objectives optimal. OMT has been extended to be incremental and to handle multiple objective functions either independently or with their linear, lexicographic, Pareto, min-max/max-min combinations. OMT applications can be found not only in the domains of Formal Verification, Automated Reasoning and Planning with Resources, but also Machine Learning and Requirement Engineering. (Partial weighted) MAXSMT-or, alternatively, OMT with Pseudo-Boolean objective functions-is a very-relevant subcase of OMT. Unfortunately, using general OMT algorithm for MAXSMT suffers from some intrinsic inefficiencies in some cases. In this paper we identify the sources of such inefficiencies and address them by enhancing general OMT by means of sorting networks. We implemented this idea on top of the OPTIMATHSAT OMT solver and evaluated them empirically on problems coming from Machine Learning and Requirement Engineering. The empirical results support the effectiveness of this idea.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Optimization Modulo Theories (OMT) is an extension of SMT, which allows for finding models that make a given objective optimal through a combination of SMT and optimization procedures <ref type="bibr" target="#b16">[18,</ref><ref type="bibr" target="#b9">11,</ref><ref type="bibr" target="#b10">12,</ref><ref type="bibr" target="#b18">20,</ref><ref type="bibr" target="#b19">21,</ref><ref type="bibr" target="#b12">14,</ref><ref type="bibr" target="#b13">15,</ref><ref type="bibr" target="#b7">9,</ref><ref type="bibr" target="#b8">10,</ref><ref type="bibr" target="#b21">23,</ref><ref type="bibr" target="#b20">22]</ref>. Latest advancements in OMT have further broadened its horizon by making it incremental <ref type="bibr" target="#b7">[9,</ref><ref type="bibr" target="#b21">23]</ref> and by supporting objectives defined in other theories than linear arithmetic (e.g. Bit-Vectors) <ref type="bibr" target="#b7">[9,</ref><ref type="bibr" target="#b8">10,</ref><ref type="bibr" target="#b14">16]</ref>. Moreover, OMT has been extended with the capability of handling multiple objectives at the same time either independently or through their linear, min-max/max-min, lexicographic or Pareto combination <ref type="bibr" target="#b7">[9,</ref><ref type="bibr" target="#b8">10,</ref><ref type="bibr" target="#b21">23]</ref>.</p><p>An important sub-case of OMT is (partial weighted<ref type="foot" target="#foot_0">1</ref> ) MAXSMT-or alternatively OMT with Pseudo-Boolean objective functions <ref type="bibr" target="#b17">[19]</ref>- <ref type="bibr" target="#b16">[18,</ref><ref type="bibr" target="#b9">11,</ref><ref type="bibr" target="#b10">12]</ref>, which is the problem of finding a model for an input formula which both satisfies all hard clauses and maximizes the cumulative weight of all soft clauses made True by the model.</p><p>Two main approaches for MAXSMT have been adopted in the literature.</p><p>One approach is to embed some MAXSAT engine within the SMT solver itself, and use it in combination with dedicated T -solvers <ref type="bibr" target="#b2">[4,</ref><ref type="bibr" target="#b10">12,</ref><ref type="bibr" target="#b7">9,</ref><ref type="bibr" target="#b8">10]</ref>. Although this approach can be very efficient, it has some limitations that make it an impractical choice in some cases.</p><p>The first issue is that, to the best of our knowledge, MAXSAT engines deal with integer weights only. However, some applications, e.g., Learning Modulo Theories <ref type="bibr" target="#b23">[25]</ref> -a hybrid Machine Learning approach in which OMT is used as an oracle for Support Vector Machines <ref type="bibr" target="#b23">[25]</ref>-may require the weight of soft-constraints to be high-precision rational values. In this context, it is preferable not to round the weights associated with soft-clauses since it affects the accuracy of the Machine Learning approach.</p><p>The second drawback is that a MAXSAT engine cannot be used when dealing with an OMT problem with multiple-independent objectives that need to be optimized at the same time, or when the objective function is given by either a linear combination of Pseudo-Boolean and arithmetic terms (like, e.g., for Linear Generalized Disjunctive Programming problems <ref type="bibr" target="#b19">[21]</ref>) or a non-trivial combination of several Pseudo-Boolean sums as in <ref type="bibr" target="#b23">[25]</ref>.</p><p>An alternative approach for dealing with MAXSMT is to encode it as a Pseudo-Boolean objective in Optimization Modulo Theories <ref type="bibr" target="#b19">[21]</ref> which, for the above reasons, is the approach adopted in OPTI-MATHSAT <ref type="bibr" target="#b0">[1]</ref>.</p><p>We notice that, unfortunately, compared with the use of a dedicated MAXSAT engine, this second approach might result in poor performance when dealing with MAXSMT problems in which a large number of soft-clauses are assigned the same weight. In fact, this situation entails the existence of symmetries in the solution space that might lead to a combinatorial explosion of the partial truth assignments generated by the CDCL engine during the optimization search.</p><p>In this paper we analyze the sources of this inefficiency and describe and evaluate a solution based on sorting networks, which we implemented on top of OPTIMATHSAT. The benefits of applying this technique are shown with an experimental evaluation based on two OMT applications, performed on benchmarks sets coming from the Requirement Engineering and Machine Learning domain.</p><p>Related Work. The idea of MaxSMT and, more generally, of optimization in SMT was first introduced by Nieuwenhuis &amp; Oliveras <ref type="bibr" target="#b16">[18]</ref>, who presented a general logical framework of "SMT with progressively stronger theories" (e.g., where the theory is progressively strengthened by every new approximation of the minimum cost), and presented implementations for MaxSMT based on this framework. Cimatti et al. <ref type="bibr" target="#b9">[11]</ref> introduced the notion of "Theory of Costs" C to handle Pseudo-Boolean (PB) cost functions and constraints by an ad-hoc and independent "C-solver" in the standard lazy SMT schema, and implemented a variant of MathSAT tool able to handle SMT with PB constraints and to minimize PB cost functions. Ansótegui et al. <ref type="bibr" target="#b2">[4]</ref> described the evaluation of an implementation of a MaxSMT procedure based on YICES, although this implementation is not publicly available. Cimatti et al. <ref type="bibr" target="#b10">[12]</ref> presented a "modular" approach for MaxSMT, combining a lazy SMT solver with a MaxSAT solver, which can be used as black-boxes, where the SMT solver is used as an oracle generating T -lemmas that are then learned by the MAXSAT solver so as to progressively narrow the search space toward the optimal solution.</p><p>Sebastiani and Tomasi <ref type="bibr" target="#b18">[20,</ref><ref type="bibr" target="#b19">21]</ref> introduced a wider notion of optimization in SMT, namely Optimization Modulo Theories (OMT) with linear cost functions on the rationals, OMT(LRA∪T ), which allows for finding models minimizing some LRA cost term -T being some (possibly empty) stably-infinite theory s.t. T and LRA are signature-disjoint 2 , and presented novel OMT(LRA ∪ T ) tools which combine standard SMT with LP minimization techniques. Eventually, OMT(LRA ∪ T ) has been extended so that to handle costs on the integers, incremental OMT, multi-objective and lexicographic OMT and Pareto-optimality <ref type="bibr" target="#b13">[15,</ref><ref type="bibr" target="#b12">14,</ref><ref type="bibr" target="#b7">9,</ref><ref type="bibr" target="#b21">23,</ref><ref type="bibr" target="#b8">10,</ref><ref type="bibr" target="#b20">22]</ref>. To the best of our knowledge only four OMT solvers are currently implemented: BCLT <ref type="bibr" target="#b12">[14]</ref>, OPTIMATHSAT <ref type="bibr" target="#b21">[23,</ref><ref type="bibr" target="#b20">22]</ref>, SYMBA <ref type="bibr" target="#b13">[15]</ref> and νZ <ref type="bibr" target="#b7">[9,</ref><ref type="bibr" target="#b8">10]</ref>. Remarkably, νZ <ref type="bibr" target="#b7">[9,</ref><ref type="bibr" target="#b8">10]</ref> implements specialized procedures for MaxSMT, leveraging to SMT level various state-of-the-art MaxSAT procedures. In addition to it, νZ features a Pseudo-Boolean T -solver which can generate sorting networks on demand for Pseudo-Boolean inequalities featuring sums with small coefficients when a Pseudo-Boolean inequality is used some times for unit propagation/conflicts <ref type="bibr" target="#b8">[10,</ref><ref type="bibr" target="#b6">8]</ref>.</p><p>Importantly, both partial weighted MAXSMT and SMT with PB objectives can be encoded into OMT(LRA ∪ T ), whereas the contrary is not possible <ref type="bibr" target="#b18">[20,</ref><ref type="bibr" target="#b19">21]</ref>.</p><p>Content. The paper is structured as follows. The background and the state of the art are briefly reviewed in section §2, whereas section §3 describes the source of inefficiency arising when partial weighted MAXSMT is encoded in OMT as in <ref type="bibr" target="#b19">[21]</ref>. Section §4 illustrates a possible solution based on sorting networks, whereas in §5 we provide empirical evidence of the benefits of this approach on two applications of OMT interest. Section §6 concludes the paper with some considerations on the future work.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Background and State of the Art</head><p>Optimization Modulo Theories is an extension of SMT which addresses the problem of finding a model for an input formula ϕ which is optimal wrt. some objective function obj <ref type="bibr" target="#b16">[18]</ref>.</p><p>The basic minimization scheme implemented in state-of-the-art OMT solvers, known as linearsearch scheme <ref type="bibr" target="#b18">[20,</ref><ref type="bibr" target="#b19">21]</ref>, requires solving an SMT problem with a solution space that is progressively tightened by means of unit linear constraints in the form (obj &lt; ub i ), where ub i is the value of obj that corresponds to the optimum model of the most-recently found truth assignment µ i s.t. µ i |= ϕ. The ub i value is computed by means of a specialized optimization procedure embedded within the T -solver of interest that, taken as input a pair µ, obj , returns the optimal value ub of obj for such µ. The OMT search terminates when the latter procedure finds that obj is unbounded or when the SMT search is UNSAT, in which case the latest value of obj (if any) and its associated model M i is returned as optimal solution value. (Alternatively, binary-search schemes can also be used <ref type="bibr" target="#b18">[20,</ref><ref type="bibr" target="#b19">21]</ref>.)</p><p>An important subcase of OMT is that of MAXSMT, which is a pair ϕ h , ϕ s , where ϕ h denotes the set of "hard" T -clauses, ϕ s is a set of positive-weighted "soft" T -clauses, and the goal is to find the maximum-weight set of <ref type="bibr" target="#b16">[18,</ref><ref type="bibr" target="#b9">11,</ref><ref type="bibr" target="#b2">4,</ref><ref type="bibr" target="#b10">12]</ref>. As described in <ref type="bibr" target="#b19">[21]</ref>, MAXSMT ϕ h , ϕ s can be encoded into a general OMT problem with a Pseudo-Boolean objective. To do so, one first introduces a fresh Boolean variable A i for each soft-constraint</p><formula xml:id="formula_0">T -clauses ψ s , ψ s ⊆ ϕ s , s.t. ϕ h ∪ ψ s is T -satisfiable</formula><formula xml:id="formula_1">C i ∈ ϕ s as follows ϕ * def = ϕ h ∪ Ci∈ϕs {(A i ∨ C i )}; obj def = Ci∈ϕs w i A i<label>(1)</label></formula><p>and then encodes the problem into OMT as a pair ϕ, obj where ϕ is defined as</p><formula xml:id="formula_2">ϕ def = ϕ * ∧ i ((A i → (x i = w i )) ∧ (¬A i → (x i = 0))) ∧ (2) i ((0 ≤ x i ) ∧ (x i ≤ w i ))<label>(3)</label></formula><formula xml:id="formula_3">obj def = i x i , x i f resh<label>(4)</label></formula><p>Notice that, although redundant from a logical perspective, the constraints in (3) serve the important purpose of allowing early-pruning calls to the LRA-Solver (see <ref type="bibr" target="#b4">[6]</ref>) to detect a possible LRA inconsistency among the current partial truth assignment over variables A i and linear cuts in the form (obj &lt; ub) that are pushed on the formula stack by the OMT solver during the minimization of obj. To this extent, the presence of such constraints improves performance significantly.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Problems with using OMT for MaxSMT</head><p>Consider first the case of a MAXSMT-derived OMT problem as in equation (1) s.t. all weights are identical, that is: let ϕ, obj be an OMT problem, where obj = i=n−1 i=0</p><p>w • A i , A i being Boolean variables, and let µ be a satisfiable truth assignment found by the OMT solver during the minimization of obj.</p><formula xml:id="formula_4">Given A T = {A i |µ |= A i } and k = |A T |, then the upper bound value of obj in µ is ub = w • k.</formula><p>As described in <ref type="bibr" target="#b18">[20,</ref><ref type="bibr" target="#b19">21]</ref>, the OMT solver adds a unit clause in the form (obj &lt; ub) in order to (1) remove the current truth assignment µ from the feasible search space and (2) seek for another µ which improves the current upper-bound value ub. Importantly, the unit clause (obj &lt; ub) does not only prune the current truth assignment µ from the feasible search space, but it also makes inconsistent any other possible (partial) truth assignment µ which sets exactly k (or more) A i variables to True. Thus, each new unit clause in this form prunes at least γ = n k truth assignments from the search space, where γ is equal to the cardinality of the set of possible permutations of µ over the variables A i .</p><p>However, the inconsistency of a truth assignment µ which sets exactly k variables to True wrt. a unit clause (obj &lt; ub), where ub = w • k, can not be determined by simple Boolean Propagation. In fact, (obj &lt; ub) being a LRA term, the CDCL engine is totally oblivious to this inconsistency until when the T -solver for linear arithmetic is invoked, and a conflict clause is generated. Therefore, since the T -solver for linear arithmetic is more resource demanding than Boolean Propagation and is invoked less often, it is clear that the performance of an OMT solver can be negatively affected when dealing with this kind of objectives.</p><p>To conclude, notice that the performance issue identified with the previous case example can be generalized to any objective obj in the form</p><formula xml:id="formula_5">obj = τ 1 + ... + τ m ,<label>(5)</label></formula><formula xml:id="formula_6">∀ j ∈ [1, m]. (τ j = w j • i=kj i=0 A ji ) ∧ (0 ≤ τ j ) ∧ (τ j ≤ w j • k j )<label>(6)</label></formula><p>where the logically-redundant constraints (0 ≤ τ j ) ∧ (τ j ≤ w j • k j ) are added for the same reason as with (3).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Combining OMT with Sorting Networks</head><p>A solution for improving search efficiency when dealing with MAXSMT and OMT with Pseudo-Boolean objectives in the form</p><formula xml:id="formula_7">obj = w • i=n−1 i=0 A i<label>(7)</label></formula><p>is to reduce the dependency on the expensive LRA-Solver by better exploiting Boolean Constraint Propagation (BCP) with the aid of sorting networks.</p><p>A sorting-network relation, depicted in figure <ref type="figure" target="#fig_0">1</ref>, takes A 0 , ..., A n−1 Boolean variables as input and returns out 0 , ..., out n−1 variables as output s.t., if in the current (partial) truth assignment µ, k variables are set to True, n − m variables are set to False and m − k are unassigned, then by Boolean Constraint Propagation out 0 , ..., out k−1 are set to True, out m , ..., out n−1 are set to False and out k , ..., out m−1 are not propagated.</p><p>For our purposes, it is important that the implementation of the relation is bidirectional: e.g., if out k−1 is forced to be True (that is, at least k inputs must be True) and n − k inputs A i are False, then by Boolean Propagation all other unassigned A i s are automatically set to True; vice-versa, if out k+1 is forced to be False (that is, at most k inputs can be True) and n − k inputs A i are True, then all other unassigned A i s are automatically set to False.</p><p>Given an OMT problem ϕ, obj, , where obj is as in <ref type="bibr" target="#b5">(7)</ref>, and a sorting network relation encoding C matching the previous definition, we extend ϕ in equation (2) as follows: The benefit of this extension is that now, whenever the optimization search finds a new satisfiable truth assignment µ which sets k variables A i to True, so that a unit clause in the form (obj &lt; k • w) is learned, then as soon as k − 1 inputs A i are assigned to True the remaining n − k + 1 inputs are set to False by BCP. (A dual case occurs when some lower-bound unit clause (obj &gt; k • w) is learned.)</p><formula xml:id="formula_8">ϕ = ϕ ∧ C ∧ k=n−1 k=0      out k → ((k + 1) • w ≤ obj) ¬out k → (obj ≤ k • w) ¬((k + 1) • w ≤ obj) ∨ ¬(obj ≤ k • w) (8)</formula><p>In our work, we have considered two encodings for the sorting network relation: the sequential counter encoding <ref type="bibr" target="#b22">[24]</ref> and the cardinality network encoding <ref type="bibr" target="#b1">[3]</ref>. Notice that, in contrast with the literature which usually focuses on only one direction of cardinality constraints, in our context we are interested in a bidirectional encoding of sorting circuit so to ensure the correct propagation of the out k values. This is due to the fact that our OMT solver applies this technique to deal not only with MaxSMT problems but also with Pseudo-Boolean objectives that can be either minimized or maximized, and other Pseudo-Boolean sums subject to simple cardinality constraints outside of an optimization context.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Bidirectional Sequential Counter Encoding</head><p>The sequential counter encoding LT n,k SEQ for ≤ k(A 0 , ..., A n−1 ) presented in <ref type="bibr" target="#b22">[24]</ref> requires O(k • n) clauses and variables to be represented, and is arc-consistent. The circuit is given by the composition of n sub-circuits, each of which computes s i = j=i j=0 A j , represented in unary form with the bits s i,j . The following formula is the original propositional encoding of LT n,k SEQ presented in <ref type="bibr" target="#b22">[24]</ref>, with k instantiated to n, which was obtained after discarding one direction of the equations for polarity reasons.</p><formula xml:id="formula_9">(¬A 0 ∨ s 0,0 ) ∧ i=n−1 i=1 {(¬A i ∨ s i,0 ) ∧ (¬s i−1,0 ∨ s i,0 ) ∧ (¬A i ∨ ¬s i−1,n )∧} j=n−1 j=1 {(¬s 0,j )} ∧ i,j=n−1 i,j=1 {(¬A i ∨ ¬s i−1,j−1 ∨ s i,j ) ∧ (¬s i−1,j ∨ s i,j )}</formula><p>We strengthened the original encoding with the following clauses to make it bidirectional:</p><formula xml:id="formula_10">(A 0 ∨ ¬s 0,0 ) ∧ i=n−1 i=1 {(¬s i,0 ∨ A i ∨ s i−1,0 )} ∧ i,j=n−1 i,j=1 (¬s i,j ∨ s i−1,j ∨ (s i−1,j−1 ∧ A i ))</formula></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Bidirectional Cardinality Network Encoding</head><p>The cardinality network encoding presented in <ref type="bibr" target="#b11">[13,</ref><ref type="bibr" target="#b3">5,</ref><ref type="bibr" target="#b1">3]</ref>, based on the underlying sorting scheme of the well-known merge-sort algorithm, has complexity O(n log 2 k) in the number of clauses and variables, and is arc-consistent. Due to space limitations, we refer the reader to <ref type="bibr" target="#b1">[3]</ref> for the encoding of cardinality networks we used in our own work. Notice that, differently than in the previous case, this sorting circuit propagates values in both directions and is thus suitable to be used as is within OMT.</p><p>Both of the previous encodings are istantiated assuming k = n, since the sorting network is generated prior to starting the search. Therefore, the cardinality network circuit looks more appealing than the sequential counter encoding due to its lower complexity in terms of clauses and variables employed.</p><p>To conclude, note that this approach based on sorting networks can also be applied when dealing with more general Pseudo-Boolean objectives as in equations 5, 6. In this case a separate sorting circuit is generated for each term τ j , and some (optional) constraints in the form (obj &lt; w j •i) =⇒ (τ j &lt; w j •i), for i ∈ [0, k j ], can be added to ensure that the circuit is activated by BCP.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Experimental Evaluation</head><p>As part of our research work, we extended OPTIMATHSAT with a novel preprocessing step for dealing with assert-soft constraints (see <ref type="bibr" target="#b20">[22]</ref>) which automatically extends the input formula with a sorting network circuit of choice among the sequential counter and the cardinality network. We recall here that, in OPTIMATHSAT, the assert-soft statement can be used not only to encode MAXSMT problems like in νZ, but also generic Pseudo-Boolean terms that can be linearly combined into other constraints or objective functions.</p><p>In the following experiments <ref type="foot" target="#foot_1">3</ref> we evaluate whether the speed-up obtained by extending the input formula with a sorting network during the optimization search can outweigh the cost of its generation step within the OMT solver itself, as opposed to demanding the end-user to do it offline.</p><p>Each test was performed on a pair of identical Ubuntu Linux machines featuring 8-core Intel-Xeon@2.20GHz CPU, 64 GB of ram and kernel 3.8-0-29.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Benchmark Set #1: Optimal Realization of Goal Model with Soft-Requirements</head><p>In our first experiment, we focused on a benchmark database consisting of 18996 formulas, automatically generated, derived from the problem of computing the optimal realization of a constrained goal model enriched with soft-requirements <ref type="bibr" target="#b15">[17]</ref>, one of OPTIMATHSAT applications in the context of Requirement Engineering. Each OMT problem contains a combination of up to three MAXSMT objectives sorted with lexicographic priority. In this experiment, we set the timeout at 100 seconds and we verified that all the tested configurations agreed on the optimum value.</p><p>As it can be seen in the top table of figure <ref type="figure">2</ref>, extending the input formula with either of the sorting network circuits increases the number of benchmarks solved within the time-out.</p><p>Notably, the cardinality network encoding -which has the lowest complexity-scores the best both in terms of number of solved benchmarks and solving time. On the other hand, the sequential counter circuit is affected by a significant performance hit on a number of benchmarks, as it is witnessed by the bottom-left scatter plot in figure <ref type="figure">2</ref>. This not only affects unsatisfiable benchmarks, for which using sorting networks appears to be not beneficial in general, but also satisfiable ones.</p><p>A possible strategy for overcoming this performance issue is to reduce the memory footprint determined by the generation of the sorting network circuit. This can be easily achieved by splitting each Pseudo-Boolean sum in smaller sized chunks and generating a separate sorting circuit for each splice.</p><p>The result of applying this enhancement, using chunks of increasing size, is shown in figure <ref type="figure" target="#fig_1">3</ref>. Both the table and the scatter plots suggest that the sequential counter encoding can greatly benefit from this simple heuristic, since both the number of solved benchmarks and the running time improve to levels comparable with that achieved using the cardinality network circuit.</p><p>As suggested by one of the reviewers, we extended our experimental evaluation to include νZ. The results are shown in the top table of figure 2. Although νZ is able to solve the whole benchmark set in a very short amount of time using the MaxRes MAXSMT engine, OPTIMATHSAT and νZ disagree on the optimal solution of a number of benchmarks. Further investigation confirmed that in some cases νZ returns an incorrect optimum model when dealing with multiple MAXSMT combined lexicographically. Figure <ref type="figure">2</ref>: Top: Results on MAXSMT problems using the OMT encoding in <ref type="bibr" target="#b19">[21]</ref> (top), paired with the Boolean cardinality constraint encoding in <ref type="bibr" target="#b22">[24]</ref> (middle) and in <ref type="bibr" target="#b1">[3]</ref> (bottom). Bottom: performance gain obtained by joining the input formula with the sequential counter circuit (left) and the cardinality network encoding (right); brown colour denotes unsatisfiable benchmarks, blue represent satisfiable ones and green represents timeouts.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Benchmark Set #2: Structured Learning Modulo Theories</head><p>The second experiment regards a set of problems taken from PYLMT [2], a tool for Structured Learning Modulo Theories <ref type="bibr" target="#b23">[25]</ref> which uses OPTIMATHSAT as back-end oracle for performing inference in the context of machine learning in hybrid domains. Starting from the original set of 500 satisfiable formulas, which used a naive encoding of Pseudo-Boolean objectives by default, we generated a new benchmark set which uses the assert-soft statement to encode the following objective function given by a non-trivial combination of several Pseudo-Boolean terms.</p><formula xml:id="formula_11">cover = i w i A i obj = j w j • B j + cover − k w k • C k − |K − cover|</formula><p>We ran both νZ and OPTIMATHSAT over the original set of benchmarks, and compared the following three configurations for OPTIMATHSAT over the assert-soft based benchmark set: orig. enc., which maps the input weighted MAXSMT formula into an OMT problem with no circuit, seq. counter enc., which extends the input formula with the sequential counter encoding, and card. network enc. which uses instead the cardinality network encoding.  We imposed a timeout of 600 seconds for both tools, and verified that all solvers and their configurations -when terminating-agreed on the optimal solution values.</p><p>The results, depicted in figure <ref type="figure" target="#fig_2">4</ref>, show that extending the input problems with sorting network circuits benefits the number of solved benchmarks within the timeout, with the cardinality network encoding performing better by a small margin. As highlighted by the scatter plots in the bottom part of figure <ref type="figure" target="#fig_2">4</ref>, generating these circuit on the fly causes a limited overhead on easy benchmarks, whereas it can significantly improve the running time on difficult ones.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusion and Future Work</head><p>MAXSMT is an important sub-case of Optimization Modulo Theories for which specialized algorithms and techniques have been developed over the years. Nonetheless, when dealing with non trivial combination of multiple objectives or problems with fine grained weights over soft-clauses, MAXSMT might require being encoded as a Pseudo-Boolean objective and solved with ordinary OMT techniques.</p><p>In this paper we reviewed the encoding of MAXSMT in OMT proposed in <ref type="bibr" target="#b19">[21]</ref> and described a possible inefficiency problem that might arise when dealing with problems in which a large number of soft-clauses share the same weight value, due to the resulting symmetries in the solution space. In order to overcome this issue, we proposed a transparent solution based on extending the input problem with two different sorting networks: the sequential counter circuit and the cardinality constraint encoding. The benefits of this technique have been demonstrated through an experimental evaluation on a couple of benchmark sets coming from the domain of Requirement Engineering and Machine Learning.</p><p>Albeit of the positive results attained, this is still work in progress, and future work should focus on how to extend this technique to better handle similar performance issues when dealing with more heterogeneous sets of weights values.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: The basic schema of a sorting network relation</figDesc><graphic coords="5,212.05,106.42,185.40,77.85" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 3 :</head><label>3</label><figDesc>Figure 3: Top: the performance gain obained by the limiting the size of the generated sorting circuit. Bottom: the same comparison as in figure 2, using a circuit size limit of 20; brown colour denotes unsatisfiable benchmarks, blue represent satisfiable ones and green represents timeouts.</figDesc><graphic coords="8,98.99,240.51,214.61,161.88" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Figure 4 :</head><label>4</label><figDesc>Figure 4: Top: comparison among various OPTIMATHSAT configurations and νZ on a set of benchmarks based on the Structured Learning Modulo Theories domain [25]. Bottom: scatter plots for the same experimental data showing a comparison among OPTIMATHSAT solve time over the original problems wrt. the assert-soft encoding enriched with a sorting network circuit generated on the fly.</figDesc><graphic coords="9,91.52,209.63,214.61,161.88" type="bitmap" /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">Hereafter, when speaking of MAXSAT and MAXSMT, we keep "partial weighted" implicit unless explicitly stated otherwise.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_1">All benchmarks, as well as our experimental results, are made available at http://disi.unitn.it/ ˜trentin/ resources/smt16.tar.gz</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<title/>
		<author>
			<persName><surname>Optimathsat</surname></persName>
		</author>
		<ptr target="http://optimathsat.disi.unitn.it" />
		<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">A Parametric Approach for Smaller and Better Encodings of Cardinality Constraints</title>
		<author>
			<persName><forename type="first">I</forename><surname>Abío</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Nieuwenhuis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Oliveras</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Rodríguez-Carbonell</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">19th International Conference on Principles and Practice of Constraint Programming, CP&apos;13</title>
				<imprint>
			<date type="published" when="2013">2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m" type="main">Satisfiability Modulo Theories: An Efficient Approach for the Resource-Constrained Project Scheduling Problem</title>
		<author>
			<persName><forename type="first">C</forename><surname>Ansótegui</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Bofill</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Palahí</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Suy</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Villaret</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2011">2011</date>
			<publisher>SARA</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Cardinality networks: a theoretical and empirical study</title>
		<author>
			<persName><forename type="first">R</forename><surname>Asín</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Nieuwenhuis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Oliveras</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Rodríguez-Carbonell</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Constraints</title>
		<imprint>
			<biblScope unit="volume">16</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="195" to="221" />
			<date type="published" when="2011">2011</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Satisfiability Modulo Theories</title>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">W</forename><surname>Barrett</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><forename type="middle">A</forename><surname>Seshia</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Tinelli</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Handbook of Satisfiability</title>
				<imprint>
			<publisher>IOS Press</publisher>
			<date type="published" when="2009">2009</date>
			<biblScope unit="volume">26</biblScope>
			<biblScope unit="page" from="825" to="885" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<title level="m" type="main">Handbook of Satisfiability</title>
		<editor>A. Biere, M. J. H. Heule, H. van Maaren, and T. Walsh</editor>
		<imprint>
			<date type="published" when="2009-02">February 2009</date>
			<publisher>IOS Press</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<title/>
		<author>
			<persName><forename type="first">N</forename><surname>Bjorner</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2016">2016</date>
			<biblScope unit="page">2</biblScope>
		</imprint>
	</monogr>
	<note>personal communication</note>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">νZ -Maximal Satisfaction with Z3</title>
		<author>
			<persName><forename type="first">N</forename><surname>Bjorner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A.-D</forename><surname>Phan</surname></persName>
		</author>
		<ptr target="http://www.easychair.org/publications/?page=862275542" />
	</analytic>
	<monogr>
		<title level="m">Proc International Symposium on Symbolic Computation in Software Science</title>
				<meeting>International Symposium on Symbolic Computation in Software Science<address><addrLine>Gammart, Tunisia</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2014-12">December 2014</date>
		</imprint>
	</monogr>
	<note>EasyChair Proceedings in Computing (EPiC)</note>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">νZ -An Optimizing SMT Solver</title>
		<author>
			<persName><forename type="first">N</forename><surname>Bjorner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A.-D</forename><surname>Phan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Fleckenstein</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. TACAS</title>
				<meeting>TACAS</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2015">9035. 2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Satisfiability modulo the theory of costs: Foundations and applications</title>
		<author>
			<persName><forename type="first">A</forename><surname>Cimatti</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Franzén</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Griggio</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Stenico</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">TACAS</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2010">2010</date>
			<biblScope unit="volume">6015</biblScope>
			<biblScope unit="page" from="99" to="113" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">A Modular Approach to MaxSAT Modulo Theories</title>
		<author>
			<persName><forename type="first">A</forename><surname>Cimatti</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Griggio</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><forename type="middle">J</forename><surname>Schaafsma</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Theory and Applications of Satisfiability Testing</title>
				<meeting><address><addrLine>SAT</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2013-07">July 2013</date>
			<biblScope unit="volume">7962</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Translating pseudo-boolean constraints into SAT</title>
		<author>
			<persName><forename type="first">N</forename><surname>Eén</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Sörensson</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">JSAT</title>
		<imprint>
			<biblScope unit="volume">2</biblScope>
			<biblScope unit="issue">1-4</biblScope>
			<biblScope unit="page" from="1" to="26" />
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Minimal-Model-Guided Approaches to Solving Polynomial Constraints and Extensions</title>
		<author>
			<persName><forename type="first">D</forename><surname>Larraz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Oliveras</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Rodríguez-Carbonell</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Rubio</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">SAT</title>
				<imprint>
			<date type="published" when="2014">2014</date>
			<biblScope unit="page" from="333" to="350" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Symbolic Optimization with SMT Solvers</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Li</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Albarghouthi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Z</forename><surname>Kincad</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Gurfinkel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Chechik</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">POPL</title>
				<imprint>
			<date type="published" when="2014">2014</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">Bit-vector optimization</title>
		<author>
			<persName><forename type="first">A</forename><surname>Nadel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Ryvchin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Tools and Algorithms for the Construction and Analysis of Systems -22nd International Conference, TACAS 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<editor>
			<persName><forename type="first">M</forename><surname>Chechik</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">J</forename><surname>Raskin</surname></persName>
		</editor>
		<meeting><address><addrLine>Eindhoven, The Netherlands</addrLine></address></meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2016">April 2-8, 2016. 2016</date>
			<biblScope unit="volume">9636</biblScope>
			<biblScope unit="page" from="851" to="867" />
		</imprint>
	</monogr>
	<note>Proceedings</note>
</biblStruct>

<biblStruct xml:id="b15">
	<monogr>
		<title level="m" type="main">Multi object reasoning with constrained goal model</title>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">M</forename><surname>Nguyen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Giorgini</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Mylopoulos</surname></persName>
		</author>
		<idno>CoRR, abs/1601.07409</idno>
		<ptr target="http://arxiv.org/abs/1601.07409" />
		<imprint>
			<date type="published" when="2016">2016</date>
		</imprint>
	</monogr>
	<note>Under journal submission</note>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">On SAT Modulo Theories and Optimization Problems</title>
		<author>
			<persName><forename type="first">R</forename><surname>Nieuwenhuis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Oliveras</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. Theory and Applications of Satisfiability Testing -SAT 2006</title>
				<meeting>Theory and Applications of Satisfiability Testing -SAT 2006</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2006">2006</date>
			<biblScope unit="volume">4121</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<monogr>
		<title level="m" type="main">Pseudo-Boolean and Cardinality Constraints</title>
		<author>
			<persName><forename type="first">O</forename><surname>Roussel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Manquinho</surname></persName>
		</author>
		<editor>Biere et al.</editor>
		<imprint>
			<date type="published" when="2009-02">February 2009</date>
			<biblScope unit="volume">22</biblScope>
			<biblScope unit="page" from="695" to="733" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">Optimization in SMT with LA(Q) Cost Functions</title>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Tomasi</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">IJCAR</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2012-07">July 2012</date>
			<biblScope unit="volume">7364</biblScope>
			<biblScope unit="page" from="484" to="498" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">Optimization Modulo Theories with Linear Rational Costs</title>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Tomasi</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Transactions on Computational Logics</title>
		<imprint>
			<biblScope unit="volume">16</biblScope>
			<biblScope unit="issue">2</biblScope>
			<date type="published" when="2015-03">March 2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b20">
	<analytic>
		<title level="a" type="main">OptiMathSAT: A Tool for Optimization Modulo Theories</title>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Trentin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. International Conference on Computer-Aided Verification</title>
				<meeting>International Conference on Computer-Aided Verification<address><addrLine>CAV</addrLine></address></meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2015">2015. 9206. 2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b21">
	<analytic>
		<title level="a" type="main">Pushing the Envelope of Optimization Modulo Theories with Linear-Arithmetic Cost Functions</title>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Trentin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. Int. Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS&apos;15</title>
				<meeting>Int. Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS&apos;15</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2015">9035. 2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b22">
	<analytic>
		<title level="a" type="main">Towards an optimal cnf encoding of boolean cardinality constraints</title>
		<author>
			<persName><forename type="first">C</forename><surname>Sinz</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="s">Lecture Notes in Computer Science</title>
		<editor>P. van Beek, editor</editor>
		<imprint>
			<biblScope unit="volume">3709</biblScope>
			<biblScope unit="page" from="827" to="831" />
			<date type="published" when="2005">2005</date>
			<publisher>Springer</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b23">
	<analytic>
		<title level="a" type="main">Structured Learning Modulo Theories</title>
		<author>
			<persName><forename type="first">S</forename><surname>Teso</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Sebastiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Passerini</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Artificial Intelligence Journal</title>
		<imprint>
			<date type="published" when="2015">2015</date>
		</imprint>
	</monogr>
	<note>To appear</note>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
