24 #ifndef PPL_Pointset_Powerset_templates_hh
25 #define PPL_Pointset_Powerset_templates_hh 1
42 template <
typename PSET>
48 s <<
"PPL::Pointset_Powerset<PSET>::add_disjunct(ph):\n"
50 <<
"ph.space_dimension() == " << ph.space_dimension() <<
".";
51 throw std::invalid_argument(s.str());
55 PPL_ASSERT_HEAVY(x.
OK());
59 template <
typename QH>
63 :
Base(), space_dim(y.space_dimension()) {
66 y_end = y.
end(); i != y_end; ++i) {
82 PPL_ASSERT_HEAVY(x.
OK());
85 template <
typename PSET>
86 template <
typename QH>
90 :
Base(), space_dim(y.space_dimension()) {
93 y_end = y.
end(); i != y_end; ++i) {
100 PPL_ASSERT_HEAVY(x.
OK());
103 template <
typename PSET>
112 y_begin = y.
begin(), y_end = y.
end(); xi != x_end; ) {
121 && (xi != x_end) && (y_begin != y_end)) {
123 PSET x_ph = xi->pointset();
124 for (++xi; xi != x_end; ++xi) {
125 x_ph.upper_bound_assign(xi->pointset());
128 PSET y_ph = yi->pointset();
129 for (++yi; yi != y_end; ++yi) {
130 y_ph.upper_bound_assign(yi->pointset());
132 x_ph.concatenate_assign(y_ph);
135 PPL_ASSERT_HEAVY(x.
OK());
140 PPL_ASSERT_HEAVY(x.
OK());
143 template <
typename PSET>
148 s_end = x.
sequence.end(); si != s_end; ++si) {
152 PPL_ASSERT_HEAVY(x.
OK());
155 template <
typename PSET>
160 s_end = x.
sequence.end(); si != s_end; ++si) {
164 PPL_ASSERT_HEAVY(x.
OK());
167 template <
typename PSET>
172 s_end = x.
sequence.end(); si != s_end; ++si) {
176 PPL_ASSERT_HEAVY(x.
OK());
179 template <
typename PSET>
184 s_end = x.
sequence.end(); si != s_end; ++si) {
188 PPL_ASSERT_HEAVY(x.
OK());
191 template <
typename PSET>
196 s_end = x.
sequence.end(); si != s_end; ++si) {
200 PPL_ASSERT_HEAVY(x.
OK());
203 template <
typename PSET>
208 s_end = x.
sequence.end(); si != s_end; ++si) {
212 PPL_ASSERT_HEAVY(x.
OK());
215 template <
typename PSET>
220 s_end = x.
sequence.end(); si != s_end; ++si) {
224 PPL_ASSERT_HEAVY(x.
OK());
227 template <
typename PSET>
232 s_end = x.
sequence.end(); si != s_end; ++si) {
236 PPL_ASSERT_HEAVY(x.
OK());
239 template <
typename PSET>
244 s_end = x.
sequence.end(); si != s_end; ++si) {
248 PPL_ASSERT_HEAVY(x.
OK());
251 template <
typename PSET>
256 s_end = x.
sequence.end(); si != s_end; ++si) {
260 PPL_ASSERT_HEAVY(x.
OK());
263 template <
typename PSET>
268 s_end = x.
sequence.end(); si != s_end; ++si) {
272 PPL_ASSERT_HEAVY(x.
OK());
275 template <
typename PSET>
280 s_end = x.
sequence.end(); si != s_end; ++si) {
284 PPL_ASSERT_HEAVY(x.
OK());
287 template <
typename PSET>
291 Variables_Set::size_type num_removed = vars.size();
292 if (num_removed > 0) {
294 s_end = x.
sequence.end(); si != s_end; ++si) {
295 si->pointset().remove_space_dimensions(vars);
299 PPL_ASSERT_HEAVY(x.
OK());
303 template <
typename PSET>
310 s_end = x.
sequence.end(); si != s_end; ++si) {
315 PPL_ASSERT_HEAVY(x.
OK());
319 template <
typename PSET>
320 template <
typename Partial_Function>
328 if (pfunc.
maps(i, new_i)) {
337 s_end = x.
sequence.end(); si != s_end; ++si) {
338 si->pointset().map_space_dimensions(pfunc);
340 x.
space_dim = s_begin->pointset().space_dimension();
343 PPL_ASSERT_HEAVY(x.
OK());
346 template <
typename PSET>
352 s_end = x.
sequence.end(); si != s_end; ++si) {
356 PPL_ASSERT_HEAVY(x.
OK());
359 template <
typename PSET>
364 Variables_Set::size_type num_folded = vars.size();
365 if (num_folded > 0) {
367 s_end = x.
sequence.end(); si != s_end; ++si) {
368 si->pointset().fold_space_dimensions(vars, dest);
372 PPL_ASSERT_HEAVY(x.
OK());
375 template <
typename PSET>
379 Coefficient_traits::const_reference
383 s_end = x.
sequence.end(); si != s_end; ++si) {
390 PPL_ASSERT_HEAVY(x.
OK());
393 template <
typename PSET>
397 Coefficient_traits::const_reference
401 s_end = x.
sequence.end(); si != s_end; ++si) {
408 PPL_ASSERT_HEAVY(x.
OK());
412 template <
typename PSET>
420 s_end = x.
sequence.end(); si != s_end; ++si) {
424 PPL_ASSERT_HEAVY(x.
OK());
427 template <
typename PSET>
435 s_end = x.
sequence.end(); si != s_end; ++si) {
439 PPL_ASSERT_HEAVY(x.
OK());
442 template <
typename PSET>
448 Coefficient_traits::const_reference denominator) {
451 s_end = x.
sequence.end(); si != s_end; ++si) {
455 PPL_ASSERT_HEAVY(x.
OK());
458 template <
typename PSET>
464 Coefficient_traits::const_reference
468 s_end = x.
sequence.end(); si != s_end; ++si) {
472 PPL_ASSERT_HEAVY(x.
OK());
476 template <
typename PSET>
482 Coefficient_traits::const_reference denominator) {
485 s_end = x.
sequence.end(); si != s_end; ++si) {
489 PPL_ASSERT_HEAVY(x.
OK());
492 template <
typename PSET>
498 Coefficient_traits::const_reference denominator) {
501 s_end = x.
sequence.end(); si != s_end; ++si) {
506 PPL_ASSERT_HEAVY(x.
OK());
509 template <
typename PSET>
518 s_end = x.
sequence.end(); si != s_end; ++si) {
519 PSET pi(si->pointset());
520 if (!pi.is_empty()) {
524 cs_end = cs.
end(); i != cs_end; ++i) {
537 template <
typename PSET>
543 return x.
size() == 1 && x.
begin()->pointset().is_universe();
548 x_i != x_end; ++x_i) {
549 if (x_i->pointset().is_universe()) {
562 template <
typename PSET>
567 s_end = x.
sequence.end(); si != s_end; ++si) {
568 if (!si->pointset().is_empty()) {
575 template <
typename PSET>
580 s_end = x.
sequence.end(); si != s_end; ++si) {
581 if (!si->pointset().is_discrete()) {
588 template <
typename PSET>
596 s_end = x.
sequence.end(); si != s_end; ++si) {
597 if (!si->pointset().is_topologically_closed()) {
604 template <
typename PSET>
609 s_end = x.
sequence.end(); si != s_end; ++si) {
610 if (!si->pointset().is_bounded()) {
617 template <
typename PSET>
624 std::ostringstream s;
625 s <<
"PPL::Pointset_Powerset<PSET>::constrains(v):\n"
627 <<
"v.space_dimension() == " << var_space_dim <<
".";
628 throw std::invalid_argument(s.str());
637 x_i != x_end; ++x_i) {
638 if (x_i->pointset().constrains(var)) {
645 template <
typename PSET>
650 x_s_end = x.
sequence.end(); si != x_s_end; ++si) {
651 const PSET& pi = si->pointset();
653 y_s_end = y.
sequence.end(); sj != y_s_end; ++sj) {
654 const PSET& pj = sj->pointset();
655 if (!pi.is_disjoint_from(pj)) {
663 template <
typename PSET>
670 s_end = x.
sequence.end(); si != s_end; ++si) {
674 PPL_ASSERT_HEAVY(x.
OK());
677 template <
typename PSET>
683 s_end = x.
sequence.end(); si != s_end; ++si) {
687 PPL_ASSERT_HEAVY(x.
OK());
690 template <
typename PSET>
695 s_end = x.
sequence.end(); si != s_end; ++si) {
698 PPL_ASSERT_HEAVY(x.
OK());
701 template <
typename PSET>
708 bool nonempty_intersection =
false;
712 s_end = context.
sequence.end(); si != s_end; ++si) {
713 PSET context_i(si->pointset());
715 PSET enlarged_i(dest);
716 if (enlarged_i.simplify_using_context_assign(context_i)) {
717 nonempty_intersection =
true;
720 enlarged.intersection_assign(enlarged_i);
722 swap(dest, enlarged);
723 return nonempty_intersection;
726 template <
typename PSET>
749 const PSET& y_i = y.
sequence.begin()->pointset();
751 s_end = x.
sequence.end(); si != s_end; ) {
752 PSET& x_i = si->pointset();
753 if (x_i.simplify_using_context_assign(y_i)) {
765 s_end = x.
sequence.end(); si != s_end; ) {
776 PPL_ASSERT_HEAVY(x.
OK());
780 template <
typename PSET>
785 y_s_end = y.
sequence.end(); si != y_s_end; ++si) {
786 const PSET& pi = si->pointset();
787 bool pi_is_contained =
false;
790 (sj != x_s_end && !pi_is_contained);
792 const PSET& pj = sj->pointset();
793 if (pj.contains(pi)) {
794 pi_is_contained =
true;
797 if (!pi_is_contained) {
804 template <
typename PSET>
813 y_s_end = y.
sequence.end(); si != y_s_end; ++si) {
814 const PSET& pi = si->pointset();
815 bool pi_is_strictly_contained =
false;
818 (sj != x_s_end && !pi_is_strictly_contained); ++sj) {
819 const PSET& pj = sj->pointset();
820 if (pj.strictly_contains(pi)) {
821 pi_is_strictly_contained =
true;
824 if (!pi_is_strictly_contained) {
831 template <
typename PSET>
832 template <
typename Cons_or_Congr>
838 bool is_included =
true;
840 bool is_disjoint =
true;
847 bool is_strictly_intersecting =
false;
848 bool included_once =
false;
849 bool disjoint_once =
false;
851 bool saturates =
true;
853 s_end = x.
sequence.end(); si != s_end; ++si) {
856 included_once =
true;
862 disjoint_once =
true;
868 is_strictly_intersecting =
true;
882 if (is_strictly_intersecting || (included_once && disjoint_once)) {
891 template <
typename PSET>
897 s_end = x.
sequence.end(); si != s_end; ++si) {
907 template <
typename PSET>
914 s_end = x.
sequence.end(); si != s_end; ++si) {
915 if (!si->pointset().bounds_from_above(expr)) {
922 template <
typename PSET>
929 s_end = x.
sequence.end(); si != s_end; ++si) {
930 if (!si->pointset().bounds_from_below(expr)) {
937 template <
typename PSET>
942 bool& maximum)
const {
955 bool best_max =
false;
961 bool iter_max =
false;
966 s_end = x.
sequence.end(); si != s_end; ++si) {
967 if (!si->pointset().maximize(expr, iter_sup_n, iter_sup_d, iter_max)) {
973 best_sup_n = iter_sup_n;
974 best_sup_d = iter_sup_d;
978 tmp = (best_sup_n * iter_sup_d) - (iter_sup_n * best_sup_d);
980 best_sup_n = iter_sup_n;
981 best_sup_d = iter_sup_d;
985 best_max = (best_max || iter_max);
995 template <
typename PSET>
1014 bool best_max =
false;
1021 bool iter_max =
false;
1027 s_end = x.
sequence.end(); si != s_end; ++si) {
1028 if (!si->pointset().maximize(expr,
1029 iter_sup_n, iter_sup_d, iter_max, iter_g)) {
1035 best_sup_n = iter_sup_n;
1036 best_sup_d = iter_sup_d;
1037 best_max = iter_max;
1041 tmp = (best_sup_n * iter_sup_d) - (iter_sup_n * best_sup_d);
1043 best_sup_n = iter_sup_n;
1044 best_sup_d = iter_sup_d;
1045 best_max = iter_max;
1048 else if (tmp == 0) {
1049 best_max = (best_max || iter_max);
1062 template <
typename PSET>
1067 bool& minimum)
const {
1080 bool best_min =
false;
1086 bool iter_min =
false;
1091 s_end = x.
sequence.end(); si != s_end; ++si) {
1092 if (!si->pointset().minimize(expr, iter_inf_n, iter_inf_d, iter_min)) {
1098 best_inf_n = iter_inf_n;
1099 best_inf_d = iter_inf_d;
1100 best_min = iter_min;
1103 tmp = (best_inf_n * iter_inf_d) - (iter_inf_n * best_inf_d);
1105 best_inf_n = iter_inf_n;
1106 best_inf_d = iter_inf_d;
1107 best_min = iter_min;
1109 else if (tmp == 0) {
1110 best_min = (best_min || iter_min);
1121 template <
typename PSET>
1140 bool best_min =
false;
1147 bool iter_min =
false;
1153 s_end = x.
sequence.end(); si != s_end; ++si) {
1154 if (!si->pointset().minimize(expr,
1155 iter_inf_n, iter_inf_d, iter_min, iter_g)) {
1161 best_inf_n = iter_inf_n;
1162 best_inf_d = iter_inf_d;
1163 best_min = iter_min;
1167 tmp = (best_inf_n * iter_inf_d) - (iter_inf_n * best_inf_d);
1169 best_inf_n = iter_inf_n;
1170 best_inf_d = iter_inf_d;
1171 best_min = iter_min;
1174 else if (tmp == 0) {
1175 best_min = (best_min || iter_min);
1188 template <
typename PSET>
1193 s_end = x.
sequence.end(); si != s_end; ++si) {
1194 if (si->pointset().contains_integer_point()) {
1201 template <
typename PSET>
1208 unsigned complexity_threshold,
1209 bool wrap_individually) {
1212 s_end = x.
sequence.end(); si != s_end; ++si) {
1214 complexity_threshold, wrap_individually);
1217 PPL_ASSERT_HEAVY(x.
OK());
1220 template <
typename PSET>
1231 std::deque<bool> marked(n,
false);
1235 unsigned si_index = 0;
1237 if (marked[si_index]) {
1240 PSET& pi = si->pointset();
1242 unsigned sj_index = si_index;
1243 for (++sj, ++sj_index; sj != s_end; ++sj, ++sj_index) {
1244 if (marked[sj_index]) {
1247 const PSET& pj = sj->pointset();
1248 if (pi.upper_bound_assign_if_exact(pj)) {
1249 marked[si_index] =
true;
1250 marked[sj_index] =
true;
1261 unsigned xi_index = 0;
1263 x_end = x.
end(); xi != x_end; ++xi, ++xi_index) {
1264 if (!marked[xi_index]) {
1274 }
while (deleted > 0);
1275 PPL_ASSERT_HEAVY(x.
OK());
1278 template <
typename PSET>
1279 template <
typename W
idening>
1297 std::deque<bool> marked(n,
false);
1300 unsigned i_index = 0;
1302 y_begin = y.
begin(), y_end = y.
end();
1303 i != x_end; ++i, ++i_index) {
1305 const PSET& pi = i->pointset();
1306 const PSET& pj = j->pointset();
1307 if (pi.contains(pj)) {
1309 widen_fun(pi_copy, pj);
1311 marked[i_index] =
true;
1319 if (!marked[i_index]) {
1328 PPL_ASSERT_HEAVY(x.
OK());
1332 template <
typename PSET>
1333 template <
typename W
idening>
1338 unsigned max_disjuncts) {
1352 if (max_disjuncts != 0) {
1358 template <
typename PSET>
1359 template <
typename Cert>
1363 typename Cert::Compare>& cert_ms)
const {
1366 PPL_ASSERT(cert_ms.size() == 0);
1368 Cert ph_cert(i->pointset());
1373 template <
typename PSET>
1374 template <
typename Cert>
1378 typename Cert::Compare>& y_cert_ms)
const {
1379 typedef std::map<Cert, size_type, typename Cert::Compare> Cert_Multiset;
1380 Cert_Multiset x_cert_ms;
1381 collect_certificates(x_cert_ms);
1382 typename Cert_Multiset::const_iterator xi = x_cert_ms.begin();
1383 typename Cert_Multiset::const_iterator x_cert_ms_end = x_cert_ms.end();
1384 typename Cert_Multiset::const_iterator yi = y_cert_ms.begin();
1385 typename Cert_Multiset::const_iterator y_cert_ms_end = y_cert_ms.end();
1386 while (xi != x_cert_ms_end && yi != y_cert_ms_end) {
1387 const Cert& xi_cert = xi->first;
1388 const Cert& yi_cert = yi->first;
1389 switch (xi_cert.compare(yi_cert)) {
1395 if (xi_count == yi_count) {
1402 return xi_count < yi_count;
1417 return yi != y_cert_ms_end;
1420 template <
typename PSET>
1421 template <
typename Cert,
typename W
idening>
1424 Widening widen_fun) {
1440 PPL_ASSERT(x.
size() > 0);
1441 if (y.
size() == 0) {
1448 x_hull.upper_bound_assign(i->pointset());
1454 y_hull.upper_bound_assign(i->pointset());
1457 const Cert y_hull_cert(y_hull);
1460 int hull_stabilization = y_hull_cert.compare(x_hull);
1461 if (hull_stabilization == 1) {
1466 const bool y_is_not_a_singleton = y.
size() > 1;
1470 typedef std::map<Cert, size_type, typename Cert::Compare> Cert_Multiset;
1471 Cert_Multiset y_cert_ms;
1472 bool y_cert_ms_computed =
false;
1474 if (hull_stabilization == 0 && y_is_not_a_singleton) {
1477 y_cert_ms_computed =
true;
1491 b_h_end = bgp99_heuristics.
end(); i != b_h_end; ++i) {
1492 bgp99_heuristics_hull.upper_bound_assign(i->pointset());
1497 hull_stabilization = y_hull_cert.compare(bgp99_heuristics_hull);
1498 if (hull_stabilization == 1) {
1500 swap(x, bgp99_heuristics);
1503 else if (hull_stabilization == 0 && y_is_not_a_singleton) {
1505 if (!y_cert_ms_computed) {
1507 y_cert_ms_computed =
true;
1510 swap(x, bgp99_heuristics);
1520 swap(x, reduced_bgp99_heuristics);
1527 if (bgp99_heuristics_hull.strictly_contains(y_hull)) {
1529 PSET ph = bgp99_heuristics_hull;
1530 widen_fun(ph, y_hull);
1532 ph.difference_assign(bgp99_heuristics_hull);
1540 swap(x, x_hull_singleton);
1543 template <
typename PSET>
1547 s <<
"size " << x.
size()
1551 xi != x_end; ++xi) {
1552 xi->pointset().ascii_dump(s);
1558 template <typename PSET>
1564 if (!(s >> str) || str !=
"size") {
1574 if (!(s >> str) || str !=
"space_dim") {
1585 if (!ph.ascii_load(s)) {
1593 PPL_ASSERT_HEAVY(x.
OK());
1597 template <
typename PSET>
1602 const PSET& pi = xi->pointset();
1603 if (pi.space_dimension() != x.
space_dim) {
1606 <<
" in an element of the sequence,\nshould be "
1613 return x.Base::OK();
1616 namespace Implementation {
1618 namespace Pointset_Powersets {
1620 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
1627 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
1628 template <
typename PSET>
1640 pset.add_constraint(c);
1649 template <
typename PSET>
1650 std::pair<PSET, Pointset_Powerset<NNC_Polyhedron> >
1652 using Implementation::Pointset_Powersets::linear_partition_aux;
1658 p_constraints_end = p_constraints.
end();
1659 i != p_constraints_end;
1664 linear_partition_aux(
le <= 0, pset, r);
1665 linear_partition_aux(
le >= 0, pset, r);
1668 linear_partition_aux(c, pset, r);
1671 return std::make_pair(pset, r);
1676 #endif // !defined(PPL_Pointset_Powerset_templates_hh)
Poly_Con_Relation relation_with(const Constraint &c) const
Returns the relations holding between the powerset *this and the constraint c.
An iterator over a system of constraints.
void add_congruence(const Congruence &cg)
Intersects *this with congruence cg.
The empty element, i.e., the empty set.
void BHZ03_widening_assign(const Pointset_Powerset &y, Widening widen_fun)
Assigns to *this the result of computing the BHZ03-widening between *this and y, using the widening f...
static Poly_Con_Relation is_disjoint()
The polyhedron and the set of points satisfying the constraint are disjoint.
static Poly_Gen_Relation subsumes()
Adding the generator would not change the polyhedron.
size_type size() const
Returns the number of disjuncts.
A linear equality or inequality.
bool bounds_from_below(const Linear_Expression &expr) const
Returns true if and only if expr is bounded from below in *this.
bool is_equality() const
Returns true if and only if *this is an equality constraint.
void swap(CO_Tree &x, CO_Tree &y)
void pairwise_reduce()
Assign to *this the result of (recursively) merging together the pairs of disjuncts whose upper-bound...
bool is_bottom() const
Returns true if and only if *this is the bottom element of the powerset constraint system (i...
bool maximize(const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum) const
Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value is computed.
Sequence sequence
The sequence container holding powerset's elements.
static bool implies(flags_t x, flags_t y)
True if and only if the conjunction x implies the conjunction y.
size_t dimension_type
An unsigned integral type for representing space dimensions.
An std::set of variables' indexes.
iterator add_non_bottom_disjunct_preserve_reduction(const D &d, iterator first, iterator last)
Adds to *this the disjunct d, assuming d is not the bottom element and ensuring partial Omega-reducti...
bool is_topologically_closed() const
Returns true if and only if all the disjuncts in *this are topologically closed.
A line, ray, point or closure point.
bool is_empty() const
Returns true if and only if *this is an empty polyhedron.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
Base::size_type size_type
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
void add_constraint(const Constraint &c)
Adds a copy of constraint c to the system of constraints of *this (without minimizing the result)...
void generalized_affine_image(Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
Assigns to *this the image of *this with respect to the generalized affine relation ...
void refine_with_constraints(const Constraint_System &cs)
Use the constraints in cs to refine *this.
void concatenate_assign(const Determinate &y)
Assigns to *this the concatenation of *this and y, taken in this order.
bool contains_integer_point() const
Returns true if and only if *this contains at least one integer point.
static Poly_Con_Relation is_included()
The polyhedron is included in the set of points satisfying the constraint.
The standard C++ namespace.
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified space dimensions.
#define PPL_OUTPUT_TEMPLATE_DEFINITIONS(type_symbol, class_prefix)
Base::Sequence_iterator Sequence_iterator
static Poly_Con_Relation saturates()
The polyhedron is included in the set of points saturating the constraint.
void concatenate_assign(const Pointset_Powerset &y)
Assigns to *this the concatenation of *this and y.
bool OK() const
Checks if all the invariants are satisfied.
const_iterator begin() const
Returns the const_iterator pointing to the first constraint, if *this is not empty; otherwise...
A wrapper for PPL pointsets, providing them with a determinate constraint system interface, as defined in [Bag98].
void add_constraints(const Constraint_System &cs)
Intersects *this with the constraints in cs.
iterator begin()
Returns an iterator pointing to the first disjunct, if *this is not empty; otherwise, returns the past-the-end iterator.
void omega_reduce() const
Drops from the sequence of disjuncts in *this all the non-maximal elements so that *this is non-redun...
bool is_bounded() const
Returns true if and only if all elements in *this are bounded.
The powerset construction on a base-level domain.
A dimension of the vector space.
Bounded_Integer_Type_Overflow
void refine_with_constraint(const Constraint &c)
Use the constraint c to refine *this.
void linear_partition_aux(const Constraint &c, PSET &pset, Pointset_Powerset< NNC_Polyhedron > &r)
Partitions polyhedron pset according to constraint c.
bool is_strict_inequality() const
Returns true if and only if *this is a strict inequality constraint.
Complexity_Class
Complexity pseudo-classes.
void add_space_dimensions_and_embed(dimension_type m)
Adds m new dimensions to the vector space containing *this and embeds each disjunct in *this in the n...
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
std::pair< PSET, Pointset_Powerset< NNC_Polyhedron > > linear_partition(const PSET &p, const PSET &q)
bool definitely_entails(const Powerset &y) const
Returns true if *this definitely entails y. Returns false if *this may not entail y (i...
bool reduced
If true, *this is Omega-reduced.
Relation_Symbol
Relation symbols.
bool minimize(const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum) const
Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value is computed.
void wrap_assign(const Variables_Set &vars, Bounded_Integer_Type_Width w, Bounded_Integer_Type_Representation r, Bounded_Integer_Type_Overflow o, const Constraint_System *cs_p=0, unsigned complexity_threshold=16, bool wrap_individually=true)
Wraps the specified dimensions of the vector space.
Bounded_Integer_Type_Width
const_iterator end() const
Returns the past-the-end const_iterator.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void unconstrain(Variable var)
Computes the cylindrification of *this with respect to space dimension var, assigning the result to *...
void refine_with_congruence(const Congruence &cg)
Use the congruence cg to refine *this.
void fold_space_dimensions(const Variables_Set &vars, Variable dest)
Folds the space dimensions in vars into dest.
void affine_preimage(Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
Assigns to *this the affine preimage of *this under the function mapping variable var to the affine e...
bool is_universe() const
Returns true if and only if *this is the top element of the powerset lattice.
Pointset_Powerset(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Powerset.
void collect_certificates(std::map< Cert, size_type, typename Cert::Compare > &cert_ms) const
Records in cert_ms the certificates for this set of disjuncts.
A not necessarily closed convex polyhedron.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type ascii_load(std::istream &s, T &t)
dimension_type affine_dimension() const
Returns the dimension of the vector space enclosing *this.
A closed convex polyhedron.
bool is_discrete() const
Returns true if and only if *this is discrete.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
void bounded_affine_image(Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())
Assigns to *this the image of *this with respect to the bounded affine relation . ...
void expand_space_dimension(Variable var, dimension_type m)
Creates m copies of the space dimension corresponding to var.
bool contains(const Pointset_Powerset &y) const
Returns true if and only if each disjunct of y is contained in a disjunct of *this.
bool constrains(Variable var) const
Returns true if and only if var is constrained in *this.
void map_space_dimensions(const Partial_Function &pfunc)
Remaps the dimensions of the vector space according to a partial function.
void add_congruences(const Congruence_System &cgs)
Intersects *this with the congruences in cgs.
The universe element, i.e., the whole vector space.
iterator end()
Returns the past-the-end iterator.
bool is_bottom() const
Returns true if and only if *this embeds the empty element of PSET.
void generalized_affine_preimage(Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
Assigns to *this the preimage of *this with respect to the generalized affine relation ...
void bounded_affine_preimage(Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())
Assigns to *this the preimage of *this with respect to the bounded affine relation ...
bool is_empty() const
Returns true if and only if *this is an empty powerset.
A const_iterator on a sequence of read-only objects.
bool bounds_from_above(const Linear_Expression &expr) const
Returns true if and only if expr is bounded from above in *this.
void remove_higher_space_dimensions(dimension_type new_dimension)
Removes the higher space dimensions so that the resulting space will have dimension new_dimension...
The powerset construction instantiated on PPL pointset domains.
void collapse()
If *this is not empty (i.e., it is not the bottom element), it is reduced to a singleton obtained by ...
The entire library is confined to this namespace.
bool intersection_preserving_enlarge_element(PSET &dest) const
Assigns to dest a powerset meet-preserving enlargement of itself with respect to *this. If false is returned, then the intersection is empty.
void add_disjunct(const PSET &ph)
Adds to *this the disjunct ph.
void add_space_dimensions_and_project(dimension_type m)
Adds m new dimensions to the vector space containing *this without embedding the disjuncts in *this i...
void poly_hull_assign(const Polyhedron &y)
Assigns to *this the poly-hull of *this and y.
void intersection_assign(const Pointset_Powerset &y)
Assigns to *this the intersection of *this and y.
bool is_disjoint_from(const Pointset_Powerset &y) const
Returns true if and only if *this and y are disjoint.
bool strictly_contains(const Pointset_Powerset &y) const
Returns true if and only if each disjunct of y is strictly contained in a disjunct of *this...
void drop_some_non_integer_points(Complexity_Class complexity=ANY_COMPLEXITY)
Possibly tightens *this by dropping some points with non-integer coordinates.
void BGP99_heuristics_assign(const Pointset_Powerset &y, Widening widen_fun)
Assigns to *this the result of applying the BGP99 heuristics to *this and y, using the widening funct...
void refine_with_congruences(const Congruence_System &cgs)
Use the congruences in cgs to refine *this.
bool maps(dimension_type i, dimension_type &j) const
If *this maps i to a value k, assigns k to j and returns true; otherwise, j is unchanged and false is...
An iterator on a sequence of read-only objects.
dimension_type affine_dimension() const
Returns , if *this is empty; otherwise, returns the affine dimension of *this.
static bool implies(flags_t x, flags_t y)
True if and only if the conjunction x implies the conjunction y.
void add_constraint(const Constraint &c)
Intersects *this with constraint c.
dimension_type space_dim
The number of dimensions of the enclosing vector space.
const Throwable *volatile abandon_expensive_computations
A pointer to an exception object.
expr_type expression() const
Partial read access to the (adapted) internal expression.
Poly_Con_Relation relation_with_aux(const Cons_or_Congr &c) const
Template helper: common implementation for constraints and congruences.
bool is_omega_reduced() const
Returns true if and only if *this does not contain non-maximal elements.
static Poly_Con_Relation nothing()
The assertion that says nothing.
bool is_cert_multiset_stabilizing(const std::map< Cert, size_type, typename Cert::Compare > &y_cert_ms) const
Returns true if and only if the current set of disjuncts is stabilizing with respect to the multiset ...
void affine_image(Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
Assigns to *this the affine image of *this under the function mapping variable var to the affine expr...
static Poly_Con_Relation strictly_intersects()
The polyhedron intersects the set of points satisfying the constraint, but it is not included in it...
static Poly_Gen_Relation nothing()
The assertion that says nothing.
bool le(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
The relation between a polyhedron and a generator.
Bounded_Integer_Type_Representation
bool simplify_using_context_assign(const Pointset_Powerset &y)
Assigns to *this a meet-preserving simplification of *this with respect to y. If false is returned...
void topological_closure_assign()
Assigns to *this its topological closure.
The relation between a polyhedron and a constraint.
Base::Sequence_const_iterator Sequence_const_iterator
void BGP99_extrapolation_assign(const Pointset_Powerset &y, Widening widen_fun, unsigned max_disjuncts)
Assigns to *this the result of applying the BGP99 extrapolation operator to *this and y...