This class is used to label the transitions of an NWA. More...
Public Types | |
typedef Symbol | Sym |
typedef std::set< Sym > ::const_iterator | const_iterator |
Public Member Functions | |
Label () | |
Label (const Label &other) | |
Label & | operator= (const Label &other) |
bool | isWild (const SymbolStorage &symbolPool) const |
tests whether this collection represents the wild symbol | |
void | makeWild () |
make this collection represent wild | |
bool | isAbsent (const SymbolStorage &symbolPool) const |
tests whether this collection represents the absence of all symbols | |
void | makeAbsent () |
make this collection represent the absence of all symbols | |
bool | containsSymbol (Sym sym) const |
tests whether the given symbol is a member of this collection | |
Sym | getAnySymbol (const SymbolStorage &symbolPool) const |
provides access to some symbol in this collection | |
bool | addSymbol (Sym sym) |
add the given symbol | |
void | addAll (Label lbl, const SymbolStorage &symbolPool) |
add all the symbols in the given collection to this collection | |
bool | removeSymbol (Sym sym) |
remove the given symbol | |
void | removeAll (Label lbl, const SymbolStorage &symbolPool) |
remove all the symbols in the given collection from this collection | |
std::ostream & | print (std::ostream &o, const SymbolStorage &symbolPool) const |
print the collection of symbols | |
bool | operator== (const Label &other) const |
tests whether this collection of symbols is equivalent to the collection of symbols 'other' | |
const std::set< Sym > | getSymbolsIn (const SymbolStorage &symbolPool) const |
provides access to all symbols in the collection | |
const std::set< Sym > | getSymbolsNotIn (const SymbolStorage &symbolPool) const |
provides access to all symbols not in the collection | |
size_t | sizeSymbolsIn (const SymbolStorage &symbolPool) const |
returns the number of symbols in this collection | |
size_t | sizeSymbolsNotIn (const SymbolStorage &symbolPool) const |
returns the number of symbols not in this collection | |
Protected Attributes | |
std::set< Sym > | syms |
bool | neg |
This class is used to label the transitions of an NWA.
typedef Symbol opennwa::details::Label::Sym |
typedef std::set<Sym>::const_iterator opennwa::details::Label::const_iterator |
opennwa::details::Label::Label | ( | ) |
References neg.
bool opennwa::details::Label::isWild | ( | const SymbolStorage & | symbolPool | ) | const |
tests whether this collection represents the wild symbol
This method determines whether this collection represents the wild symbol. It returns true if the collection represents the wild symbol.
The Label is wild if syms is empty and neg is true ( {}, T ) or syms is equal to the symbolPool and neg is false ( symbolPool, F }.
References opennwa::details::SymbolStorage::beginSymbols(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.
Referenced by print().
void opennwa::details::Label::makeWild | ( | ) |
bool opennwa::details::Label::isAbsent | ( | const SymbolStorage & | symbolPool | ) | const |
tests whether this collection represents the absence of all symbols
This method determines whether this collection represents the absence of all symbols. It returns true if the collection represents the absence of all symbols.
The Label is absent if syms is empty and neg is false ( {}, F ) or syms is equal to the symbolPool and neg is true ( symbolPool, T ).
References opennwa::details::SymbolStorage::beginSymbols(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.
Referenced by print().
void opennwa::details::Label::makeAbsent | ( | ) |
bool opennwa::details::Label::containsSymbol | ( | Sym | sym | ) | const |
tests whether the given symbol is a member of this collection
This method determines whether the given symbol is a member of this collection. It returns true if the symbol is a member and false otherwise.
- | sym: the symbol to test |
- | sym: the symbol to test |
References wali::relations::count, neg, and syms.
Referenced by addAll(), addSymbol(), getSymbolsIn(), getSymbolsNotIn(), operator==(), removeAll(), and removeSymbol().
Label::Sym opennwa::details::Label::getAnySymbol | ( | const SymbolStorage & | symbolPool | ) | const |
provides access to some symbol in this collection
This method provides access to some symbol in this collection.
References opennwa::details::SymbolStorage::beginSymbols(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.
bool opennwa::details::Label::addSymbol | ( | Sym | sym | ) |
add the given symbol
This method adds the given symbol. If the symbol already exists, false is returned. Otherwise, true is returned.
- | sym: the symbol to add |
- | sym: the symbol to add |
References containsSymbol(), neg, and syms.
Referenced by addAll().
void opennwa::details::Label::addAll | ( | Label | lbl, | |
const SymbolStorage & | symbolPool | |||
) |
add all the symbols in the given collection to this collection
This method adds all of the symbols in the given collection of symbols to this collection of symbols.
- | symSet: the collection of symbols to add to this collection of symbols | |
- | symSet: the collection of symbols to add to this collection of symbols |
References addSymbol(), opennwa::details::SymbolStorage::beginSymbols(), containsSymbol(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.
bool opennwa::details::Label::removeSymbol | ( | Sym | sym | ) |
remove the given symbol
This method removes the given symbol. If the symbol does not exist, false is returned. Otherwise, true is returned.
- | sym: the symbol to remove |
- | sym: the symbol to remove |
References containsSymbol(), neg, and syms.
Referenced by removeAll().
void opennwa::details::Label::removeAll | ( | Label | lbl, | |
const SymbolStorage & | symbolPool | |||
) |
remove all the symbols in the given collection from this collection
This method removes all of the symbols in the given collection of symbols from this collection of symbols.
- | symSet: the collection of symbols to remove from this collection | |
- | symSet: the collection of symbols to remove from this collection |
References opennwa::details::SymbolStorage::beginSymbols(), containsSymbol(), opennwa::details::SymbolStorage::endSymbols(), neg, removeSymbol(), and syms.
std::ostream & opennwa::details::Label::print | ( | std::ostream & | o, | |
const SymbolStorage & | symbolPool | |||
) | const |
print the collection of symbols
This method prints out the symbol set to the output stream provided.
- | o: the output stream to print to |
- | o: the output stream to print to |
References opennwa::EPSILON, isAbsent(), isWild(), neg, wali::printKey(), and syms.
bool opennwa::details::Label::operator== | ( | const Label & | other | ) | const |
tests whether this collection of symbols is equivalent to the collection of symbols 'other'
This method tests the equivalence of this set of symbols and the set of symbols 'other'.
- | other: the SymbolStorage to which to compare this SymbolStorage |
References containsSymbol(), neg, and syms.
const std::set< Label::Sym > opennwa::details::Label::getSymbolsIn | ( | const SymbolStorage & | symbolPool | ) | const |
provides access to all symbols in the collection
This method provides access to all symbols in the collection in the form of a set of symbols.
References opennwa::details::SymbolStorage::beginSymbols(), containsSymbol(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.
const std::set< Label::Sym > opennwa::details::Label::getSymbolsNotIn | ( | const SymbolStorage & | symbolPool | ) | const |
provides access to all symbols not in the collection
This method provides access to all symbols not in the collection in the form of a set of symbols.
References opennwa::details::SymbolStorage::beginSymbols(), containsSymbol(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.
size_t opennwa::details::Label::sizeSymbolsIn | ( | const SymbolStorage & | symbolPool | ) | const |
returns the number of symbols in this collection
This method returns the number of symbols in this collection.
References neg, opennwa::details::SymbolStorage::sizeSymbols(), and syms.
size_t opennwa::details::Label::sizeSymbolsNotIn | ( | const SymbolStorage & | symbolPool | ) | const |
returns the number of symbols not in this collection
This method returns the number of symbols not in this collection.
References neg, opennwa::details::SymbolStorage::sizeSymbols(), and syms.
std::set<Sym> opennwa::details::Label::syms [protected] |
bool opennwa::details::Label::neg [protected] |