SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Algorithm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "types.h"
4 #include "FormulaEvaluation.h"
6 #include "Sampling.h"
9 #include <algorithm>
10 #include <iterator>
12 #include <sstream>
13 
14 #include "CoveringNGStatistics.h"
15 
17 
18 inline carl::Variable first_unassigned_var(const cadcells::Assignment& ass, const cadcells::VariableOrdering& var_order) {
19  for (const auto& var : var_order) {
20  if (ass.find(var) == ass.end()) return var;
21  }
22  assert(false);
23  return carl::Variable();
24 }
25 
26 inline bool is_full_sample(const cadcells::Assignment& ass, const cadcells::VariableOrdering& var_order) {
27  for (const auto& var : var_order) {
28  if (ass.find(var) == ass.end()) return false;
29  }
30  return true;
31 }
32 
33 template<typename op>
34 inline std::optional<Interval<typename op::PropertiesSet>> get_enclosing_interval(cadcells::datastructures::Projections& proj, const boost::container::flat_set<cadcells::datastructures::PolyConstraint>& implicant, const cadcells::Assignment& ass) {
35  SMTRAT_LOG_FUNC("smtrat.covering_ng", implicant << ", " << ass);
36 
37  //std::size_t level = 0;
38  //for (const auto& c : implicant) {
39  // level = std::max(carl::level_of(c.lhs()), level);
40  //}
41  //assert(level > 0 && level == ass.size());
42 
43  auto deriv = cadcells::datastructures::make_derivation<typename op::PropertiesSet>(proj, ass, ass.size()).sampled_ref();
44  for (const auto& c : implicant) {
45  if (carl::is_strict(c.relation)) {
46  deriv->insert(cadcells::operators::properties::poly_sgn_inv{ c.lhs });
47  } else {
49  }
50  }
51  if (!op::project_basic_properties(*deriv)) return std::nullopt;
52  op::delineate_properties(*deriv);
53  deriv->delineate_cell();
54  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got cell " << deriv->cell() << " w.r.t. delineation " << deriv->delin());
55  return deriv;
56 }
57 
58 template<typename op, typename FE>
59 inline std::vector<Interval<typename op::PropertiesSet>> get_enclosing_intervals(cadcells::datastructures::Projections& proj, FE& f, const cadcells::Assignment& ass) {
60  SMTRAT_LOG_FUNC("smtrat.covering_ng", "f, " << ass);
61  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_start());
62  auto implicants = f.compute_implicants();
63  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_end());
64  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got implicants " << implicants);
65  std::vector<Interval<typename op::PropertiesSet>> results;
66  for (const auto& implicant : implicants) {
67  SMTRAT_STATISTICS_CALL(statistics().implicant_used(formula::complexity::features::sum_sum_total_degree(proj, implicant)));
68  auto interval = get_enclosing_interval<op>(proj, implicant, ass);
69  if (interval) results.emplace_back(*interval);
70  }
71  SMTRAT_STATISTICS_CALL(statistics().intervals_found(results.size()));
72  return results;
73 }
74 
75 template<typename op, cadcells::representation::CoveringHeuristic covering_heuristic>
76 inline std::optional<std::pair<Interval<typename op::PropertiesSet>, cadcells::datastructures::CoveringRepresentation<typename op::PropertiesSet>>> characterize_covering(const IntervalSet<typename op::PropertiesSet>& intervals) {
77  SMTRAT_LOG_FUNC("smtrat.covering_ng", intervals);
78  std::vector<Interval<typename op::PropertiesSet>> derivations(intervals.begin(), intervals.end());
79  auto representation = cadcells::representation::covering<covering_heuristic>::compute(derivations);
80  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got representation " << representation);
81  SMTRAT_STATISTICS_CALL(statistics().intervals_used(representation.sampled_derivations().size()));
82  auto cell_derivs = representation.sampled_derivations();
84  if (!op::project_covering_properties(representation)) return std::nullopt;
85  Interval<typename op::PropertiesSet> new_deriv = cell_derivs.front()->underlying().sampled_ref();
86  if (!op::project_basic_properties(*new_deriv)) return std::nullopt;
87  op::delineate_properties(*new_deriv);
88  new_deriv->delineate_cell();
89  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got interval " << new_deriv->cell());
90  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Polynomials: " << new_deriv->polys());
91  SMTRAT_STATISTICS_CALL(statistics().intervals_found(1));
92  return std::make_pair(new_deriv, representation);
93 }
94 
95 template<typename op, cadcells::representation::CellHeuristic cell_heuristic>
96 inline std::optional<std::pair<Interval<typename op::PropertiesSet>, cadcells::datastructures::CellRepresentation<typename op::PropertiesSet>>> characterize_interval(Interval<typename op::PropertiesSet>& interval) {
97  SMTRAT_LOG_FUNC("smtrat.covering_ng", interval->cell());
98  SMTRAT_STATISTICS_CALL(statistics().intervals_used(1));
99  interval->insert(cadcells::operators::properties::cell_connected{ interval->level() }); // TODO is this the proper way?
100  auto representation = cadcells::representation::cell<cell_heuristic>::compute(interval);
101  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got representation " << representation);
102  assert((interval->level() > 1));
103  if (!op::project_cell_properties(representation)) return std::nullopt;
104  Interval<typename op::PropertiesSet> new_deriv = interval->underlying().sampled_ref();
105  if (!op::project_basic_properties(*new_deriv)) return std::nullopt;
106  op::delineate_properties(*new_deriv);
107  new_deriv->delineate_cell();
108  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got interval " << new_deriv->cell());
109  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Polynomials: " << new_deriv->polys());
110  SMTRAT_STATISTICS_CALL(statistics().intervals_found(1));
111  return std::make_pair(new_deriv, representation);
112 }
113 
114 // TODO later: close cell if possible based on flag - implement here or in smtrat-cadcells?
115 // TODO later: optionally clear caches
116 
117 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
118 inline CoveringResult<typename op::PropertiesSet> exists(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment ass, const VariableQuantification& quantification, bool characterize_sat, bool characterize_unsat);
119 
120 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
121 inline CoveringResult<typename op::PropertiesSet> forall(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment ass, const VariableQuantification& quantification, bool characterize_sat, bool characterize_unsat);
122 
123 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
124 inline CoveringResult<typename op::PropertiesSet> recurse(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment& ass, const VariableQuantification& quantification, bool characterize_sat = false, bool characterize_unsat = false) {
125  SMTRAT_LOG_FUNC("smtrat.covering_ng", "f, " << ass);
126 
127  const auto variable = first_unassigned_var(ass, proj.polys().var_order());
128  const auto quantificationType = quantification.var_type(variable);
129 
130  if (quantificationType == carl::Quantifier::EXISTS || quantificationType == carl::Quantifier::FREE) {
131  return exists<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification, characterize_sat, characterize_unsat);
132  } else {
133  assert(quantificationType == carl::Quantifier::FORALL);
134  return forall<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification, characterize_sat, characterize_unsat);
135  }
136 }
137 
138 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
139 inline CoveringResult<typename op::PropertiesSet> exists(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment ass, const VariableQuantification& quantification, bool characterize_sat, bool characterize_unsat) {
140  SMTRAT_LOG_FUNC("smtrat.covering_ng", "f, " << ass);
141  //assert(f.root_valuation() != formula::Valuation::FALSE);
143  auto variable = first_unassigned_var(ass, proj.polys().var_order());
144  std::optional<cadcells::RAN> sample;
145  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Current Var: " << variable << " of level: " << ass.size() << "/" << proj.polys().var_order().size());
146  while (sample = sampling<sampling_algorithm>::template sample_outside<FE, typename op::PropertiesSet>(unsat_intervals, f), sample != std::nullopt) {
147  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got sample " << variable << " = " << sample);
148  ass.emplace(variable, sample.value());
149  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_start());
150  f.extend_valuation(ass);
151  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_end());
152  assert(f.root_valuation() != formula::Valuation::UNKNOWN);
153  if (is_full_sample(ass, proj.polys().var_order()) && f.root_valuation() == formula::Valuation::MULTIVARIATE) {
154  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete propagation");
156  }
157  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got evaluation: " << f.root_valuation());
159  if (f.root_valuation() == formula::Valuation::FALSE || f.root_valuation() == formula::Valuation::TRUE) {
160  auto new_intervals = get_enclosing_intervals<op, FE>(proj, f, ass);
161  if (new_intervals.size() > 0) {
163  } else {
164  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete projection");
166  }
167  } else {
168  assert(f.root_valuation() == formula::Valuation::MULTIVARIATE);
169  assert(!is_full_sample(ass, proj.polys().var_order()));
170  res = recurse<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification, characterize_sat, true);
171  }
172  std::optional<cadcells::Assignment> sat_sample;
173  if (quantification.var_type(variable) == carl::Quantifier::FREE && res.is_sat()) {
174  if (!res.sample()) {
175  sat_sample = ass;
176  } else {
177  sat_sample = *res.sample();
178  }
179  }
180  ass.erase(variable);
181  f.revert_valuation(ass);
182  if (res.is_failed()) {
184  } else if (res.is_sat()) {
185  if (ass.empty() || !characterize_sat) {
186  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Skip computation of characterization.");
188  }
189  std::vector<Interval<typename op::PropertiesSet>> new_intervals;
190  assert(!res.intervals().empty());
191  for (auto interval : res.intervals()) {
192  auto new_interval = characterize_interval<op, cell_heuristic>(interval);
193  if (new_interval) {
194  new_intervals.push_back(new_interval->first);
195  } else {
196  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Failed due to incomplete projection");
198  }
199  }
200  return CoveringResult<typename op::PropertiesSet>(Status::SAT, sat_sample, new_intervals);
201  } else {
202  assert(res.is_unsat());
203  assert(!res.intervals().empty());
204  unsat_intervals.insert(res.intervals().begin(), res.intervals().end());
205  }
206  } // end while
207  if (ass.empty() || !characterize_unsat) {
208  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Skip computation of characterization.");
210  } else {
211  auto new_interval = characterize_covering<op, covering_heuristic>(unsat_intervals);
212  if (new_interval) {
213  return CoveringResult<typename op::PropertiesSet>(Status::UNSAT, ass, std::vector({new_interval->first}));
214  } else {
215  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Failed due to incomplete projection");
217  }
218  }
219 }
220 
221 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
222 inline CoveringResult<typename op::PropertiesSet> forall(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment ass, const VariableQuantification& quantification, bool characterize_sat, bool characterize_unsat) {
223  SMTRAT_LOG_FUNC("smtrat.covering_ng", "f, " << ass);
224  //assert(f.root_valuation() != formula::Valuation::FALSE);
226  auto variable = first_unassigned_var(ass, proj.polys().var_order());
227  std::optional<cadcells::RAN> sample;
228  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Current Assignment: " << ass);
229  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Current Var: " << variable << " of level: " << ass.size() << "/" << proj.polys().var_order().size());
230  while (sample = sampling<sampling_algorithm>::template sample_outside<FE, typename op::PropertiesSet>(sat_intervals, f), sample != std::nullopt) {
231  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got sample: " << variable << " = " << sample);
232  ass.emplace(variable, sample.value());
233  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_start());
234  f.extend_valuation(ass);
235  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_end());
236  assert(f.root_valuation() != formula::Valuation::UNKNOWN);
237  if (is_full_sample(ass, proj.polys().var_order()) && f.root_valuation() == formula::Valuation::MULTIVARIATE) {
238  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete propagation");
240  }
241  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got evaluation: " << f.root_valuation());
243  if (f.root_valuation() == formula::Valuation::FALSE || f.root_valuation() == formula::Valuation::TRUE) {
244  auto new_intervals = get_enclosing_intervals<op, FE>(proj, f, ass);
245  if (new_intervals.size() > 0) {
247  } else {
248  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete projection");
250  }
251  } else {
252  assert(f.root_valuation() == formula::Valuation::MULTIVARIATE);
253  assert(!is_full_sample(ass, proj.polys().var_order()));
254  res = recurse<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification, true, characterize_unsat);
255  }
256  ass.erase(variable);
257  f.revert_valuation(ass);
258  if (res.is_failed()) {
260  } else if (res.is_unsat()) {
261  if (ass.empty() || !characterize_unsat) {
262  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Skip computation of characterization.");
264  }
265  std::vector<Interval<typename op::PropertiesSet>> new_intervals;
266  assert(!res.intervals().empty());
267  for (auto interval : res.intervals()) {
268  auto new_interval = characterize_interval<op, cell_heuristic>(interval) ;
269  if (new_interval) {
270  new_intervals.push_back(new_interval->first);
271  } else {
272  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Failed due to incomplete projection");
274  }
275  }
277  } else {
278  assert(res.is_sat());
279  assert(!res.intervals().empty());
280  sat_intervals.insert(res.intervals().begin(), res.intervals().end());
281  }
282  } // end while
283  if (ass.empty() ||!characterize_sat) {
284  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Skip computation of characterization.");
286  } else {
287  auto new_interval = characterize_covering<op, covering_heuristic>(sat_intervals);
288  if (new_interval) {
289  return CoveringResult<typename op::PropertiesSet>(Status::SAT, {new_interval->first});
290  } else {
291  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Failed due to incomplete projection");
293  }
294  }
295 }
296 
297 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
298 inline std::pair<CoveringResult<typename op::PropertiesSet>, std::vector<ParameterTree>> parameter(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment ass, const VariableQuantification& quantification) {
299  SMTRAT_LOG_FUNC("smtrat.covering_ng", "f, " << ass);
300  assert(f.root_valuation() != formula::Valuation::FALSE);
302  boost::container::flat_map<Interval<typename op::PropertiesSet>, std::vector<ParameterTree>> interval_data;
303  carl::Variable variable = first_unassigned_var(ass, proj.polys().var_order());
304  std::optional<cadcells::RAN> sample;
305  while (sample = sampling<sampling_algorithm>::template sample_outside<FE, typename op::PropertiesSet>(intervals, f), sample != std::nullopt) {
306  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got sample " << variable << " = " << sample);
307  ass.emplace(variable, *sample);
308  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_start());
309  f.extend_valuation(ass);
310  SMTRAT_STATISTICS_CALL(statistics().formula_evaluation_end());
311  assert(f.root_valuation() != formula::Valuation::UNKNOWN);
312  if (is_full_sample(ass, proj.polys().var_order()) && f.root_valuation() == formula::Valuation::MULTIVARIATE) {
313  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete propagation");
314  return std::make_pair(CoveringResult<typename op::PropertiesSet>(), std::vector<ParameterTree>());
315  }
316  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got evaluation: " << f.root_valuation());
318  if (f.root_valuation() == formula::Valuation::FALSE) {
319  auto new_intervals = get_enclosing_intervals<op, FE>(proj, f, ass);
320  for (const auto& i : new_intervals) {
321  interval_data.emplace(i, std::vector<ParameterTree>({ParameterTree(false)}));
322  }
323  if (new_intervals.size() > 0) {
325  } else {
326  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete projection");
328  }
329  } else if (f.root_valuation() == formula::Valuation::TRUE) {
330  auto new_intervals = get_enclosing_intervals<op, FE>(proj, f, ass);
331  for (const auto& i : new_intervals) {
332  interval_data.emplace(i, std::vector<ParameterTree>({ParameterTree(true)}));
333  }
334  if (new_intervals.size() > 0) {
336  } else {
337  SMTRAT_LOG_DEBUG("smtrat.covering_ng", "Failed due to incomplete projection");
339  }
340  // Check if next variable is free or quantified -> Call parameter or recurse
341  } else if (quantification.var_type(first_unassigned_var(ass, proj.polys().var_order())) == carl::Quantifier::FREE) {
342  assert(f.root_valuation() == formula::Valuation::MULTIVARIATE);
343  assert(!is_full_sample(ass, proj.polys().var_order()));
344  std::vector<ParameterTree> higher_tree;
345  std::tie(res, higher_tree) = parameter<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification);
346  for (const auto& i : res.intervals()) {
347  interval_data.emplace(i, higher_tree);
348  }
349  } else {
350  res = recurse<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification, true, true);
351  if (res.is_sat()) {
352  for (const auto& i : res.intervals()) {
353  interval_data.emplace(i, std::vector<ParameterTree>({ParameterTree(true)}));
354  }
355  } else {
356  for (const auto& i : res.intervals()) {
357  interval_data.emplace(i, std::vector<ParameterTree>({ParameterTree(false)}));
358  }
359  }
360  }
361  ass.erase(variable);
362  f.revert_valuation(ass);
363  if (res.is_failed()) {
364  return std::make_pair(CoveringResult<typename op::PropertiesSet>(res.status), std::vector<ParameterTree>());
365  } else {
366  assert(!res.intervals().empty());
367  intervals.insert(res.intervals().begin(), res.intervals().end());
368  }
369  } // end while
370  if (ass.empty()) {
371  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Skip computation of characterization.");
372  std::vector<Interval<typename op::PropertiesSet>> derivations(intervals.begin(), intervals.end());
373  auto representation = cadcells::representation::covering<covering_heuristic>::compute(derivations);
374  SMTRAT_LOG_TRACE("smtrat.covering_ng", "Got representation " << representation);
375  std::vector<ParameterTree> tree;
376  for (const auto& cell : representation.cells) {
377  tree.emplace_back(variable, cell.description, cell.derivation->sample(), std::move(interval_data[cell.derivation]));
378  }
380  } else {
381  auto new_interval = characterize_covering<op, covering_heuristic>(intervals);
382  if (new_interval) {
383  std::vector<ParameterTree> tree;
384  for (const auto& cell : new_interval->second.cells) {
385  tree.emplace_back(variable, cell.description, cell.derivation->sample(), std::move(interval_data[cell.derivation]));
386  }
387  std::vector<Interval<typename op::PropertiesSet>> new_intervals({new_interval->first});
388  return std::make_pair(CoveringResult<typename op::PropertiesSet>(Status::PARAMETER, new_intervals), tree);
389  } else {
390  SMTRAT_LOG_INFO("smtrat.covering_ng", "Failed due to incomplete projection");
391  return std::make_pair(CoveringResult<typename op::PropertiesSet>(Status::FAILED_PROJECTION), std::vector<ParameterTree>());
392  }
393  }
394 }
395 
396 template<typename op, typename FE, cadcells::representation::CoveringHeuristic covering_heuristic, smtrat::covering_ng::SamplingAlgorithm sampling_algorithm, smtrat::cadcells::representation::CellHeuristic cell_heuristic>
397 inline std::pair<CoveringResult<typename op::PropertiesSet>, ParameterTree> recurse_qe(cadcells::datastructures::Projections& proj, FE& f, cadcells::Assignment ass, const VariableQuantification& quantification) {
398  if (quantification.var_type(proj.polys().var_order().front()) == carl::Quantifier::FREE) {
399  auto [res, tree] = parameter<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification);
400  return std::make_pair(res, ParameterTree(std::move(tree)));
401  } else {
402  auto res = recurse<op, FE, covering_heuristic, sampling_algorithm, cell_heuristic>(proj, f, ass, quantification);
403  if (res.is_sat()) {
404  return std::make_pair(res, ParameterTree(true));
405  } else if (res.is_unsat()) {
406  return std::make_pair(res, ParameterTree(false));
407  } else {
408  return std::make_pair(res, ParameterTree());
409  }
410  }
411 }
412 
413 } // namespace smtrat::covering_ng
Encapsulates all computations on polynomials.
Definition: projections.h:46
carl::Quantifier var_type(const carl::Variable &var) const
Returns the type of the given variable.
Definition: types.h:165
int var(Lit p)
Definition: SolverTypes.h:64
void merge_underlying(std::vector< SampledDerivationRef< Properties >> &derivations)
Merges the underlying derivations of a set of sampled derivations.
Definition: derivation.h:408
std::vector< carl::Variable > VariableOrdering
Definition: common.h:11
carl::Assignment< RAN > Assignment
Definition: common.h:25
auto sum_sum_total_degree(cadcells::datastructures::Projections &proj, const boost::container::flat_set< cadcells::datastructures::PolyConstraint > &a)
std::pair< CoveringResult< typename op::PropertiesSet >, std::vector< ParameterTree > > parameter(cadcells::datastructures::Projections &proj, FE &f, cadcells::Assignment ass, const VariableQuantification &quantification)
Definition: Algorithm.h:298
std::set< Interval< PropertiesSet >, IntervalCompare< PropertiesSet > > IntervalSet
Definition: types.h:32
carl::Variable first_unassigned_var(const cadcells::Assignment &ass, const cadcells::VariableOrdering &var_order)
Definition: Algorithm.h:18
CoveringResult< typename op::PropertiesSet > forall(cadcells::datastructures::Projections &proj, FE &f, cadcells::Assignment ass, const VariableQuantification &quantification, bool characterize_sat, bool characterize_unsat)
Definition: Algorithm.h:222
bool is_full_sample(const cadcells::Assignment &ass, const cadcells::VariableOrdering &var_order)
Definition: Algorithm.h:26
std::optional< std::pair< Interval< typename op::PropertiesSet >, cadcells::datastructures::CoveringRepresentation< typename op::PropertiesSet > > > characterize_covering(const IntervalSet< typename op::PropertiesSet > &intervals)
Definition: Algorithm.h:76
std::vector< Interval< typename op::PropertiesSet > > get_enclosing_intervals(cadcells::datastructures::Projections &proj, FE &f, const cadcells::Assignment &ass)
Definition: Algorithm.h:59
std::optional< std::pair< Interval< typename op::PropertiesSet >, cadcells::datastructures::CellRepresentation< typename op::PropertiesSet > > > characterize_interval(Interval< typename op::PropertiesSet > &interval)
Definition: Algorithm.h:96
std::optional< Interval< typename op::PropertiesSet > > get_enclosing_interval(cadcells::datastructures::Projections &proj, const boost::container::flat_set< cadcells::datastructures::PolyConstraint > &implicant, const cadcells::Assignment &ass)
Definition: Algorithm.h:34
CoveringResult< typename op::PropertiesSet > recurse(cadcells::datastructures::Projections &proj, FE &f, cadcells::Assignment &ass, const VariableQuantification &quantification, bool characterize_sat=false, bool characterize_unsat=false)
Definition: Algorithm.h:124
cadcells::datastructures::SampledDerivationRef< PropertiesSet > Interval
Definition: types.h:19
std::pair< CoveringResult< typename op::PropertiesSet >, ParameterTree > recurse_qe(cadcells::datastructures::Projections &proj, FE &f, cadcells::Assignment ass, const VariableQuantification &quantification)
Definition: Algorithm.h:397
CoveringResult< typename op::PropertiesSet > exists(cadcells::datastructures::Projections &proj, FE &f, cadcells::Assignment ass, const VariableQuantification &quantification, bool characterize_sat, bool characterize_unsat)
Definition: Algorithm.h:139
#define SMTRAT_LOG_TRACE(channel, msg)
Definition: logging.h:36
#define SMTRAT_LOG_INFO(channel, msg)
Definition: logging.h:34
#define SMTRAT_LOG_FUNC(channel, args)
Definition: logging.h:38
#define SMTRAT_LOG_DEBUG(channel, msg)
Definition: logging.h:35
#define SMTRAT_STATISTICS_CALL(function)
Definition: Statistics.h:23
static datastructures::CellRepresentation< T > compute(datastructures::SampledDerivationRef< T > &der)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &ders)
const auto & sample() const
Definition: types.h:68
const auto & intervals() const
Definition: types.h:71