Public Types | Public Member Functions | Protected Attributes

opennwa::details::Label Class Reference

This class is used to label the transitions of an NWA. More...

List of all members.

Public Types

typedef Symbol Sym
typedef std::set< Sym >
::const_iterator 
const_iterator

Public Member Functions

 Label ()
 Label (const Label &other)
Labeloperator= (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< SymgetSymbolsIn (const SymbolStorage &symbolPool) const
 provides access to all symbols in the collection
const std::set< SymgetSymbolsNotIn (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< Symsyms
bool neg

Detailed Description

This class is used to label the transitions of an NWA.


Member Typedef Documentation


Constructor & Destructor Documentation

opennwa::details::Label::Label (  ) 

References neg.

opennwa::details::Label::Label ( const Label other  ) 

References neg, and syms.


Member Function Documentation

Label & opennwa::details::Label::operator= ( const Label other  ) 

References neg, and syms.

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.

Returns:
true if this 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 }.

Returns:
true if this collection represents the wild symbol

References opennwa::details::SymbolStorage::beginSymbols(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.

Referenced by print().

void opennwa::details::Label::makeWild (  ) 

make this collection represent wild

This method erases any symbols currently in this collection and converts the collection to represent the wild symbol.

The Label is wild if syms is empty and neg is true ( {}, T ).

References neg, and syms.

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.

Returns:
true if this 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 ).

Returns:
true if this collection represents the absence of all symbols

References opennwa::details::SymbolStorage::beginSymbols(), opennwa::details::SymbolStorage::endSymbols(), neg, and syms.

Referenced by print().

void opennwa::details::Label::makeAbsent (  ) 

make this collection represent the absence of all symbols

This method erases any symbols currently in this collection and converts the collection to represent the absence of all symbols.

The Label is absent if syms is empty and neg is false ( {}, F )

References neg, and syms.

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.

Parameters:
- sym: the symbol to test
Returns:
true if the symbol is a member of this collection of symbols
Parameters:
- sym: the symbol to test
Returns:
true if the symbol is a member of this collection of states

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.

Returns:
some symbol in this collection of symbols
some symbol in this collection of symbols

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.

Parameters:
- sym: the symbol to add
Returns:
false if the symbol already exists, true otherwise
Parameters:
- sym: the symbol to add
Returns:
false if the symbol already exists, true otherwise

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.

Parameters:
- 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.

Parameters:
- sym: the symbol to remove
Returns:
false if the symbol does not exist, true otherwise
Parameters:
- sym: the symbol to remove
Returns:
false if the symbol does not exist, true otherwise

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.

Parameters:
- 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.

Parameters:
- o: the output stream to print to
Returns:
the output stream that was printed to
Parameters:
- o: the output stream to print to
Returns:
the output stream that was printed 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'.

Parameters:
- other: the SymbolStorage to which to compare this SymbolStorage
Returns:
true if this SymbolStorage is equivalent to the SymbolStorage 'other'
Parameters:
- other: the Label to which to compare this Label
Returns:
true if this Label is equivalent to the Label 'other'

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.

Returns:
a set containing all symbols in this collection
a set containing all symbols in this collection

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.

Returns:
a set containing all symbols not in this collection
a set containing all symbols not in this collection

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.

Returns:
the number of symbols in this collection
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.

Returns:
the number of symbols not in this collection
the number of symbols not in this collection

References neg, opennwa::details::SymbolStorage::sizeSymbols(), and syms.


Member Data Documentation

std::set<Sym> opennwa::details::Label::syms [protected]
bool opennwa::details::Label::neg [protected]

The documentation for this class was generated from the following files: