UnCoVer (Using Coverability for Verification)
|
This enumerator can be used to enumerate all equivalences on IDs, where the equivalence closure of the enumerated IDPartition and a predefined IDPartition is the IDPartition, where every ID is in the same partition. More...
#include <IDClosureEnumerator.h>
Public Member Functions | |
IDClosureEnumerator (unordered_set< IDType > const &idSet, basic_types::IDPartition const &partition) | |
Generates a new IDClosureEnumerator for the given ID set and the given partition. More... | |
IDClosureEnumerator (IDClosureEnumerator &&oldEnum) | |
Move constructor. More... | |
virtual | ~IDClosureEnumerator () |
Destroys this instance of the enumerator. | |
bool | isValid () const |
Returns whether the enumerator is still valid or not. More... | |
bool | ended () const |
Return whether the enumerator has ended, i.e. More... | |
void | reset () |
Resets the computation of this enumerator, such that it will enumerate partitions beginning with the first again. More... | |
IDClosureEnumerator & | operator++ () |
Computes the next valid IDPartition. More... | |
basic_types::IDPartition const & | operator* () const |
Return the last computed IDPartition. More... | |
Private Member Functions | |
void | throwIfNotValid () const |
Checks if the enumerator is valid and throws an exception if it is not. | |
Private Attributes | |
basic_types::IDPartitionEnumerator * | enumerator |
Stores an enumerator to enumerate all possible IDPartitions. | |
const basic_types::IDPartition * | otherPart |
Stores the partition with which the equivalence closure will be formed. | |
bool | finished |
Stores whether the enumerator finished its computation or not. | |
Friends | |
std::ostream & | operator<< (std::ostream &ost, IDClosureEnumerator const &data) |
Prints the most important contents of the given IDClosureEnumerator. More... | |
This enumerator can be used to enumerate all equivalences on IDs, where the equivalence closure of the enumerated IDPartition and a predefined IDPartition is the IDPartition, where every ID is in the same partition.
IDClosureEnumerator | ( | unordered_set< IDType > const & | idSet, |
basic_types::IDPartition const & | partition | ||
) |
Generates a new IDClosureEnumerator for the given ID set and the given partition.
All enumerated partitions will be partitions on the given ID set. Every partition on the given ID set will be enumerated, if the equivalence closure of it and the given partition relates all its elements.
idSet | the set of IDs for which partitions will be enumerated |
partition | the partition with which the closure with the enumerated partition will be formed |
IDClosureEnumerator | ( | IDClosureEnumerator && | oldEnum | ) |
Move constructor.
Moves all computations and results of the given enumerator to this new enumerator, while invalidating the given enumerator. Calling functions of the old enumerator will probably throw exceptions.
oldEnum | the enumerator from which data will be (re)moved from |
bool ended | ( | ) | const |
Return whether the enumerator has ended, i.e.
the last IDPartition was enumerated. Throws an exception if enumerator is not valid.
bool isValid | ( | ) | const |
Returns whether the enumerator is still valid or not.
An IDClosureEnumerator is invalidated only by a call of the move constructor.
const IDPartition & operator* | ( | ) | const |
Return the last computed IDPartition.
Throws an exception if enumerator is not valid.
IDClosureEnumerator & operator++ | ( | ) |
Computes the next valid IDPartition.
Throws an exception if enumerator is not valid.
void reset | ( | ) |
Resets the computation of this enumerator, such that it will enumerate partitions beginning with the first again.
Throws an exception if enumerator is not valid.
|
friend |
Prints the most important contents of the given IDClosureEnumerator.
ost | the stream to which the data will be printed |
data | the enumerator which should be printed |