Problem formulation
A formula in Quantifier-Free Linear Real Arithmetic (QF_LRA) is a boolean combination of atoms in the form
where , are variables, and is a comparison operator.
When dealing with a conjunction of such atoms, we can represent the problem as a system of linear inequalities:
Moreover, there are usually bounds on the variables, which can be represented as
Tableau formulation
We introduce a new vector of variables , where each entry corresponds to the slack variable for the -th inequality, i.e., .
to which we have to add the bounds on the variables:
where the new bounds for the slack variables are defined as
which simply ensures that the original inequalities are satisfied by the slack variables. Given , we can rewrite the problem as
Pivoting and updating
We can divide the variables into two sets: basic variables and non-basic variables. We will always enforce the following rules:
- basic variables are expressed in terms of non-basic variables
- the value of non-basic variables is always set to one of their bounds
Based on these rules, every time the value of a non-basic variable changes, which happens every time we enforce a stricter bound on the variable that forces us to update the latest assignment, we need update the values of the basic variables accordingly.
If we notice that a basic variable, has been assigned a value that violates its bounds, we may also want to switch its status with a non-basic variable. This operation is called pivoting. For it to be useful in the first place, we need to find a non-basic variable that, when its value is changed, allows us to satisfy the violated bound of the basic variable.
Note
Let’s consider an example where the current assignment to the basic variable is greater than its upper bound, i.e., . We look at all the non-basic variables that
- have a positive coefficient in the expression of and can be decreased, i.e.,
- have a negative coefficient in the expression of and can be increased, i.e.,
If we find such a variable, we can perform a pivoting operation to switch the status of and , making a basic variable and a non-basic variable. If this violates some other bounds, we can repeat the process until we find an assignment that satisfies all bounds, or we end up in a situation where no pivoting operation is possible. If the latter happens, it means that the original problem is unsatisfiable, and we must return an explanation to the SAT solver.
Solving QF_LRA
Tableau pivoting
We start by assigning the value of to all variables and construct the tableau as described in the previous section, but ignoring the bounds for the moment.
At the beginning, all variable in the original are non-basic, while all slack variables are basic. Then, we start enforcing the bounds one by one. Each time the current assignment is stricter than the current assignment of a non-basic variable, we update the value of the basic variables accordingly. Otherwise, we simply update the current bound of the basic variable, and check if the current assignment violates it. If it does, we try to pivot the basic variable with a non-basic variable that allows us to satisfy the violated bound. If we find such a variable, we perform the pivoting operation and update the values of the basic variables accordingly. If we cannot find such a variable, it means that the original problem is unsatisfiable, and we must return an explanation to the SAT solver.