PPL: Parma_Polyhedra_Library::Polyhedra_PowerSet< PH > Class Template Reference

Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

# Parma_Polyhedra_Library::Polyhedra_PowerSet< PH > Class Template Reference

The powerset construction instantiated on PPL polyhedra. More...

Inherits Parma_Polyhedra_Library::PowerSet< Parma_Polyhedra_Library::Determinate< PH > >.

List of all members.

## Public Member Functions
Constructors
| Polyhedra_PowerSet (dimension_type num_dimensions=0, Polyhedron::Degenerate_Kind kind=Polyhedron::UNIVERSE)
| Builds a universe (top) or empty (bottom) Polyhedra_PowerSet.
| Polyhedra_PowerSet (const Polyhedra_PowerSet &y)
| Ordinary copy-constructor.
| Polyhedra_PowerSet (const ConSys &cs)
| Creates a Polyhedra_PowerSet with the same information contents as `cs`.
Member Functions that Do Not Modify the Powerset of Polyhedra
dimension_type | space_dimension () const
| Returns the dimension of the vector space enclosing `*this`.
bool | geometrically_covers (const Polyhedra_PowerSet &y) const
| Returns `true` if and only if `*this` geometrically covers `y`, i.e., if any point (in some element) of `y` is also a point (of some element) of `*this`.
bool | geometrically_equals (const Polyhedra_PowerSet &y) const
| Returns `true` if and only if `*this` is geometrically equal to `y`, i.e., if (the elements of) `*this` and `y` contain the same set of points.
bool | OK () const
| Checks if all the invariants are satisfied.
Space-Dimension Preserving Member Functions that May Modify the Powerset of Polyhedra
void | add_constraint (const Constraint &c)
| Intersects `*this` with constraint `c`.
bool | add_constraint_and_minimize (const Constraint &c)
| Intersects `*this` with the constraint `c`, minimizing the result.
void | add_constraints (const ConSys &cs)
| Intersects `*this` with the constraints in `cs`.
bool | add_constraints_and_minimize (const ConSys &cs)
| Intersects `*this` with the constraints in `cs`, minimizing the result.
void | pairwise_reduce ()
| Assign to `*this` the result of (recursively) merging together the pairs of polyhedra whose poly-hull is the same as their set-theoretical union.
template<typename Widening> void | BGP99_extrapolation_assign (const Polyhedra_PowerSet &y, Widening wf, unsigned max_disjuncts)
| Assigns to `*this` the result of applying the BGP99 extrapolation operator to `*this` and `y`, using the widening function `wf` and the cardinality threshold `max_disjuncts`.
template<typename Cert, typename Widening> void | BHZ03_widening_assign (const Polyhedra_PowerSet &y, Widening wf)
| Assigns to `*this` the result of computing the BHZ03-widening between `*this` and `y`, using the widening function `wf` certified by the convergence certificate `Cert`.
template<typename Widening> void | BHZ03_widening_assign (const Polyhedra_PowerSet &y, Widening wf)
| An instance of the BHZ03 framework using the widening function `wf` certified by BHRZ03_Certificate.
Member Functions that May Modify the Dimension of the Vector Space
Polyhedra_PowerSet & | operator= (const Polyhedra_PowerSet &y)
| The assignment operator (`*this` and `y` can be dimension-incompatible).
void | swap (Polyhedra_PowerSet &y)
| Swaps `*this` with `y`.
void | add_dimensions_and_embed (dimension_type m)
| Adds `m` new dimensions to the space containing `*this` and embeds each polyhedron in `*this` in the new space.
void | add_dimensions_and_project (dimension_type m)
| For each polyhedron in `*this`, adds `m` new dimensions without embedding it in the new space.
void | concatenate_assign (const Polyhedra_PowerSet &y)
| Assigns to `*this` the concatenation of `*this` and `y`.
void | remove_dimensions (const Variables_Set &to_be_removed)
| Removes all the specified dimensions.
void | remove_higher_dimensions (dimension_type new_dimension)
| Removes the higher dimensions so that the resulting space will have dimension `new_dimension`.
template<typename PartialFunction> void | map_dimensions (const PartialFunction &pfunc)
| Remaps the dimensions of the vector space according to a partial function.
## Static Public Member Functions
dimension_type | max_space_dimension ()
| Returns the maximum space dimension a Polyhedra_Powerset<PH> can handle.
## Related Functions
(Note that these are not member functions.)
Widening_Function< PH > | widen_fun (void(PH::*wm)(const PH &, unsigned *))
| Wraps a widening method into a function object.
Limited_Widening_Function< PH > | widen_fun (void(PH::*lwm)(const PH &, const ConSys &, unsigned *), const ConSys &cs)
| Wraps a limited widening method into a function object.
void | swap (Parma_Polyhedra_Library::Polyhedra_PowerSet< PH > &x, Parma_Polyhedra_Library::Polyhedra_PowerSet< PH > &y)
| Specializes `std::swap`.
std::pair< PH, Polyhedra_PowerSet< NNC_Polyhedron > > | linear_partition (const PH &p, const PH &q)
| Partitions `q` with respect to `p`.

