We previously gave a general definition for constraint systems. This defini- tion not only included non-strict inequalities, but also strict inequalities and divisibility constraints. We need strict inequalities because the negation of a non-strict inequality is a strict inequality, i.e.,¬(aT
i x≤ bi)≡ aTi x > bi. This means that a theory solver for linear arithmetic, i.e., a decision procedure for conjunctions of linear arithmetic literals, has to handle strict inequalities in some ways. Furthermore, we need divisibility constraints because they are introduced during the execution of some of our algorithms (CutSat, CutSat++, and CutSatg).
In the last section, we also explained that we cannot adept classical li- near arithmetic algorithms and theorems directly to strict inequalities and divisibility constraints. To resolve this problem, we also presented reduc- tions that turn general constraints into non-strict inequalities. This allows us to define our standard input problems—or for short problems—as systems of non-strict inequalities, which we typically abbreviate as systems of ine- qualitiesor inequality systems.6 Thereby, we are also conforming to classical linear arithmetic [28, 84, 90, 94, 104, 129].
Later in this section, we also present an alternative input format called the tableau representation. We switch to this format whenever we are dis- cussing algorithms in the context of SMT solvers because the tableau rep- resentation matches the actual representation inside most SMT implemen- tations [9, 41, 42, 50, 57, 58].
2.4.1 Systems of Inequalities
A system of inequalities is a set of inequalities {aT
1x≤ b1, . . . , aTmx ≤ bm}, which we typically abbreviate as Ax≤ b [101]. The row coefficients are given by A = (a1, . . . , am)T ∈ Qm×n, the variables are given by x = (x1, . . . , xn)T, and the inequality bounds are given by b = (b1, . . . , bm)T ∈ Qmδ . Moreover, we assume that any constant rows ai = 0nwere eliminated from our system during an implicit preprocessing step. This is a trivial task and eliminates some unnecessarily complicated corner cases.
Since Ax≤ b and A0x≤ b0 are just sets, we can write their combination as (Ax ≤ b) ∪ (A0x ≤ b0). A special system of inequalities is a system of equationsDx = c, which is equivalent to the combined system of inequalities (Dx≤ c)∪(−Dx ≤ −c). For such a system of equalities, the row coefficients are given by D = (d1, . . . , dm)T ∈ Qm×n, the variables are given by x = (x1, . . . , xn)T, and the equality bounds are given by c = (c1, . . . , cm)T ∈ Qm. The δ-coefficients qi in the bounds bi = pi+ qiδ can take on any value in Qδ. If qi = 0, then the inequality aTi x≤ bi is equivalent to the non-strict inequality aT
i x≤ pi. If qi < 0, then the inequality aTi x≤ bi is equivalent to the strict inequality aT
ix < pi. If qi> 0, then we have no clear interpretation over the actual rationals (compare also Lemma 2.3.1). For instance, the two inequalities x1 ≤ δ and −x1 ≤ −δ describe a rationally satisfiable system of constraints in Qδ, but there is no clear way of interpreting x1 ≤ δ in Q. Beware also that some of our methods (e.g., the linear cube transformation) can introduce positive δ-coefficients in the bounds. But since we derive all our methods with a semantically clear construction, the semantic interpre- tation over the rationals is still discernible if the original system has only non-positive δ-coefficients in its inequality bounds before the transformation.
6
Polyhedron is another alternative name for an inequality system. We use it mainly when we are looking at a system from a geometric perspective.
2.4.2 Tableau Representation
We defined our standard input problems as systems of inequalities Ax≤ b. We do so because most theorems in the literature as well as our own theo- rems can be proven more intuitively with inequalities. There are, however, some algorithms, e.g., the dual simplex algorithm we present in Section 2.7, for which we prefer a different representation of our input constraints: the tableau representation [58]. In the tableau representation, we partition our variables into two sets: the set of non-basic variables z1, . . . , zn ∈ N and the set of basic variables y1, . . . , ym ∈ B. The constraints of the tableau representation are then defined as: the so-called tableau Az = y and a set of bounds for the variables L(xj) ≤ xj ≤ U(xj) (for xj ∈ N ∪ B). The tableau representation also features two functionsL : B ∪ N → Qδ∪ {−∞} and U : B ∪ N → Qδ∪ {∞} that map the variables xi ∈ B ∪ N to their upper and lower bound values, respectively. The lower bound valueL(xj) is −∞ for variable xj if xj has no (explicit) lower bound. Similarly, the upper bound valueU(xj) is∞ for variable xj if xj has no (explicit) upper bound. We can easily transform a system of inequalities Ax≤ b into tableau rep- resentation by introducing a so-called slack variable sifor every inequality in our system. The type of the slack variable is typically rational, but can be set to integer if its row coefficients ai and all variables with non-zero coefficients are also integers. Our system is then defined by the equalities Az = y (with z := x and y := s) and the bound valuesL(xj) :=−∞ and U(xj) :=∞ for every original variable xjand the bound valuesL(si) :=−∞ and U(si) := bi for every slack variable introduced for the inequality aT
i x≤ bi. So initially, our original variables are the non-basic variables and the slack variables are the basic variables.
We can even reduce the number of slack variables if we transform in- equalities of the form aij · xj ≤ bi directly into bounds for xj. Moreover, we can use the same slack variable for multiple inequalities as long as the left side of the inequality is similar enough. For example, the inequalities aT
ix≤ bi and−aTi x≤ ci can be transformed into the equality aTix = si and the bound valuesL(si) :=−ci and U(si) := bi.
SMT solvers typically assign the slack variables during a preprocessing step with a normalization procedure based on a variable ordering. After the normalization, all terms are represented in one directed acyclic graph (DAG) so that all equivalent terms are assigned to the same node and, thereby, to the same slack variable. For more details on these simplifications we refer to [58].