PPL
1.2
|
The ask and tell construction on a base-level domain. More...
#include <Ask_Tell_defs.hh>
Public Types | |
typedef Sequence::size_type | size_type |
typedef Sequence::value_type | value_type |
typedef iterator_to_const< Sequence > | iterator |
Alias for a read-only bidirectional iterator on the pairs an Ask_Tell object. More... | |
typedef const_iterator_to_const< Sequence > | const_iterator |
A bidirectional const_iterator on the disjuncts of a Powerset element. More... | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
The reverse iterator type built from Powerset::iterator. More... | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
The reverse iterator type built from Powerset::const_iterator. More... | |
Public Member Functions | |
Constructors and Destructor | |
Ask_Tell () | |
Default constructor: builds the top of the ask-and-tell constraint system (i.e., the empty system). More... | |
Ask_Tell (const Ask_Tell &y) | |
Copy constructor. More... | |
Ask_Tell (const Ask_Tell_Pair< D > &p) | |
If p is not top, builds an ask-and-tell system containing only p . Builds the empty system otherwise. More... | |
Ask_Tell (const D &ask, const D &tell) | |
If ask and tell do not constitute a top pair, builds an ask-and-tell system containing only that pair. Builds the empty system otherwise. More... | |
~Ask_Tell () | |
Destructor. More... | |
Member Functions that Do Not Modify the Ask_Tell Object | |
bool | definitely_entails (const Ask_Tell &y) const |
Returns true if *this definitely entails y . Returns false if *this may not entail y (i.e., if *this does not entail y or if entailment could not be decided). More... | |
bool | is_top () const |
Returns true if and only if *this is the top element of the ask-and-tell constraint system (i.e., it represents the universe). More... | |
bool | is_bottom () const |
Returns true if and only if *this is the bottom element of the ask-and-tell constraint system (i.e., it represents the empty set). More... | |
memory_size_type | total_memory_in_bytes () const |
Returns a lower bound to the total size in bytes of the memory occupied by *this . More... | |
memory_size_type | external_memory_in_bytes () const |
Returns a lower bound to the size in bytes of the memory managed by *this . More... | |
int32_t | hash_code () const |
Returns a 32-bit hash code for *this . More... | |
bool | OK () const |
Checks if all the invariants are satisfied. More... | |
Member Functions for the Direct Manipulation of Pairs | |
void | normalize () const |
Normalizes the pairs in *this . More... | |
size_type | size () const |
Returns the number of pairs. More... | |
bool | empty () const |
Returns true if and only if there are no pairs in *this . More... | |
iterator | begin () |
Returns an iterator pointing to the first pair, if *this is not empty; otherwise, returns the past-the-end iterator. More... | |
iterator | end () |
Returns the past-the-end iterator. More... | |
const_iterator | begin () const |
Returns a const_iterator pointing to the first pair, if *this is not empty; otherwise, returns the past-the-end const_iterator. More... | |
const_iterator | end () const |
Returns the past-the-end const_iterator. More... | |
reverse_iterator | rbegin () |
Returns a reverse_iterator pointing to the last pair, if *this is not empty; otherwise, returns the before-the-start reverse_iterator. More... | |
reverse_iterator | rend () |
Returns the before-the-start reverse_iterator. More... | |
const_reverse_iterator | rbegin () const |
Returns a const_reverse_iterator pointing to the last pair, if *this is not empty; otherwise, returns the before-the-start const_reverse_iterator. More... | |
const_reverse_iterator | rend () const |
Returns the before-the-start const_reverse_iterator. More... | |
Ask_Tell & | add_pair (const Ask_Tell_Pair< D > &p) |
Adds to *this the pair p . More... | |
Ask_Tell & | add_pair (const D &ask, const D &tell) |
Adds to *this the pair constituted by ask and tell . More... | |
iterator | drop_pair (iterator position) |
Drops the pair in *this pointed to by position , returning an iterator to the pair following position . More... | |
void | drop_pairs (iterator first, iterator last) |
Drops all the pairs from first to last (excluded). More... | |
void | clear () |
Drops all the pairs, making *this an empty powerset. More... | |
Member Functions that May Modify the Ask_Tell Object | |
Ask_Tell & | operator= (const Ask_Tell &y) |
The assignment operator. (*this and y can be dimension-incompatible.) More... | |
void | m_swap (Ask_Tell &y) |
Swaps *this with y . More... | |
void | upper_bound_assign (const Ask_Tell &y) |
Assigns to *this an upper bound of *this and y . More... | |
void | meet_assign (const Ask_Tell &y) |
Assigns to *this the meet of *this and y . More... | |
Protected Types | |
typedef Ask_Tell_Pair< D > | Pair |
An ask-tell agent is composed of pairs. More... | |
typedef std::list< Ask_Tell_Pair< D > > | Sequence |
An ask-tell agent is implemented as a sequence of ask-tell pairs. More... | |
typedef Sequence::iterator | Sequence_iterator |
Alias for the low-level iterator on the pairs. More... | |
typedef Sequence::const_iterator | Sequence_const_iterator |
Alias for the low-level const_iterator on the pairs. More... | |
Protected Member Functions | |
bool | is_normalized () const |
Returns true if and only if *this is normalized. More... | |
void | pair_insert (const D &a, const D &t) |
void | pair_insert_good (const D &a, const D &t) |
bool | reduce () |
bool | deduce () |
bool | absorb () |
void | deabsorb () const |
bool | check_normalized () const |
Does the hard work of checking whether *this is normalized and returns true if and only if it is. More... | |
bool | probe (const D &tellv, const D &askv) const |
Protected Attributes | |
Sequence | sequence |
The sequence container holding the pairs/. More... | |
bool | normalized |
If true , *this is normalized. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename D > | |
void | swap (Ask_Tell< D > &x, Ask_Tell< D > &y) |
Swaps x with y . More... | |
template<typename D > | |
bool | operator== (const Ask_Tell< D > &x, const Ask_Tell< D > &y) |
Returns true if and only if x and y are equivalent. More... | |
template<typename D > | |
bool | operator!= (const Ask_Tell< D > &x, const Ask_Tell< D > &y) |
Returns true if and only if x and y are not equivalent. More... | |
template<typename D > | |
std::ostream & | operator<< (std::ostream &, const Ask_Tell< D > &) |
Output operator. More... | |
template<typename D > | |
bool | operator== (const Ask_Tell< D > &x, const Ask_Tell< D > &y) |
template<typename D > | |
bool | operator!= (const Ask_Tell< D > &x, const Ask_Tell< D > &y) |
template<typename D > | |
void | swap (Ask_Tell< D > &x, Ask_Tell< D > &y) |
The ask and tell construction on a base-level domain.
This class offers a generic implementation of ask-and-tell constraint systems as defined in [Bag98].
Definition at line 106 of file Ask_Tell_defs.hh.
typedef const_iterator_to_const<Sequence> Parma_Polyhedra_Library::Ask_Tell< D >::const_iterator |
A bidirectional const_iterator on the disjuncts of a Powerset element.
Definition at line 229 of file Ask_Tell_defs.hh.
typedef std::reverse_iterator<const_iterator> Parma_Polyhedra_Library::Ask_Tell< D >::const_reverse_iterator |
The reverse iterator type built from Powerset::const_iterator.
Definition at line 235 of file Ask_Tell_defs.hh.
typedef iterator_to_const<Sequence> Parma_Polyhedra_Library::Ask_Tell< D >::iterator |
Alias for a read-only bidirectional iterator on the pairs an Ask_Tell object.
By using this iterator type, the pairs cannot be overwritten, but they can be removed using methods drop_pair(iterator position)
and drop_pairs(iterator first, iterator last)
, while still ensuring a correct handling of normalization.
Definition at line 226 of file Ask_Tell_defs.hh.
|
protected |
An ask-tell agent is composed of pairs.
Definition at line 190 of file Ask_Tell_defs.hh.
typedef std::reverse_iterator<iterator> Parma_Polyhedra_Library::Ask_Tell< D >::reverse_iterator |
The reverse iterator type built from Powerset::iterator.
Definition at line 232 of file Ask_Tell_defs.hh.
|
protected |
An ask-tell agent is implemented as a sequence of ask-tell pairs.
The particular sequence employed must support efficient deletion in any position and efficient back insertion.
Definition at line 197 of file Ask_Tell_defs.hh.
|
protected |
Alias for the low-level const_iterator on the pairs.
Definition at line 203 of file Ask_Tell_defs.hh.
|
protected |
Alias for the low-level iterator on the pairs.
Definition at line 200 of file Ask_Tell_defs.hh.
typedef Sequence::size_type Parma_Polyhedra_Library::Ask_Tell< D >::size_type |
Definition at line 213 of file Ask_Tell_defs.hh.
typedef Sequence::value_type Parma_Polyhedra_Library::Ask_Tell< D >::value_type |
Definition at line 214 of file Ask_Tell_defs.hh.
Parma_Polyhedra_Library::Ask_Tell< D >::Ask_Tell | ( | ) |
Default constructor: builds the top of the ask-and-tell constraint system (i.e., the empty system).
Definition at line 90 of file Ask_Tell_inlines.hh.
Parma_Polyhedra_Library::Ask_Tell< D >::Ask_Tell | ( | const Ask_Tell< D > & | y | ) |
Copy constructor.
Definition at line 95 of file Ask_Tell_inlines.hh.
|
explicit |
If p
is not top, builds an ask-and-tell system containing only p
. Builds the empty system otherwise.
Parma_Polyhedra_Library::Ask_Tell< D >::Ask_Tell | ( | const D & | ask, |
const D & | tell | ||
) |
If ask
and tell
do not constitute a top pair, builds an ask-and-tell system containing only that pair. Builds the empty system otherwise.
Definition at line 100 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::pair_insert().
|
inline |
|
protected |
Definition at line 106 of file Ask_Tell_templates.hh.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
Ask_Tell& Parma_Polyhedra_Library::Ask_Tell< D >::add_pair | ( | const Ask_Tell_Pair< D > & | p | ) |
Adds to *this
the pair p
.
Ask_Tell< D > & Parma_Polyhedra_Library::Ask_Tell< D >::add_pair | ( | const D & | ask, |
const D & | tell | ||
) |
Adds to *this
the pair constituted by ask
and tell
.
Definition at line 245 of file Ask_Tell_inlines.hh.
Ask_Tell< D >::iterator Parma_Polyhedra_Library::Ask_Tell< D >::begin | ( | ) |
Returns an iterator pointing to the first pair, if *this
is not empty; otherwise, returns the past-the-end iterator.
Definition at line 129 of file Ask_Tell_inlines.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_dump(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::concatenate_assign(), Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails(), Parma_Polyhedra_Library::Ask_Tell< D >::meet_assign(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
Ask_Tell< D >::const_iterator Parma_Polyhedra_Library::Ask_Tell< D >::begin | ( | ) | const |
Returns a const_iterator pointing to the first pair, if *this
is not empty; otherwise, returns the past-the-end const_iterator.
Definition at line 135 of file Ask_Tell_inlines.hh.
|
protected |
Does the hard work of checking whether *this
is normalized and returns true
if and only if it is.
Definition at line 33 of file Ask_Tell_templates.hh.
void Parma_Polyhedra_Library::Ask_Tell< D >::clear | ( | ) |
Drops all the pairs, making *this
an empty powerset.
|
protected |
Definition at line 157 of file Ask_Tell_templates.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::deduce(), Parma_Polyhedra_Library::Ask_Tell< D >::reduce(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
|
protected |
Definition at line 79 of file Ask_Tell_templates.hh.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::deabsorb(), and Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
bool Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails | ( | const Ask_Tell< D > & | y | ) | const |
Returns true
if *this
definitely entails y
. Returns false
if *this
may not entail y
(i.e., if *this
does not entail y
or if entailment could not be decided).
Definition at line 229 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Ask_Tell< D >::end(), and Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::operator==().
iterator Parma_Polyhedra_Library::Ask_Tell< D >::drop_pair | ( | iterator | position | ) |
Drops the pair in *this
pointed to by position
, returning an iterator to the pair following position
.
void Parma_Polyhedra_Library::Ask_Tell< D >::drop_pairs | ( | iterator | first, |
iterator | last | ||
) |
Drops all the pairs from first
to last
(excluded).
bool Parma_Polyhedra_Library::Ask_Tell< D >::empty | ( | ) | const |
Returns true
if and only if there are no pairs in *this
.
Definition at line 286 of file Ask_Tell_inlines.hh.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::meet_assign().
Ask_Tell< D >::iterator Parma_Polyhedra_Library::Ask_Tell< D >::end | ( | ) |
Returns the past-the-end iterator.
Definition at line 141 of file Ask_Tell_inlines.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_dump(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::concatenate_assign(), Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails(), Parma_Polyhedra_Library::Ask_Tell< D >::meet_assign(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
Ask_Tell< D >::const_iterator Parma_Polyhedra_Library::Ask_Tell< D >::end | ( | ) | const |
Returns the past-the-end const_iterator.
Definition at line 147 of file Ask_Tell_inlines.hh.
memory_size_type Parma_Polyhedra_Library::Ask_Tell< D >::external_memory_in_bytes | ( | ) | const |
Returns a lower bound to the size in bytes of the memory managed by *this
.
int32_t Parma_Polyhedra_Library::Ask_Tell< D >::hash_code | ( | ) | const |
Returns a 32-bit hash code for *this
.
If x
and y
are such that x == y
, then x.hash_code() == y.hash_code()
.
bool Parma_Polyhedra_Library::Ask_Tell< D >::is_bottom | ( | ) | const |
Returns true
if and only if *this
is the bottom element of the ask-and-tell constraint system (i.e., it represents the empty set).
Definition at line 275 of file Ask_Tell_inlines.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::map_space_dimensions().
|
protected |
Returns true
if and only if *this
is normalized.
Definition at line 220 of file Ask_Tell_inlines.hh.
bool Parma_Polyhedra_Library::Ask_Tell< D >::is_top | ( | ) | const |
Returns true
if and only if *this
is the top element of the ask-and-tell constraint system (i.e., it represents the universe).
Definition at line 269 of file Ask_Tell_inlines.hh.
|
inline |
Swaps *this
with y
.
Definition at line 122 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::swap().
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::swap().
void Parma_Polyhedra_Library::Ask_Tell< D >::meet_assign | ( | const Ask_Tell< D > & | y | ) |
Assigns to *this
the meet of *this
and y
.
Definition at line 292 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Ask_Tell< D >::empty(), and Parma_Polyhedra_Library::Ask_Tell< D >::end().
void Parma_Polyhedra_Library::Ask_Tell< D >::normalize | ( | ) | const |
Normalizes the pairs in *this
.
This method is declared const
because, even though normalization may change the syntactic representation of *this
, its semantics will be unchanged.
Definition at line 204 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::absorb(), Parma_Polyhedra_Library::Ask_Tell< D >::deduce(), and Parma_Polyhedra_Library::Ask_Tell< D >::reduce().
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails().
bool Parma_Polyhedra_Library::Ask_Tell< D >::OK | ( | ) | const |
Checks if all the invariants are satisfied.
Definition at line 218 of file Ask_Tell_templates.hh.
References Parma_Polyhedra_Library::Ask_Tell_Pair< D >::ask(), and Parma_Polyhedra_Library::Ask_Tell_Pair< D >::tell().
Ask_Tell< D > & Parma_Polyhedra_Library::Ask_Tell< D >::operator= | ( | const Ask_Tell< D > & | y | ) |
The assignment operator. (*this
and y
can be dimension-incompatible.)
Definition at line 114 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::normalized, and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.
|
protected |
Definition at line 191 of file Ask_Tell_inlines.hh.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::Ask_Tell(), and Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
|
protected |
Definition at line 183 of file Ask_Tell_inlines.hh.
|
protected |
Definition at line 304 of file Ask_Tell_inlines.hh.
Ask_Tell< D >::reverse_iterator Parma_Polyhedra_Library::Ask_Tell< D >::rbegin | ( | ) |
Returns a reverse_iterator pointing to the last pair, if *this
is not empty; otherwise, returns the before-the-start reverse_iterator.
Definition at line 153 of file Ask_Tell_inlines.hh.
Ask_Tell< D >::const_reverse_iterator Parma_Polyhedra_Library::Ask_Tell< D >::rbegin | ( | ) | const |
Returns a const_reverse_iterator pointing to the last pair, if *this
is not empty; otherwise, returns the before-the-start const_reverse_iterator.
Definition at line 159 of file Ask_Tell_inlines.hh.
|
protected |
Definition at line 56 of file Ask_Tell_templates.hh.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::deabsorb(), and Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
Ask_Tell< D >::reverse_iterator Parma_Polyhedra_Library::Ask_Tell< D >::rend | ( | ) |
Returns the before-the-start reverse_iterator.
Definition at line 165 of file Ask_Tell_inlines.hh.
Ask_Tell< D >::const_reverse_iterator Parma_Polyhedra_Library::Ask_Tell< D >::rend | ( | ) | const |
Returns the before-the-start const_reverse_iterator.
Definition at line 171 of file Ask_Tell_inlines.hh.
Ask_Tell< D >::size_type Parma_Polyhedra_Library::Ask_Tell< D >::size | ( | ) | const |
Returns the number of pairs.
Definition at line 177 of file Ask_Tell_inlines.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_dump().
memory_size_type Parma_Polyhedra_Library::Ask_Tell< D >::total_memory_in_bytes | ( | ) | const |
Returns a lower bound to the total size in bytes of the memory occupied by *this
.
void Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign | ( | const Ask_Tell< D > & | y | ) |
Assigns to *this
an upper bound of *this
and y
.
Definition at line 195 of file Ask_Tell_templates.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Ask_Tell< D >::deabsorb(), Parma_Polyhedra_Library::Ask_Tell< D >::end(), Parma_Polyhedra_Library::Ask_Tell< D >::pair_insert(), and Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
Returns true
if and only if x
and y
are not equivalent.
Definition at line 263 of file Ask_Tell_inlines.hh.
|
related |
Returns true
if and only if x
and y
are equivalent.
Definition at line 256 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails().
Definition at line 329 of file Ask_Tell_inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::m_swap().
|
mutableprotected |
If true
, *this
is normalized.
Definition at line 209 of file Ask_Tell_defs.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::concatenate_assign(), Parma_Polyhedra_Library::Ask_Tell< D >::m_swap(), Parma_Polyhedra_Library::Ask_Tell< D >::operator=(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell(), and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_space_dimensions().
|
protected |
The sequence container holding the pairs/.
Definition at line 206 of file Ask_Tell_defs.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraint(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraints(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_disjunct(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_embed(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_project(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::concatenate_assign(), Parma_Polyhedra_Library::Ask_Tell< D >::deabsorb(), Parma_Polyhedra_Library::Ask_Tell< D >::m_swap(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::map_space_dimensions(), Parma_Polyhedra_Library::Ask_Tell< D >::operator=(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_higher_space_dimensions(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_space_dimensions(), and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain().