11#include <unordered_set>
13#include "dlinear/solver/PiecewiseLinearConstraint.h"
14#include "dlinear/solver/SoplexTheorySolver.h"
15#include "dlinear/symbolic/literal.h"
16#include "dlinear/symbolic/symbolic.h"
32 const std::string &class_name =
"NNSoplexTheorySolver");
34 void SetPiecewiseLinearConstraints(
const std::vector<std::unique_ptr<PiecewiseLinearConstraint>> &relu_constraints);
39 void Reset()
override;
42 enum class SpxCheckSatResult {
54 SpxCheckSatResult SpxCheckSat(mpq_class *actual_precision);
60 void UpdateExplanationsWithCurrentPiecewiseLinearLiterals(std::set<LiteralSet> &explanations);
68 std::unordered_map<Variable, const PiecewiseLinearConstraint *> pl_theory_lit_;
69 std::vector<PlConstraint> enabled_pl_constraints_;
Collection of variables with associated intervals.
Specialised theory solver for neural networks using SoPlex.
void Reset() override
Reset the linear problem.
void EnableSpxRow(int spx_row, bool truth) override
Enable the spx_row row for the LP solver.
void Consolidate(const Box &box) override
Consolidate the solver.
void SoiToObjFunction()
Convert the soi_ expression to an objective function inside soplex.
void AddLiteral(const Variable &formula_var, const Formula &formula) override
Add a Literal to the theory solver.
Explanations EnableLiteral(const Literal &lit) override
Activate the literal that had previously been added to the theory solver.
bool InvertGreatestViolation()
Invert the greatest violation found in the objective function.
SatResult CheckSatCore(mpq_class *actual_precision, std::set< LiteralSet > &explanations) override
Check the satisfiability of the theory.
A piecewise linear constraint is a constraint that assumes different linear functions depending on th...
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 form of an expression.
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.
@ SAT
The problem is satisfiable.
@ INFEASIBLE
The problem is infeasible.
A literal is a variable with an associated truth value, indicating whether it is true or false.