|
PPL
0.12.1
|
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. | |
| typedef const_iterator_to_const < Sequence > | const_iterator |
| A bidirectional const_iterator on the disjuncts of a Powerset element. | |
| typedef std::reverse_iterator < iterator > | reverse_iterator |
| The reverse iterator type built from Powerset::iterator. | |
| typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
| The reverse iterator type built from Powerset::const_iterator. | |
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). | |
| Ask_Tell (const Ask_Tell &y) | |
| Copy constructor. | |
| 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. | |
| 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. | |
| ~Ask_Tell () | |
| Destructor. | |
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). | |
| 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). | |
| 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). | |
| memory_size_type | total_memory_in_bytes () const |
Returns a lower bound to the total size in bytes of the memory occupied by *this. | |
| memory_size_type | external_memory_in_bytes () const |
Returns a lower bound to the size in bytes of the memory managed by *this. | |
| int32_t | hash_code () const |
Returns a 32-bit hash code for *this. | |
| bool | OK () const |
| Checks if all the invariants are satisfied. | |
Member Functions for the Direct Manipulation of Pairs | |
| void | normalize () const |
Normalizes the pairs in *this. | |
| size_type | size () const |
| Returns the number of pairs. | |
| bool | empty () const |
Returns true if and only if there are no pairs in *this. | |
| iterator | begin () |
Returns an iterator pointing to the first pair, if *this is not empty; otherwise, returns the past-the-end iterator. | |
| iterator | end () |
| Returns the past-the-end iterator. | |
| 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. | |
| const_iterator | end () const |
| Returns the past-the-end const_iterator. | |
| 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. | |
| reverse_iterator | rend () |
| Returns the before-the-start reverse_iterator. | |
| 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. | |
| const_reverse_iterator | rend () const |
| Returns the before-the-start const_reverse_iterator. | |
| Ask_Tell & | add_pair (const Ask_Tell_Pair< D > &p) |
Adds to *this the pair p. | |
| Ask_Tell & | add_pair (const D &ask, const D &tell) |
Adds to *this the pair constituted by ask and tell. | |
| iterator | drop_pair (iterator position) |
Drops the pair in *this pointed to by position, returning an iterator to the pair following position. | |
| void | drop_pairs (iterator first, iterator last) |
Drops all the pairs from first to last (excluded). | |
| void | clear () |
Drops all the pairs, making *this an empty powerset. | |
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.) | |
| void | m_swap (Ask_Tell &y) |
Swaps *this with y. | |
| void | upper_bound_assign (const Ask_Tell &y) |
Assigns to *this an upper bound of *this and y. | |
| void | meet_assign (const Ask_Tell &y) |
Assigns to *this the meet of *this and y. | |
Protected Types | |
| typedef Ask_Tell_Pair< D > | Pair |
| An ask-tell agent is composed of pairs. | |
| typedef std::list < Ask_Tell_Pair< D > > | Sequence |
| An ask-tell agent is implemented as a sequence of ask-tell pairs. | |
| typedef Sequence::iterator | Sequence_iterator |
| Alias for the low-level iterator on the pairs. | |
| typedef Sequence::const_iterator | Sequence_const_iterator |
| Alias for the low-level const_iterator on the pairs. | |
Protected Member Functions | |
| bool | is_normalized () const |
Returns true if and only if *this is normalized. | |
| 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. | |
| bool | probe (const D &tellv, const D &askv) const |
Protected Attributes | |
| Sequence | sequence |
| The sequence container holding the pairs/. | |
| bool | normalized |
If true, *this is normalized. | |
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. | |
| 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. | |
| 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. | |
| template<typename D > | |
| std::ostream & | operator<< (std::ostream &, const Ask_Tell< D > &) |
| Output operator. | |
| 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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
Definition at line 226 of file Ask_Tell.defs.hh.
|
protected |
An ask-tell agent is composed of pairs.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
Definition at line 197 of file Ask_Tell.defs.hh.
|
protected |
Alias for the low-level const_iterator on the pairs.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
Definition at line 203 of file Ask_Tell.defs.hh.
|
protected |
Alias for the low-level iterator on the pairs.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
Definition at line 200 of file Ask_Tell.defs.hh.
| typedef Sequence::size_type Parma_Polyhedra_Library::Ask_Tell< D >::size_type |
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
Definition at line 213 of file Ask_Tell.defs.hh.
| typedef Sequence::value_type Parma_Polyhedra_Library::Ask_Tell< D >::value_type |
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
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 87 of file Ask_Tell.inlines.hh.
: sequence(), normalized(true) { }
| Parma_Polyhedra_Library::Ask_Tell< D >::Ask_Tell | ( | const Ask_Tell< D > & | y | ) |
Copy constructor.
Definition at line 92 of file Ask_Tell.inlines.hh.
: sequence(y.sequence), normalized(y.normalized) { }
|
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 97 of file Ask_Tell.inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::pair_insert().
: sequence(), normalized(true) { if (!tell.is_top()) pair_insert(ask, tell); }
|
inline |
|
protected |
Definition at line 101 of file Ask_Tell.templates.hh.
References PPL_ASSERT_HEAVY.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
{
bool changed = false;
for (Sequence_iterator x_begin = sequence.begin(),
x_end = sequence.end(), xi = x_begin; xi != x_end; ) {
D& xi_ask = xi->ask();
D& xi_tell = xi->tell();
// We may strengthen the ask component of the pair referenced by `xi'.
// If we do it, the pair may become useless (i.e., with the ask
// component entailing the tell component) and thus to be
// discarded.
bool must_check_xi_pair = false;
bool ask_changed;
do {
ask_changed = false;
for (Sequence_iterator yi = x_begin; yi != x_end; ++yi) {
if (xi != yi) {
D& yi_ask = yi->ask();
D& yi_tell = yi->tell();
if (xi_ask.definitely_entails(yi_ask)
&& !xi_ask.definitely_entails(yi_tell)) {
xi_ask.meet_assign(yi_tell);
must_check_xi_pair = true;
ask_changed = true;
}
}
}
} while (ask_changed);
if (must_check_xi_pair) {
changed = true;
if (xi_ask.definitely_entails(xi_tell)) {
xi = sequence.erase(xi);
x_begin = sequence.begin();
x_end = sequence.end();
}
else
++xi;
}
else
++xi;
}
if (changed)
(void) reduce();
PPL_ASSERT_HEAVY(OK());
return changed;
}
| 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 238 of file Ask_Tell.inlines.hh.
References PPL_ASSERT_HEAVY.
{
if (!ask.definitely_entails(tell))
pair_insert(ask, tell);
PPL_ASSERT_HEAVY(OK());
return *this;
}
| 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 125 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().
{
return sequence.begin();
}
| 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 131 of file Ask_Tell.inlines.hh.
{
return sequence.begin();
}
|
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.
{
for (const_iterator x_begin = begin(),
x_end = end(), xi = x_begin; xi != x_end; ++xi)
for (const_iterator yi = x_begin; yi != x_end; ++yi)
if (xi != yi) {
if (xi->tell().definitely_entails(yi->tell())) {
if (yi->ask().definitely_entails(xi->ask()))
return false;
}
else if (xi->tell().definitely_entails(yi->ask()))
return false;
if (xi->ask().definitely_entails(yi->ask())
&& !xi->ask().definitely_entails(yi->tell()))
return false;
}
return true;
}
| void Parma_Polyhedra_Library::Ask_Tell< D >::clear | ( | ) |
Drops all the pairs, making *this an empty powerset.
|
protected |
Definition at line 149 of file Ask_Tell.templates.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::deduce(), PPL_ASSERT_HEAVY, 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().
{
if (D::has_nontrivial_weakening()) {
Sequence new_sequence;
for (Sequence_const_iterator x_begin = sequence.begin(),
x_end = sequence.end(), xi = x_begin; xi != x_end; ++xi)
for (Sequence_const_iterator yi = x_begin; yi != x_end; ++yi) {
if (xi != yi) {
const D& xi_ask = xi->ask();
const D& yi_ask = yi->ask();
if (xi_ask.definitely_entails(yi_ask)) {
D new_ask = xi_ask;
new_ask.weakening_assign(yi->tell());
new_ask.meet_assign(yi_ask);
if (!new_ask.definitely_entails(xi_ask))
new_sequence.push_back(Pair(new_ask, xi->tell()));
}
}
}
if (!new_sequence.empty()) {
Ask_Tell& x = const_cast<Ask_Tell&>(*this);
std::copy(new_sequence.begin(), new_sequence.end(),
back_inserter(x.sequence));
x.reduce();
x.deduce();
normalized = false;
}
}
else if (!normalized) {
Ask_Tell& x = const_cast<Ask_Tell&>(*this);
x.reduce();
x.deduce();
}
PPL_ASSERT_HEAVY(OK());
}
|
protected |
Definition at line 75 of file Ask_Tell.templates.hh.
References PPL_ASSERT_HEAVY.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::deabsorb(), and Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
{
bool changed = false;
for (Sequence_iterator x_begin = sequence.begin(),
x_end = sequence.end(), xi = x_begin; xi != x_end; ++xi) {
D& xi_tell = xi->tell();
bool tell_changed;
do {
tell_changed = false;
for (Sequence_iterator yi = x_begin; yi != x_end; ++yi) {
if (xi != yi
&& xi_tell.definitely_entails(yi->ask())
&& !xi_tell.definitely_entails(yi->tell())) {
xi_tell.meet_assign(yi->tell());
changed = tell_changed = true;
}
}
} while (tell_changed);
}
if (changed)
(void) reduce();
PPL_ASSERT_HEAVY(OK());
return changed;
}
| 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 222 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==().
{
const Ask_Tell<D>& x = *this;
x.normalize();
y.normalize();
bool found = true;
for (const_iterator x_begin = x.begin(), x_end = x.end(), y_end = y.end(),
yi = y.begin(); found && yi != y_end; ++yi) {
found = false;
for (const_iterator xi = x_begin; !found && xi != x_end; ++xi)
found = xi->definitely_entails(*yi);
}
return found;
}
| 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 278 of file Ask_Tell.inlines.hh.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::meet_assign().
{
return sequence.empty();
}
| Ask_Tell< D >::iterator Parma_Polyhedra_Library::Ask_Tell< D >::end | ( | ) |
Returns the past-the-end iterator.
Definition at line 137 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().
{
return sequence.end();
}
| Ask_Tell< D >::const_iterator Parma_Polyhedra_Library::Ask_Tell< D >::end | ( | ) | const |
Returns the past-the-end const_iterator.
Definition at line 143 of file Ask_Tell.inlines.hh.
{
return sequence.end();
}
| 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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
| 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().
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
| 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 267 of file Ask_Tell.inlines.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::map_space_dimensions().
{
// Must normalize for correctness.
const_iterator xi = begin();
const_iterator x_end = end();
return xi != x_end
&& xi->ask().is_top() && xi->tell().is_bottom()
&& ++xi == x_end;
}
|
protected |
Returns true if and only if *this is normalized.
Definition at line 214 of file Ask_Tell.inlines.hh.
{
if (!normalized && check_normalized())
normalized = true;
return normalized;
}
| 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 261 of file Ask_Tell.inlines.hh.
{
return sequence.empty();
}
|
inline |
Swaps *this with y.
Definition at line 118 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().
{
swap(sequence, y.sequence);
swap(normalized, y.normalized);
}
| 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 284 of file Ask_Tell.inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Ask_Tell< D >::empty(), Parma_Polyhedra_Library::Ask_Tell< D >::end(), and PPL_ASSERT_HEAVY.
{
if (!y.empty()) {
std::copy(y.begin(), y.end(), back_inserter(sequence));
normalized = false;
}
PPL_ASSERT_HEAVY(OK());
}
| 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 199 of file Ask_Tell.inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::absorb(), Parma_Polyhedra_Library::Ask_Tell< D >::deduce(), PPL_ASSERT_HEAVY, and Parma_Polyhedra_Library::Ask_Tell< D >::reduce().
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails().
{
if (normalized)
return;
Ask_Tell& x = const_cast<Ask_Tell&>(*this);
x.reduce();
x.deduce();
x.absorb();
normalized = true;
PPL_ASSERT_HEAVY(OK());
}
| bool Parma_Polyhedra_Library::Ask_Tell< D >::OK | ( | ) | const |
Checks if all the invariants are satisfied.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
Definition at line 208 of file Ask_Tell.templates.hh.
References Parma_Polyhedra_Library::Ask_Tell_Pair< D >::ask(), and Parma_Polyhedra_Library::Ask_Tell_Pair< D >::tell().
{
for (typename Ask_Tell<D>::const_iterator xi = begin(),
x_end = end(); xi != x_end; ++xi) {
const Ask_Tell_Pair<D>& p = *xi;
if (!p.ask().OK())
return false;
if (!p.tell().OK())
return false;
if (p.ask().definitely_entails(p.tell())) {
#ifndef NDEBUG
using namespace IO_Operators;
std::cerr << "Illegal agent in ask-and-tell: "
<< p.ask() << " -> " << p.tell()
<< std::endl;
#endif
return false;
}
}
if (normalized && !check_normalized()) {
#ifndef NDEBUG
std::cerr << "Ask_Tell claims to be normalized, but it is not!"
<< std::endl;
#endif
return false;
}
return true;
}
| 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 110 of file Ask_Tell.inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::normalized, and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.
{
sequence = y.sequence;
normalized = y.normalized;
return *this;
}
|
protected |
Definition at line 187 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().
{
if (tell.definitely_entails(ask))
pair_insert_good(ask, tell);
else {
D new_tell = tell;
new_tell.meet_assign(ask);
pair_insert_good(ask, new_tell);
}
}
|
protected |
Definition at line 179 of file Ask_Tell.inlines.hh.
References PPL_ASSERT_HEAVY.
{
PPL_ASSERT_HEAVY(!ask.definitely_entails(tell));
sequence.push_back(Ask_Tell_Pair<D>(ask, tell));
normalized = false;
}
|
protected |
Definition at line 296 of file Ask_Tell.inlines.hh.
{
const_iterator yi;
bool tell_changed;
D xtell(tell);
tell_changed = true;
while (tell_changed) {
tell_changed = false;
for (yi = begin(); yi != end(); ++yi) {
if (xtell.definitely_entails(yi->ask())
&& !xtell.definitely_entails(yi->tell())) {
xtell.meet_assign(yi->tell());
if (xtell.definitely_entails(ask))
return true;
tell_changed = true;
}
}
}
return false;
}
| 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 149 of file Ask_Tell.inlines.hh.
{
return sequence.rbegin();
}
| 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 155 of file Ask_Tell.inlines.hh.
{
return sequence.rbegin();
}
|
protected |
Definition at line 53 of file Ask_Tell.templates.hh.
References PPL_ASSERT_HEAVY.
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::deabsorb(), and Parma_Polyhedra_Library::Ask_Tell< D >::normalize().
{
bool changed = false;
for (Sequence_iterator x_begin = sequence.begin(),
x_end = sequence.end(), xi = x_begin; xi != x_end; ++xi)
for (Sequence_iterator yi = x_begin; yi != x_end; ) {
if (xi != yi
&& yi->ask().definitely_entails(xi->ask())
&& xi->tell().definitely_entails(yi->tell())) {
yi = sequence.erase(yi);
x_begin = sequence.begin();
x_end = sequence.end();
changed = true;
}
else
++yi;
}
PPL_ASSERT_HEAVY(OK());
return changed;
}
| Ask_Tell< D >::reverse_iterator Parma_Polyhedra_Library::Ask_Tell< D >::rend | ( | ) |
Returns the before-the-start reverse_iterator.
Definition at line 161 of file Ask_Tell.inlines.hh.
{
return sequence.rend();
}
| 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 167 of file Ask_Tell.inlines.hh.
{
return sequence.rend();
}
| Ask_Tell< D >::size_type Parma_Polyhedra_Library::Ask_Tell< D >::size | ( | ) | const |
Returns the number of pairs.
Definition at line 173 of file Ask_Tell.inlines.hh.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_dump().
{
return sequence.size();
}
| 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.
Reimplemented in Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >.
| 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 186 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(), PPL_ASSERT_HEAVY, and Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
Referenced by Parma_Polyhedra_Library::Ask_Tell< D >::upper_bound_assign().
{
const Ask_Tell& x = *this;
x.deabsorb();
y.deabsorb();
Ask_Tell<D> z;
for (typename Ask_Tell<D>::const_iterator xi = x.begin(),
x_end = x.end(); xi != x_end; ++xi)
for (typename Ask_Tell<D>::const_iterator yi = y.begin(),
y_end = y.end(); yi != y_end; ++yi) {
D tell = xi->tell();
tell.upper_bound_assign(yi->tell());
D ask = xi->ask();
ask.meet_assign(yi->ask());
if (!ask.definitely_entails(tell))
z.pair_insert(ask, tell);
}
*this = z;
PPL_ASSERT_HEAVY(OK());
}
Returns true if and only if x and y are not equivalent.
Definition at line 255 of file Ask_Tell.inlines.hh.
{
return !(x == y);
}
|
related |
Output operator.
Definition at line 240 of file Ask_Tell.templates.hh.
{
if (x.is_top())
s << "true";
else if (x.is_bottom())
s << "false";
else
for (typename Ask_Tell<D>::const_iterator xi = x.begin(),
x_end = x.end(); xi != x_end; ++xi)
s << "(" << xi->ask() << " -> " << xi->tell() << ")";
return s;
}
Returns true if and only if x and y are equivalent.
Definition at line 248 of file Ask_Tell.inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::definitely_entails().
{
return x.definitely_entails(y) && y.definitely_entails(x);
}
Definition at line 320 of file Ask_Tell.inlines.hh.
References Parma_Polyhedra_Library::Ask_Tell< D >::m_swap().
{
x.m_swap(y);
}
|
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().