20 using namespace cadcells;
39 template<
class Settings>
44 using op =
typename Settings::op;
47 using PropSet =
typename op::PropertiesSet;
58 std::optional<datastructures::CoveringRepresentation<PropSet>>
mCovering;
70 : mDerivations(std::move(other.mDerivations)),
71 mCoveringStatus(other.mCoveringStatus),
72 mCovering(std::move(other.mCovering)),
73 mSamplePoint(other.mSamplePoint) {}
77 mDerivations.insert(derivation);
82 mDerivations.insert(std::move(derivation));
106 if (isFullCovering()) {
114 if (isPartialCovering()) {
118 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Sample " << mSamplePoint <<
" is still outside of the cells");
123 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Sample " << mSamplePoint <<
" not outside of the cells anymore");
132 if (isPartialCovering()) {
137 std::vector<datastructures::SampledDerivationRef<PropSet>> derivationsVector(mDerivations.begin(), mDerivations.end());
139 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Computed Covering: " << mCovering.value());
146 assert(isPartialCovering());
168 return mCoveringStatus;
173 mCovering = std::move(other.mCovering);
174 mDerivations = std::move(other.mDerivations);
175 mCoveringStatus = other.mCoveringStatus;
176 mSamplePoint = other.mSamplePoint;
182 mDerivations = std::move(derivations);
195 assert(
std::find(mDerivations.begin(), mDerivations.end(), derivation) != mDerivations.end());
198 if (mCovering.has_value()) {
199 auto usedDerivations = mCovering.value().sampled_derivations();
200 if (
std::find(usedDerivations.begin(), usedDerivations.end(), derivation) != usedDerivations.end()) {
201 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Derivation to remove was used in the current covering representation");
209 mDerivations.erase(derivation);
214 for (
const auto& derivation : derivations) {
215 removeDerivation(derivation);
224 if (mCovering.has_value()) {
225 auto usedDerivations = mCovering.value().sampled_derivations();
227 return std::find(derivationConstraints.at(deriv).begin(), derivationConstraints.at(deriv).end(), constraint) != derivationConstraints.at(deriv).end();
228 }) != usedDerivations.end()) {
229 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Constraint to remove was used in the current covering representation");
238 for (
auto it = mDerivations.begin(); it != mDerivations.end();) {
239 if (
std::find(derivationConstraints.at(*it).begin(), derivationConstraints.at(*it).end(), constraint) != derivationConstraints.at(*it).end()) {
240 it = mDerivations.erase(it);
255 assert(isFullCovering() && mCovering.has_value());
257 std::vector<cadcells::Constraint> constraints;
258 assert(mCovering.has_value());
259 for (
const auto& derivation : mCovering.value().sampled_derivations()) {
260 assert(mDerivationToConstraint.find(derivation) != mDerivationToConstraint.end());
261 std::vector<cadcells::Constraint> new_constraints = mDerivationToConstraint[derivation];
262 constraints.insert(constraints.end(), new_constraints.begin(), new_constraints.end());
266 std::sort(constraints.begin(), constraints.end());
267 constraints.erase(std::unique(constraints.begin(), constraints.end()), constraints.end());
282 assert(mCovering.has_value());
283 assert(isFullCovering());
285 auto& fullCovering = mCovering.value();
289 auto usedConstraints = getConstraintsOfCovering(mDerivationToConstraint);
290 auto cell_derivs = fullCovering.sampled_derivations();
292 if (!op::project_covering_properties(fullCovering)) {
298 if (!op::project_basic_properties(*new_deriv)) {
303 op::delineate_properties(*new_deriv);
304 new_deriv->delineate_cell();
305 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Found new unsat cell for the higher dimension: " << new_deriv->cell());
309 mDerivationToConstraint.insert(std::make_pair(new_deriv, usedConstraints));
339 template<
typename Settings>
341 os <<
"CoveringStatus: " << levelWiseInformation.
getCoveringStatus() << std::endl;
343 os <<
"SamplePoint: " << levelWiseInformation.
getSampleOutside() << std::endl;
346 os <<
"Derivations: " << levelWiseInformation.
getDerivations() << std::endl;
void sort(T *array, int size, LessThan lt)
static bool find(V &ts, const T &t)
void merge_underlying(std::vector< SampledDerivationRef< Properties >> &derivations)
Merges the underlying derivations of a set of sampled derivations.
std::shared_ptr< SampledDerivation< Properties > > SampledDerivationRef
carl::BasicConstraint< Polynomial > Constraint
Class to create the formulas for axioms.
std::ostream & operator<<(std::ostream &os, CMakeOptionPrinter cmop)
#define SMTRAT_LOG_DEBUG(channel, msg)
#define SMTRAT_TIME_START(variable)
#define SMTRAT_TIME_FINISH(timer, start)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &ders)