dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
ReluConstraint.h
1
7#pragma once
8
9#include <optional>
10
11#include "dlinear/solver/PiecewiseLinearConstraint.h"
12#include "dlinear/symbolic/PredicateAbstractor.h"
13#include "dlinear/symbolic/symbolic.h"
14
15namespace dlinear {
16
30 public:
31 static const mpq_class zero;
32
44 ReluConstraint(const Variable& relu_var, const Expression& e, const PredicateAbstractor& pa);
59
60 void UpdateUpperBound(const mpq_class* upper_bound) override;
61 void UpdateLowerBound(const mpq_class* lower_bound) override;
62
63 void EnableLiteral(const Variable& var);
64
65 std::set<LiteralSet> TightenBounds(BoundPreprocessor& preprocessor) override;
66
67 [[nodiscard]] LiteralSet Assumptions() const override;
68
69 [[nodiscard]] LiteralSet LearnedClauses() const override;
70
71 std::ostream& Print(std::ostream& os) const override;
72};
73
74} // namespace dlinear
This class uses some basic algebraic operations to preprocess the constraints and identify violations...
A piecewise linear constraint is a constraint that assumes different linear functions depending on th...
const Variable & inactive_var() const
Get read-only access to the boolean variable associated with the theory literal of the constraint.
const Variable & active_var() const
Get read-only access to the boolean variable associated with the theory literal of the constraint.
const Expression & active_soi() const
Get read-only access to the expression of the constraint.
const mpq_class & lower_bound() const
Get read-only access to the lower bound of the constraint.
const mpq_class & upper_bound() const
Get read-only access to the upper bound of the constraint.
Predicate abstraction is a method to convert a first-order logic formula into a Boolean formula.
A ReLU constraint is a kind of piecewise linear constraint.
ReluConstraint(const Variable &relu_var, const Expression &e, const PredicateAbstractor &pa)
Construct a new Relu Constraint object.
void UpdateUpperBound(const mpq_class *upper_bound) override
Update the upper bounds of the constraint.
LiteralSet Assumptions() const override
The assumptions used to guide the SAT solver towards the most promising sub-problems.
LiteralSet LearnedClauses() const override
Produce some learned clauses the SAT solver will use to prune the sub-problems this piecewise constra...
std::ostream & Print(std::ostream &os) const override
Print the constraint on the standard output.
std::set< LiteralSet > TightenBounds(BoundPreprocessor &preprocessor) override
Use the preprocessor to tighten the bounds of the constraint and hopefully fix its state to either ac...
void UpdateLowerBound(const mpq_class *lower_bound) override
Update the lower bounds of the constraint.
static const mpq_class zero
Zero constant all the pointers to the default lower bound will point to.
Represents a symbolic form of an expression.
Represents a symbolic variable.
Global namespace for the dlinear library.
std::set< Literal > LiteralSet
A set of literals.
Definition literal.h:28