## Detailed Description

### template<typename PH>
class Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >

The powerset construction instantiated on PPL polyhedra.

## Constructor & Destructor Documentation

template<typename PH>
Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::Polyhedra_PowerSet | ( | dimension_type | num_dimensions = `0`,
|  | Polyhedron::Degenerate_Kind | kind = `Polyhedron::UNIVERSE`
| ) | `[explicit]`

  | Builds a universe (top) or empty (bottom) Polyhedra_PowerSet. Parameters:
  | num_dimensions | The number of dimensions of the vector space enclosing the powerset;
  | kind | Specifies whether the universe or the empty powerset has to be built.

## Member Function Documentation

template<typename PH>
bool Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::geometrically_covers | ( | const Polyhedra_PowerSet< PH > & | y | ) | const

  | Returns `true` if and only if `*this` geometrically covers `y`, i.e., if any point (in some element) of `y` is also a point (of some element) of `*this`. Exceptions:
  | std::invalid_argument | Thrown if `*this` and `y` are topology-incompatible or dimension-incompatible.
Warning: This may be really expensive!

template<typename PH>
bool Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::geometrically_equals | ( | const Polyhedra_PowerSet< PH > & | y | ) | const

  | Returns `true` if and only if `*this` is geometrically equal to `y`, i.e., if (the elements of) `*this` and `y` contain the same set of points. Exceptions:
  | std::invalid_argument | Thrown if `*this` and `y` are topology-incompatible or dimension-incompatible.
Warning: This may be really expensive!

template<typename PH>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::add_constraint | ( | const Constraint & | c | ) |

  | Intersects `*this` with constraint `c`. Exceptions:
  | std::invalid_argument | Thrown if `*this` and constraint `c` are topology-incompatible or dimension-incompatible.

template<typename PH>
bool Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::add_constraint_and_minimize | ( | const Constraint & | c | ) |

  | Intersects `*this` with the constraint `c`, minimizing the result. Returns: `false` if and only if the result is empty. Exceptions:
  | std::invalid_argument | Thrown if `*this` and `c` are topology-incompatible or dimension-incompatible.

template<typename PH>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::add_constraints | ( | const ConSys & | cs | ) |

  | Intersects `*this` with the constraints in `cs`. Parameters:
  | cs | The constraints to intersect with.
  Exceptions:
  | std::invalid_argument | Thrown if `*this` and `cs` are topology-incompatible or dimension-incompatible.

template<typename PH>
bool Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::add_constraints_and_minimize | ( | const ConSys & | cs | ) |

  | Intersects `*this` with the constraints in `cs`, minimizing the result. Returns: `false` if and only if the result is empty. Parameters:
  | cs | The constraints to intersect with.
  Exceptions:
  | std::invalid_argument | Thrown if `*this` and `cs` are topology-incompatible or dimension-incompatible.

template<typename PH>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::pairwise_reduce | ( |  | ) |

| Assign to `*this` the result of (recursively) merging together the pairs of polyhedra whose poly-hull is the same as their set-theoretical union. On exit, for all the pairs , of different polyhedra in `*this`, we have .

