Functions

opennwa::construct Namespace Reference

Functions

NwaRefPtr complement (Nwa const &source)
 constructs the NWA that is the complement of the given NWA
void complement (Nwa &out, Nwa const &first)
 constructs the NWA that is the complement of the given NWA
NwaRefPtr concat (Nwa const &first, Nwa const &second)
 constructs the NWA resulting from the concatenation of the given NWAs
void concat (Nwa &out, Nwa const &first, Nwa const &second)
 constructs the NWA resulting from the concatenation of the given NWAs
void determinize (Nwa &out, Nwa const &source)
NwaRefPtr determinize (Nwa const &nondet)
 constructs a deterministic NWA that is equivalent to the given NWA.
void intersect (Nwa &out, Nwa const &first, Nwa const &second)
 constructs the NWA which is the intersection of the given NWAs
NwaRefPtr intersect (Nwa const &first, Nwa const &second)
 constructs the NWA which is the intersection of the given NWAs
NwaRefPtr reverse (Nwa const &source)
 constructs the NWA which is the reverse of the given NWA
void reverse (Nwa &out, Nwa const &first)
 constructs the NWA which is the reverse of the given NWA
void star (Nwa &out, Nwa const &source)
 constructs the NWA resulting from performing Kleene-* on the given NWA
NwaRefPtr star (Nwa const &nondet)
 constructs the NWA resulting from performing Kleene-* on the given NWA
NwaRefPtr unionNwa (Nwa const &first, Nwa const &second)
 constructs the NWA resulting from the union of the given NWAs
void unionNwa (Nwa &out, Nwa const &first, Nwa const &second)
 constructs the NWA resulting from the union of the given NWAs

Function Documentation

NwaRefPtr opennwa::construct::complement ( Nwa const &  source  ) 

constructs the NWA that is the complement of the given NWA

This method constructs the complement of the given NWA by determinizing it and then replacing the set of final states with the set of states that are not final Note: The resulting NWA is guaranteed to be deterministic.

Parameters:
- first: the NWA to perform the complement of
Returns:
the NWA resulting from complementing the given NWA

Referenced by main().

void opennwa::construct::complement ( Nwa &  out,
Nwa const &  first 
)

constructs the NWA that is the complement of the given NWA

Parameters:
- first: the NWA to perform the complement of

This method constructs the complement of the given NWA by determinizing it and then replacing the set of final states with the set of states that are not final Note: The resulting NWA is guaranteed to be deterministic.

Parameters:
- first: the NWA to perform the complement of
NwaRefPtr opennwa::construct::concat ( Nwa const &  first,
Nwa const &  second 
)

constructs the NWA resulting from the concatenation of the given NWAs

This method constructs the concatenation of the given NWAs by adding epsilon transitions from all final states of 'first' to all initial states of 'second'. Note: The resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to which 'second' should be concatenated
- second: the NWA to concatenate onto the end of 'first'
- stuck: dummy parameter
Returns:
the NWA resulting from the concatenation of the given NWAs

Referenced by main().

void opennwa::construct::concat ( Nwa &  out,
Nwa const &  first,
Nwa const &  second 
)

constructs the NWA resulting from the concatenation of the given NWAs

Parameters:
- first: the NWA to which 'second' should be concatenated
- second: the NWA to concatenate onto the end of 'first'

This method constructs the concatenation of the given NWAs by adding epsilon transitions from all final states of 'first' to all initial states of 'second'. Note: The resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to which 'second' should be concatenated
- second: the NWA to concatenate onto the end of 'first'
void opennwa::construct::determinize ( Nwa &  out,
Nwa const &  source 
)

Referenced by main().

NwaRefPtr opennwa::construct::determinize ( Nwa const &  nondet  ) 

constructs a deterministic NWA that is equivalent to the given NWA.

This method constructs a deterministic NWA that is equivalent to the given NWA. Note: The resulting NWA is guaranteed to be deterministic.

Parameters:
- nondet: the NWA to determinize
- stuck: dummy parameter
Returns:
the NWA resulting from determinizing the given NWA
void opennwa::construct::intersect ( Nwa &  out,
Nwa const &  first,
Nwa const &  second 
)

constructs the NWA which is the intersection of the given NWAs

This method constructs the NWA which accepts only nested words that are accepted by both 'first' and 'second'. Note: The resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to intersect with 'second'
- second: the NWA to intersect with 'first'

Referenced by opennwa::Nwa::_private_determinize_(), and main().

NwaRefPtr opennwa::construct::intersect ( Nwa const &  first,
Nwa const &  second 
)

constructs the NWA which is the intersection of the given NWAs

This method constructs the NWA which accepts only nested words that are accepted by both 'first' and 'second'. Note: The resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to intersect with 'second'
- second: the NWA to intersect with 'first'
Returns:
the NWA resulting from the intersection of the given NWAs
NwaRefPtr opennwa::construct::reverse ( Nwa const &  source  ) 

constructs the NWA which is the reverse of the given NWA

This method constructs the NWA which is the reverse of the given NWA. It reverses internal transitions and switches call and return transitions. Note: the resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to reverse
- stuck: dummy parameter
Returns:
the NWA resulting from reversing the given NWA

Referenced by main().

void opennwa::construct::reverse ( Nwa &  out,
Nwa const &  first 
)

constructs the NWA which is the reverse of the given NWA

Parameters:
- first: the NWA to reverse

This method constructs the NWA which is the reverse of the given NWA. It reverses internal transitions and switches call and return transitions. Note: the resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to reverse
void opennwa::construct::star ( Nwa &  out,
Nwa const &  source 
)

constructs the NWA resulting from performing Kleene-* on the given NWA

This method constructs the Kleene-* of the given NWA by adding epsilon transitions from all final states of the NWA to all initial states of the NWA. Note: The resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to perform the Kleene-* of

Referenced by main().

NwaRefPtr opennwa::construct::star ( Nwa const &  nondet  ) 

constructs the NWA resulting from performing Kleene-* on the given NWA

This method constructs the Kleene-* of the given NWA by adding epsilon transitions from all final states of the NWA to all initial states of the NWA. Note: The resulting NWA is NOT guaranteed to be deterministic.

Parameters:
- first: the NWA to perform the Kleene-* of
- stuck: dummy parameter
Returns:
the NWA resulting from performing Kleene-* on the given NWA
NwaRefPtr opennwa::construct::unionNwa ( Nwa const &  first,
Nwa const &  second 
)

constructs the NWA resulting from the union of the given NWAs

This method constructs the union of the given NWAs by unioning the state sets, symbols, transitions, initial state sets, and final state sets of the two NWAs. Note: The resulting NWA is guaranteed NOT to be deterministic.

Parameters:
- first: the NWA to union with 'second'
- second: the NWA to union with 'first'
- stuck: dummy variable
Returns:
the NWA resulting from the union of the given NWAs
void opennwa::construct::unionNwa ( Nwa &  out,
Nwa const &  first,
Nwa const &  second 
)

constructs the NWA resulting from the union of the given NWAs

Parameters:
- first: the NWA to union with 'second'
- second: the NWA to union with 'first'

This method constructs the union of the given NWAs by unioning the state sets, symbols, transitions, initial state sets, and final state sets of the two NWAs. Note: The resulting NWA is guaranteed NOT to be deterministic.

Parameters:
- first: the NWA to union with 'second'
- second: the NWA to union with 'first'