dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
BoundImplicator.h
1
14#pragma once
15
16#include <compare>
17#include <functional>
18#include <map>
19
20#include "dlinear/libs/libgmp.h"
21#include "dlinear/solver/LpRowSense.h"
22#include "dlinear/symbolic/PredicateAbstractor.h"
23#include "dlinear/symbolic/literal.h"
24#include "dlinear/symbolic/symbolic.h"
25#include "dlinear/util/Config.h"
26#include "dlinear/util/SortedVector.hpp"
27
28namespace dlinear {
29
38 public:
45 BoundImplicator(const Config& config, std::function<void(const Formula&)> assert,
46 const PredicateAbstractor& predicate_abstractor);
47
49 void Propagate();
50
51 private:
53 struct Constraint {
54 mpq_class value;
57
58 std::strong_ordering operator<=>(const Constraint& o) const;
59 bool operator==(const Constraint& o) const;
60 };
61
69 template <int NVariables>
70 void AddAssertion(const Formula& assertion);
71
76
77 const Config& config_;
78 const std::function<void(const Formula&)> assert_;
80 std::map<Variable, SortedVector<Constraint>> constraints_;
81};
82
83} // namespace dlinear
Use theory reasoning to add relations between literals using some simple theory inferences.
void PropagateAssertions()
Propagate the sorted constraints by adding them to the context by calling the assert_ function.
const PredicateAbstractor & predicate_abstractor_
Predicate abstractor.
void Propagate()
Use theory reasoning to propagate some simple theory inferences.
std::map< Variable, SortedVector< Constraint > > constraints_
Map of constraints for each variable.
BoundImplicator(const Config &config, std::function< void(const Formula &)> assert, const PredicateAbstractor &predicate_abstractor)
Construct a BoundImplicator.
const Config & config_
Configuration.
void AddAssertion(const Formula &assertion)
Add an assertion to the constraints_ map.
const std::function< void(const Formula &)> assert_
Assertion function. It adds assertions to the context.
Simple dataclass used to store the configuration of the program.
Definition Config.h:38
Predicate abstraction is a method to convert a first-order logic formula into a Boolean formula.
Represents a symbolic form of a first-order logic formula.
Represents a symbolic variable.
Global namespace for the dlinear library.
LpRowSense
Sense of a linear programming row describing a constraint.
Definition LpRowSense.h:23
mpq_class value
Value of the constraint.
LpRowSense row_sense
Type of the constraint (e.g. <=, <, =, >, >=)
const Variable * variable
Boolean variable encoding the constraint.