template<typename PH>
template<typename Widening>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::BGP99_extrapolation_assign | ( | const Polyhedra_PowerSet< PH > & | y,
|  | Widening | wf,
|  | unsigned | max_disjuncts
| ) |

  | Assigns to `*this` the result of applying the BGP99 extrapolation operator to `*this` and `y`, using the widening function `wf` and the cardinality threshold `max_disjuncts`. Parameters:
  | y | A finite powerset of polyhedra. It must definitely entail `*this`;
  | wf | The widening function to be used on polyhedra objects. It is obtained from the corresponding widening method by using the helper function Parma_Polyhedra_Library::widen_fun. Legal values are, e.g., `widen_fun(&Polyhedron::H79_widening_assign)` and `widen_fun(&Polyhedron::limited_H79_extrapolation_assign, cs)`;
  | max_disjuncts | The maximum number of disjuncts occurring in the powerset `*this` before starting the computation. If this number is exceeded, some of the disjuncts in `*this` are collapsed (i.e., joined together).
  Exceptions:
  | std::invalid_argument | Thrown if `*this` and `y` are topology-incompatible or dimension-incompatible.
For a description of the extrapolation operator, see [BGP99] and [BHZ03b].

template<typename PH>
template<typename Cert, typename Widening>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::BHZ03_widening_assign | ( | const Polyhedra_PowerSet< PH > & | y,
|  | Widening | wf
| ) |

  | Assigns to `*this` the result of computing the BHZ03-widening between `*this` and `y`, using the widening function `wf` certified by the convergence certificate `Cert`. Parameters:
  | y | The finite powerset of polyhedra computed in the previous iteration step. It must definitely entail `*this`;
  | wf | The widening function to be used on polyhedra objects. It is obtained from the corresponding widening method by using the helper function widen_fun. Legal values are, e.g., `widen_fun(&Polyhedron::H79_widening_assign)` and `widen_fun(&Polyhedron::limited_H79_extrapolation_assign, cs)`.
  Exceptions:
  | std::invalid_argument | Thrown if `*this` and `y` are topology-incompatible or dimension-incompatible.
Warning: In order to obtain a proper widening operator, the template parameter `Cert` should be a finite convergence certificate for the base-level widening function `wf`; otherwise, an extrapolation operator is obtained. For a description of the methods that should be provided by `Cert`, see BHRZ03_Certificate or H79_Certificate.

template<typename PH>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::concatenate_assign | ( | const Polyhedra_PowerSet< PH > & | y | ) |

| Assigns to `*this` the concatenation of `*this` and `y`. The result is obtained by computing the pairwise concatenation of each polyhedron in `*this` with each polyhedron in `y`.

template<typename PH>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::remove_dimensions | ( | const Variables_Set & | to_be_removed | ) |

  | Removes all the specified dimensions. Parameters:
  | to_be_removed | The set of Variable objects corresponding to the dimensions to be removed.
  Exceptions:
  | std::invalid_argument | Thrown if `*this` is dimension-incompatible with one of the Variable objects contained in `to_be_removed`.

template<typename PH>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::remove_higher_dimensions | ( | dimension_type | new_dimension | ) |

  | Removes the higher dimensions so that the resulting space will have dimension `new_dimension`. Exceptions:
  | std::invalid_argument | Thrown if `new_dimensions` is greater than the space dimension of `*this`.

template<typename PH>
template<typename PartialFunction>
void Parma_Polyhedra_Library::Polyhedra_PowerSet< PH >::map_dimensions | ( | const PartialFunction & | pfunc | ) |

| Remaps the dimensions of the vector space according to a partial function. See also Polyhedron::map_dimensions.

## Friends And Related Function Documentation

template<typename PH>
Widening_Function< PH > widen_fun | ( | void(PH::* | wm)(const PH &, unsigned *) | ) | `[related]`

  | Wraps a widening method into a function object. Parameters:
  | wm | The widening method.

template<typename PH>
Limited_Widening_Function< PH > widen_fun | ( | void(PH::* | lwm)(const PH &, const ConSys &, unsigned *),
|  | const ConSys & | cs
| ) | `[related]`

  | Wraps a limited widening method into a function object. Parameters:
  | lwm | The limited widening method.
  | cs | The constraint system limiting the widening.

template<typename PH>
std::pair< PH, Polyhedra_PowerSet< NNC_Polyhedron > > linear_partition | ( | const PH & | p,
|  | const PH & | q
| ) | `[related]`

| Partitions `q` with respect to `p`. Let `p` and `q` be two polyhedra. The function returns an object `r` of type `std::pair<PH, Polyhedra_PowerSet<NNC_Polyhedron> >` such that `r.first` is the intersection of `p` and `q`; `r.second` has the property that all its elements are not empty, pairwise disjoint, and disjoint from `p`; the union of `r.first` with all the elements of `r.second` gives `q` (i.e., `r` is the representation of a partition of `q`).