9#ifndef DLINEAR_ENABLED_SOPLEX
10#error SoPlex is not enabled. Please enable it by adding "--//tools:enable_soplex" to the bazel command.
18#include "dlinear/libs/libgmp.h"
19#include "dlinear/libs/libsoplex.h"
20#include "dlinear/solver/LpRowSense.h"
21#include "dlinear/solver/TheorySolver.h"
22#include "dlinear/symbolic/PredicateAbstractor.h"
23#include "dlinear/symbolic/literal.h"
24#include "dlinear/symbolic/symbolic.h"
25#include "dlinear/util/Box.h"
37 const std::string& class_name =
"SoplexTheorySolver");
42 void Reset()
override;
96 void CreateArtificials(
int spx_row);
126 void GetSpxInfeasibilityRay(soplex::VectorRational& farkas_ray, std::vector<BoundViolationType>& bounds_ray);
136 std::vector<std::pair<int, soplex::Rational>>
GetActiveRows();
146 std::vector<std::pair<int, soplex::Rational>>
GetActiveRows(
const std::vector<int>& spx_rows);
157 std::optional<soplex::Rational>
IsRowActive(
int spx_row);
Collection of variables with associated intervals.
Predicate abstraction is a method to convert a first-order logic formula into a Boolean formula.
SoPlex is an exact LP solver written in C++.
void Consolidate(const Box &box) override
Consolidate the solver.
void UpdateExplanation(LiteralSet &explanation) override
Use the result from the theory solver to update the explanation with the conflict that has been detec...
bool IsRowActive(int spx_row, const soplex::Rational &value)
Check if the spx_row is active with value value.
void Reset() override
Reset the linear problem.
void SetSPXVarCoeff(soplex::DSVectorRational &coeffs, const Variable &var, const mpq_class &value) const
Set the coefficients to apply to var on a specific row.
static mpq_class infinity_
Positive infinity.
void DisableSpxRows()
Disable all disabled spx rows from the LP solver.
void AddVariable(const Variable &var) override
Add a variable (column) to the theory solver.
static mpq_class ninfinity_
Negative infinity.
virtual void EnableSpxRow(int spx_row, bool truth)=0
Enable the spx_row row for the LP solver.
soplex::LPRowSetRational spx_rows_
Rows of the LP problem.
soplex::LPColSetRational spx_cols_
Columns of the LP problem.
virtual void EnableSpxVarBound()
Set the bounds of the variables in the LP solver.
void AddLiterals() override
Add a vector of literals to the theory solver.
std::vector< std::pair< int, soplex::Rational > > GetActiveRows()
Get all active rows in the current solution.
std::vector< mpq_class > spx_rhs_
Right-hand side of the rows.
void GetSpxInfeasibilityRay(soplex::VectorRational &farkas_ray)
Get the infeasibility ray of the LP problem.
soplex::SoPlex spx_
SoPlex exact LP solver.
void UpdateModelBounds() override
Update each variable in the model with the bounds passed to the theory solver.
std::optional< soplex::Rational > IsRowActive(int spx_row)
Check if the spx_row is active.
void UpdateModelSolution() override
Update the model with the solution obtained from the LP solver.
soplex::DSVectorRational ParseRowCoeff(const Formula &formula)
Parse a formula and return the vector of coefficients to apply to the decisional variables.
std::vector< LpRowSense > spx_sense_
Sense of the rows.
void EnableSpxRow(int spx_row)
Enable the spx_row row for the LP solver.
Base class for theory solvers.
const PredicateAbstractor & predicate_abstractor() const
Get read-only access to the predicate abstractor of the TheorySolver.
Represents a symbolic variable.
Global namespace for the dlinear library.
std::set< Literal > LiteralSet
A set of literals.