12#ifndef DLINEAR_ENABLED_SOPLEX
13#error SoPlex is not enabled. Please enable it by adding "--//tools:enable_soplex" to the bazel command.
22#include "dlinear/libs/libgmp.h"
23#include "dlinear/solver/SatResult.h"
24#include "dlinear/solver/SoplexTheorySolver.h"
25#include "dlinear/symbolic/PredicateAbstractor.h"
26#include "dlinear/symbolic/literal.h"
27#include "dlinear/util/BitIncrementIterator.h"
28#include "dlinear/util/Box.h"
42 const std::string& class_name =
"CompleteSoplexTheorySolver");
52 void Reset()
override;
112 void EnableNqLiterals(
const std::vector<bool>& nq_status,
bool force =
false);
BitIncrementIterator class.
Collection of variables with associated intervals.
Complete solver using SoPlex.
bool UpdateBitIncrementIteratorBasedOnExplanation(BitIncrementIterator &bit_iterator)
Update the BitIncrementIterator bit_iterator based on the current explanation.
Explanations EnableLiteral(const Literal &lit) override
Activate the literal that had previously been added to the theory solver.
std::set< std::pair< std::size_t, bool > > single_nq_rows_
Set of non-equal rows that appear alone in the explanation, with the current assignment.
void DisableNqLiterals(const std::set< std::size_t > &nq_constraints)
Disable the non-equal constraints in the given set.
void UpdateExplanationInfeasible()
Update the explanation with the infeasible core.
void Reset() override
Reset the linear problem.
void Consolidate(const Box &box) override
Consolidate the solver.
static const mpq_class strict_col_lb_
Zero. Used for the strict variable lower bound.
std::vector< int > nq_row_to_theory_rows_
Index of row with a non-equal-to constraint in the order they appear mapped to the corresponding spx_...
SatResult SpxCheckSat()
Internal method to check the satisfiability of the current LP problem.
bool locked_solver_
Flag to indicate if the solver is locked. A locked solver will always return UNSAT.
void EnableNqLiteral(int spx_row, bool truth)
Enable the non-equal constraint at row spx_row based on the given truth.
std::set< int > last_theory_rows_to_explanation_
Last set of theory rows that are part of the explanation.
void EnableSpxVarBound() override
Set the bounds of the variables in the LP solver.
void AddLiteral(const Variable &formula_var, const Formula &formula) override
Add a Literal to the theory solver.
void EnableNqLiterals(const std::vector< bool > &nq_status, bool force=false)
Enable the non-equal constraints based on the current iterator value nq_status.
void EnableSpxRow(int spx_row, bool truth) override
Enable the spx_row row for the LP solver.
void UpdateExplanationStrictInfeasible()
Update the explanation with the current LP solution.
void GetExplanation(Explanations &explanations)
Add a new explanation to explanations from theory_rows_to_explanations_.
std::vector< bool > last_nq_status_
Last status of the non-equal constraints.
std::set< std::size_t > IteratorNqRowsInLastExplanation() const
Find the non-equal rows in the current explanation.
std::set< std::set< int > > theory_rows_to_explanations_
Set that contains all the explanation the solver produced.
void AddVariable(const Variable &var) override
Add a variable (column) to the theory solver.
std::map< std::set< std::size_t >, NqExplanation > nq_explanations_
Map of non-equal explanations.
static const mpq_class strict_col_ub_
One. Used for the strict variable upper bound.
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++.
const PredicateAbstractor & predicate_abstractor() const
Get read-only access to the predicate abstractor of the TheorySolver.
std::set< LiteralSet > Explanations
Set of explanations of the conflict.
Represents a symbolic variable.
Global namespace for the dlinear library.
SatResult
Result of running the theory solver over the literals decided by the SAT solver.
Structure used to store the infeasibility explanation of a subset of non-equal constraints.
std::set< int > explanation
Indexes of a subset of non-equal constraints that are part of the explanation.
std::vector< bool > visited
Configuration of the non-equal constraints that have been visited.
A literal is a variable with an associated truth value, indicating whether it is true or false.