5 #include <carl-covering/carl-covering.h>
19 template<
typename Settings>
22 template<CoreHeuristic CH>
34 std::size_t
idPL(std::size_t level)
const {
35 assert(level > 0 && level <=
dim());
36 return dim() - level + 1;
38 std::size_t
idLP(std::size_t level)
const {
39 assert(level > 0 && level <=
dim());
40 return dim() - level + 1;
57 if (Settings::debugStepsToTikz) {
63 if (Settings::debugStepsToTikz) {
68 std::size_t
dim()
const {
92 void reset(
const std::vector<carl::Variable>&
vars) {
112 template<
typename Constra
intIt>
114 std::size_t cid = constraint.second;
115 SMTRAT_LOG_TRACE(
"smtrat.cad.lifting",
"Evaluating " << cid <<
" / " << constraint.first <<
" on " << assignment);
120 auto evalResult =
carl::evaluate(constraint.first.constr(), assignment);
121 assert(!indeterminate(evalResult));
122 SMTRAT_LOG_TRACE(
"smtrat.cad.lifting",
"Evaluating " << constraint.first <<
" on " << assignment <<
" -> " << (
bool)evalResult);
125 return (
bool)evalResult;
129 std::vector<Assignment> res;
132 auto it =
mLifting.getNextFullSample();
133 auto m =
mLifting.extractSampleMap(it);
135 assert(m.size() == it.depth());
155 auto it =
mLifting.getNextFullSample();
156 auto m =
mLifting.extractSampleMap(it);
158 assert(m.size() == it.depth());
175 template<
typename Iterator>
177 SMTRAT_LOG_DEBUG(
"smtrat.cad.lifting",
"Checking partial sample " << *it <<
" against level " << level);
179 if (it->hasConflictWithConstraint()) {
185 auto a =
mLifting.extractSampleMap(it);
207 generator(*
this, mis);
214 for (
auto it =
mLifting.getTree().begin_preorder(); it !=
mLifting.getTree().end_preorder();) {
215 if (it->hasConflictWithConstraint()) {
225 SMTRAT_LOG_TRACE(
"smtrat.cad.mis",
"Invalid constraint: " <<
id <<
", cur graph:" << std::endl << cg);
235 carl::covering::TypedSetCover<ConstraintT> cover;
238 for (
auto it =
mLifting.getTree().begin_preorder(); it !=
mLifting.getTree().end_preorder();) {
239 auto constraints = it->getConflictingConstraints();
240 if (constraints.any()) {
241 auto sid = idpool.get();
242 for (
auto cid: constraints) {
std::size_t add(const ConstraintT &c)
bool valid(std::size_t id) const
const auto & indexed() const
const auto & ordered() const
carl::Bitset remove(const ConstraintT &c)
Removes a constraint.
void reset(const std::vector< carl::Variable > &vars)
const auto & bounds() const
bool checkForTrivialConflict(std::vector< FormulaSetT > &mis) const
std::size_t level(std::size_t id) const
ConflictGraph generateConflictGraph() const
void reset(const std::vector< carl::Variable > &vars)
CADConstraints< Settings::backtracking > mConstraints
const auto & getConstraintMap() const
LiftingTree< Settings > mLifting
bool isIdValid(std::size_t id) const
bool evaluateSample(Sample &sample, const ConstraintIt &constraint, Assignment &assignment) const
const auto & getVariables() const
void addConstraint(const ConstraintT &c)
auto generateCovering() const
const auto & getBounds() const
Answer check(Assignment &assignment, std::vector< FormulaSetT > &mis)
const auto & getProjection() const
void removeConstraint(const ConstraintT &c)
std::size_t idPL(std::size_t level) const
Answer checkFullSamples(Assignment &assignment)
const auto & getConstraints() const
std::vector< Assignment > enumerateSolutions()
ProjectionT< Settings > mProjection
const auto & getLifting() const
debug::TikzHistoryPrinter thp
Answer checkPartialSample(Iterator &it, std::size_t level)
std::vector< carl::Variable > mVariables
std::size_t idLP(std::size_t level) const
Representation of a bipartite graph (C+S, E) of vertices C and S, representing the constraints and sa...
void addSample(const Sample &sample)
std::size_t coveredSamples(std::size_t id) const
const carl::Bitset & evaluatedWith() const
const carl::Bitset & evaluationResult() const
void configure(const std::string &name)
void writeTo(const std::string &filename) const
Poly normalize(const Poly &p)
Normalizes the given Poly by removing constant and duplicate factors.
carl::UnivariatePolynomial< Poly > UPoly
std::map< carl::Variable, RAN > Assignment
carl::Bitset SampleLiftedWith
Rational evaluate(carl::Variable v, const Poly &p, const Rational &r)
PositionIteratorType Iterator
std::vector< carl::Variable > vars(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Class to create the formulas for axioms.
const settings::Settings & Settings()
Answer
An enum with the possible answers a Module can give.
carl::Constraint< Poly > ConstraintT
#define SMTRAT_LOG_TRACE(channel, msg)
#define SMTRAT_LOG_INFO(channel, msg)
#define SMTRAT_LOG_DEBUG(channel, msg)