Operations on Generators


Detailed Description

This module collects general purpose functions on Generators.

It includes functions related to regular expressions, projection, parallel composition and basic controller synthesis.


Functions

void faudes::Parallel (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Parallel composition.
void faudes::SParallel (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Shared event parallel composition.
void faudes::UniqueInit (vGenerator &rGen)
 Make initial states unique.
void faudes::Deterministic (const vGenerator &rGen, vGenerator &rResGen)
 Make generator deterministic.
void faudes::ProjectNonDet (vGenerator &rGen, const EventSet &rProjectAlphabet)
 Language projection.
void faudes::Project (const vGenerator &rGen, const EventSet &rProjectAlphabet, vGenerator &rResGen)
 Minimized deterministic projection.
void faudes::LanguageUnionNonDet (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Language union, nondeterministic version: This function performs the union of two languages marked by two generators; the resulting generator marks the resulting language.
void faudes::LanguageUnion (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Language union, deterministic version: This function performs the union of two languages marked by two generators; the resulting generator marks the resulting language.
void faudes::LanguageIntersection (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Language intersection: This function performs the intersection of two languages marked by two generators; the resulting generator marks the resulting language.
bool faudes::EmptyLanguageIntersection (const vGenerator &rGen1, const vGenerator &rGen2)
 Empty language intersection: This function checks if the intersection of two languages marked by two generators is empty that is the two languages are disjoint.
bool faudes::LanguageDisjoint (const vGenerator &rGen1, const vGenerator &rGen2)
 Disjoint: This function checks if the intersection of two languages marked by two generators is empty, ie the two languages are disjoint.
void faudes::Automaton (vGenerator &rGen)
 Automaton wrt generator alphabet: Convert a generator marking the language Lm into a formal automaton recognizing Lm with a dump state representing Sigma*-PrefixClosure(Lm).
void faudes::Automaton (vGenerator &rGen, const EventSet &rAlphabet)
 Automaton wrt alphabet: Convert a generator marking the language Lm into a formal automaton recognizing Lm with a dump state representing Sigma*-PrefixClosure(Lm).
void faudes::LanguageComplement (vGenerator &rGen)
 Language complement wrt generator alphabet: Convert generator marking the language Lm into generator marking the language complement of Lm which is defined as Sigma*-Lm.
void faudes::LanguageComplement (vGenerator &rGen, const EventSet &rAlphabet)
 Language complement wrt alphabet: Convert generator marking the language Lm into generator marking the language complement of Lm which is defined as Sigma*-Lm.
void faudes::LanguageConcatenateNonDet (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Language Concatenation, nondeterministic version: With the languages Lm1 and Lm2 marked by rGen1 and rGen2, respectively, the result rResGen marks the concatenation LmRes=Lm1Lm2.
void faudes::LanguageConcatenate (const vGenerator &rGen1, const vGenerator &rGen2, vGenerator &rResGen)
 Language Concatenation, deterministic version: With the languages Lm1 and Lm2 marked by rGen1 and rGen2, respectively, the result rResGen marks the concatenation LmRes=Lm1Lm2.
void faudes::FullLanguage (const EventSet &rAlphabet, vGenerator &rResGen)
 Full Language: Construct generator generating and marking full language Sigma* from alphabet Sigma.
void faudes::AlphabetLanguage (const EventSet &rAlphabet, vGenerator &rResGen)
 Alphabet Language: Construct generator generating and marking an alphabet as languages, that is L(G)=Lm(G)=Sigma.
void faudes::EmptyStringLanguage (const EventSet &rAlphabet, vGenerator &rResGen)
 Empty string language: Construct generator generating and marking the empty string, that is L(G)=Lm(G)={epsilon}.
void faudes::EmptyLanguage (const EventSet &rAlphabet, vGenerator &rResGen)
 Empty language: Construct generator generating and marking the empty language, that is L(G)=Lm(G)={}.
bool faudes::EmptyLanguage (const vGenerator &rGen)
 Empty language: Tests if the language marked by rGen is empty, that is if Lm(G)={}.
bool faudes::LanguageInclusion (const vGenerator &rGen1, const vGenerator &rGen2)
 Language inclusion: Test if language Lm1 marked by rGen1 is included in language Lm2 marked by rGen2.
bool faudes::LanguageEquality (const vGenerator &rGen1, const vGenerator &rGen2)
 Language equality: Test if the language Lm1 marked by rGen1 equals the language Lm2 marked by rGen2.
void faudes::KleeneClosure (vGenerator &rGen)
 Kleene Closure: This function computes the Kleene Closure ( ()* - operator) of the language marked by rGen.
void faudes::KleeneClosureNonDet (vGenerator &rGen)
 Kleene Closure, nondeterministic version: This function computes the Kleene Closure ( ()* - operator) of the language marked by rGen.
void faudes::PrefixClosure (vGenerator &rGen)
 Prefix Closure: This function computes the prefix closure the language Lm marked by rGen.
void faudes::SelfLoop (vGenerator &rGen, const EventSet &rAlphabet)
 SelfLoop: This function selfoops all states of rGen with the events from rAlphabet.
void faudes::SelfLoopMarkedStates (vGenerator &rGen, const EventSet &rAlphabet)
 SelfLoopMarkedStates: This function selfoops all marked states of rGen with the events from rAlphabet.
void faudes::SelfLoop (vGenerator &rGen, const EventSet &rAlphabet, const StateSet &rStates)
 SelfLoop: This function selfoops the states rStates of rGen with the events from rAlphabet.
void faudes::StateMin (vGenerator &rGen, vGenerator &rResGen)
 State set minimization.
bool faudes::IsControllable (const vGenerator &rPlantGen, const EventSet &rCAlph, const vGenerator &rSupCandGen)
 Test controllability.
bool faudes::IsControllable (const vGenerator &rPlantGen, const EventSet &rCAlph, const vGenerator &rSupCandGen, StateSet &rCriticalStates)
 Test controllability.
void faudes::SupConNB (const vGenerator &rPlantGen, const EventSet &rCAlph, const vGenerator &rSpecGen, vGenerator &rResGen)
 Nonblocking Supremal Controllable Sublanguage.
void faudes::SupCon (const vGenerator &rPlantGen, const EventSet &rCAlph, const vGenerator &rSpecGen, vGenerator &rResGen)
 Supremal Controllable Sublanguage.


Function Documentation

void faudes::AlphabetLanguage const EventSet rAlphabet,
vGenerator &  rResGen
 

Alphabet Language: Construct generator generating and marking an alphabet as languages, that is L(G)=Lm(G)=Sigma.

Method: this function creates a generator with one init state and one marked state. For each event from rAlphabet, a transition is inserted leading from the init state to the marked state.

No restrictions on parameters.

Parameters:
rAlphabet alphabet from which alphabet language is built
rResGen generator with languages L(G)=Lm(G)=Sigma

Example:

AlphabetLanguage(Sigma={a,b},Result)
tmp_languagesAlphabet_result.png

Definition at line 500 of file regular.cpp.

void faudes::Automaton vGenerator &  rGen,
const EventSet rAlphabet
 

Automaton wrt alphabet: Convert a generator marking the language Lm into a formal automaton recognizing Lm with a dump state representing Sigma*-PrefixClosure(Lm).

In this function, Sigma is given by the parameter rAlphabet. For information about automata, see [Wonham. Supervisory Control of Discrete Event Systems]. The original generated language is ignored. Note: An automaton is a deterministic transition structure according to the formal definition; see also "Determinism" below. Method: Uncoaccessible states are erased, as the language generated by rGen is not examined in this function. A dump state representing "Sigma*-PrefixClosure(Lm)" is created. Then, the transition relation is completed such that it is fully defined for each state of rGen and each event of rAlphabet. Formerly undefined transitions lead to the dump state.

Determinism: Input parameter has to be deterministic for correct result. If not, then the (also nondeterministic) result recognizes the correct language, but the dump state does not represent "Sigma*-PrefixClosure(Lm)" as it should; see also example ExAutomaton_basic(). If FAUDES_CHECKED is defined a warning on non-deterministic input is issued.

The alphabet of rGen has to be a subset of rAlphabet. No further restrictions on parameters.

Parameters:
rGen generator that is converted to automaton
rAlphabet resulting automaton has the alphabet rAlphabet, and its dump state represents the language L_dump=rAlphabet*-PrefixClosure(Lm).
Exceptions:
Exception 
  • alphabet of rGen is not a subset of rAlphabet (id 100).

Definition at line 195 of file regular.cpp.

void faudes::Automaton vGenerator &  rGen  ) 
 

Automaton wrt generator alphabet: Convert a generator marking the language Lm into a formal automaton recognizing Lm with a dump state representing Sigma*-PrefixClosure(Lm).

In this function, Sigma is given by the alphabet of rGen; see also Automaton(rGen,rAlphabet). For information about automata, see [Wonham. Supervisory Control of Discrete Event Systems]. The original generated language is ignored. Note: An automaton is a deterministic transition structure according to the formal definition; see also "Determinism" below. Method: Uncoaccessible states are erased, as the language generated by rGen is not examined in this function. A dump state representing "Sigma*-PrefixClosure(Lm)" is created. Then, the transition relation is completed such that it is fully defined for each state and each event. Formerly undefined transitions lead to the dump state.

Determinism: Input parameter has to be deterministic for correct result. If not, then the (also nondeterministic) result recognizes the correct language, but the dump state does not represent "Sigma*-PrefixClosure(Lm)" as it should; see also example ExAutomaton_basic(). If FAUDES_CHECKED is defined a warning on non-deterministic input is issued.

No further restrictions on parameter.

Parameters:
rGen generator that is converted to automaton

Example:

Generator G Automaton(G)
tmp_automaton_g.png
tmp_automaton_gRes.png

Definition at line 276 of file regular.cpp.

void faudes::Deterministic const vGenerator &  rGen,
vGenerator &  rResGen
 

Make generator deterministic.

Constructs a deterministic generator while preserving the generated and marked languages. The implementation is based on the so called multiway merge variant of subset construction, in which the new state set becomes a subset of the power set og the given state set. It is of exponential complexity. For details on the multiway merge algorithm see "Ted Leslie, Efficient Approaches to Subset Construction, Computer Science, University of Waterloo, 1995". See also Deterministic(const vGenerator&,std::map<Idx,StateSet>&,vGenerator& rResGen) and Deterministic(const vGenerator&,std::vector<StateSet>&,std::vector<Idx>&,vGenerator& rResGen).

Technical detail: if the input has no initial state, then so has the output. In this aspect this function does not match the test IsDeterministic(). See also UniqueInit().

Parameters:
rGen Reference to generator
rResGen Reference to resulting deterministic generator

Example:

Generator G Deterministic(G,Result)
tmp_deterministic_nondet.png
tmp_deterministic_det.png

Definition at line 63 of file project.cpp.

bool faudes::EmptyLanguage const vGenerator &  rGen  ) 
 

Empty language: Tests if the language marked by rGen is empty, that is if Lm(G)={}.

The generated language L(G) is not considered. Method: This function tests if a) the set of marked states is empty or else b) the intersection of the set of accessible states and the set of marked states is empty, i.e. if there is no marked state or if no marked state is accessible (reachable).

No restrictions on parameter.

Parameters:
rGen generator to be tested for empty marked language
Returns:
true on empty marked language, false on nonempty marked language

Definition at line 588 of file regular.cpp.

void faudes::EmptyLanguage const EventSet rAlphabet,
vGenerator &  rResGen
 

Empty language: Construct generator generating and marking the empty language, that is L(G)=Lm(G)={}.

Method: this function creates a generator with an empty state set and the alphabet rAlphabet.

No restrictions on parameters.

Parameters:
rAlphabet alphabet of the resulting generator
rResGen generator with languages L(G)=Lm(G)={}

Definition at line 571 of file regular.cpp.

bool faudes::EmptyLanguageIntersection const vGenerator &  rGen1,
const vGenerator &  rGen2
 

Empty language intersection: This function checks if the intersection of two languages marked by two generators is empty that is the two languages are disjoint.

The involved generated (prefix-closed) languages are not considered. This function is identical to Disjoint(). Method: This function checks if the Product() of both automata marks the empty language.

ToDo: modify such that the product is computed only to the necessary extend, i.e. do not store product in temporary generator and return false as soon as a common transition is found.

No restrictions on parameters.

Parameters:
rGen1 generator marking Lm1
rGen2 generator marking Lm2
Returns:
true if language intersection is empty, false if not.

Definition at line 174 of file regular.cpp.

void faudes::EmptyStringLanguage const EventSet rAlphabet,
vGenerator &  rResGen
 

Empty string language: Construct generator generating and marking the empty string, that is L(G)=Lm(G)={epsilon}.

Method: this function creates a generator with one marked init state and the alphabet rAlphabet.

No restrictions on parameters.

Parameters:
rAlphabet alphabet of the resulting generator
rResGen generator with languages L(G)=Lm(G)={epsilon} and alphabet rAlphabet

Example:

EmptyStringLanguage(Sigma={a,b},Result)
tmp_languagesEmptyString_result.png

Definition at line 542 of file regular.cpp.

void faudes::FullLanguage const EventSet rAlphabet,
vGenerator &  rResGen
 

Full Language: Construct generator generating and marking full language Sigma* from alphabet Sigma.

Method: this function creates a generator with one state that is marked and init state. This state is selflooped with all events from rAlphabet.

Parameters:
rAlphabet alphabet Sigma from which full language Sigma* is built
rResGen generator generating and marking full language Sigma*

Example:

FullLanguage(Sigma={a,b},Result)
tmp_languagesFull_result.png

Definition at line 466 of file regular.cpp.

bool faudes::IsControllable const vGenerator &  rPlantGen,
const EventSet rCAlph,
const vGenerator &  rSupCandGen,
StateSet rCriticalStates
 

Test controllability.

Tests whether the candidate supervisor H is controllable w.r.t. the plant G. This implementation does not require the supervisor H to represent a sublanguage of the plant G.

If the candidate fails to be controllable, this version will return a set of "critical" states of the candidate supervisor. These states are characterised by (a) being reachable in the parallel composition of plant and supervisor (b) disabeling an uncontrollable transition of the plant

Parameter restrictions: both generators must be deterministic and have the same alphabet.

Parameters:
rPlantGen Plant G
rCAlph Controllable events
rSupCandGen Supervisor candicate H
rCriticalStates Set of critical states
Exceptions:
Exception 
  • alphabets of generators don't match (id 200)
  • plant generator nondeterministic (id 201)
  • specification generator nondeterministic (id 203)
  • plant and Spec generator nondeterministic (id 204)
Returns:
true / false

Definition at line 607 of file supcon.cpp.

bool faudes::IsControllable const vGenerator &  rPlantGen,
const EventSet rCAlph,
const vGenerator &  rSupCandGen
 

Test controllability.

Tests whether the candidate supervisor H is controllable w.r.t. the plant G. This implementation does not require the supervisor H to represent a sublanguage of the plant G.

Parameter restrictions: both generators must be deterministic and have the same alphabet.

Parameters:
rPlantGen Plant G
rCAlph Controllable events
rSupCandGen Supervisor candidate H
Exceptions:
Exception 
  • alphabets of generators don't match (id 100)
  • plant generator nondeterministic (id 201)
  • specification generator nondeterministic (id 203)
  • plant and Spec generator nondeterministic (id 204)
Returns:
true / false

Definition at line 586 of file supcon.cpp.

void faudes::KleeneClosure vGenerator &  rGen  ) 
 

Kleene Closure: This function computes the Kleene Closure ( ()* - operator) of the language marked by rGen.

The generated language is not considered. Method: KleeneClosureNonDet() is called, which, for all transitions leading from a state x to a marked state, inserts a transition with the same event starting from x and leading to (one of) the initial state(s). As this step causes nondeterminism, the function Deterministic() is called. See also KleeneClosureNonDet().

No restrictions on parameter.

Parameters:
rGen generator marking the language Lm to which the Kleene Closure is applied

Example:

Generator G KleeneClosure(G)
tmp_kleene_g.png
tmp_kleene_gRes.png

Definition at line 618 of file regular.cpp.

void faudes::KleeneClosureNonDet vGenerator &  rGen  ) 
 

Kleene Closure, nondeterministic version: This function computes the Kleene Closure ( ()* - operator) of the language marked by rGen.

The generated language is not considered. Method: KleeneClosureNonDet() is called, which, for all transitions leading from a state x to a marked state, inserts a transition with the same event starting from x and leading to (one of) the initial state(s).

Parameters:
rGen generator marking the language Lm to which Kleene Closure is applied

Definition at line 640 of file regular.cpp.

void faudes::LanguageComplement vGenerator &  rGen,
const EventSet rAlphabet
 

Language complement wrt alphabet: Convert generator marking the language Lm into generator marking the language complement of Lm which is defined as Sigma*-Lm.

In this function, Sigma is given by the parameter rAlphabet. The original generated language is ignored. Method: This function calls Automaton() first and then inverts the marking of the states of the result.

Determinism: Input parameter has to be deterministic for correct result, see Automaton() for explanations. If FAUDES_CHECKED is defined a warning on non-deterministic input is issued. (by function Automaton()).

The alphabet of rGen has to be a subset of rAlphabet. No further restrictions on parameter.

Parameters:
rGen generator on which the language complement is performed
rAlphabet alphabet of resulting generator, used as reference to build the complement
Exceptions:
Exception 
  • alphabet of rGen is not a subset of rAlphabet (id 100).

Definition at line 284 of file regular.cpp.

void faudes::LanguageComplement vGenerator &  rGen  ) 
 

Language complement wrt generator alphabet: Convert generator marking the language Lm into generator marking the language complement of Lm which is defined as Sigma*-Lm.

In this function, Sigma is given by the alphabet of rGen; see also LanguageComplement(rGen,rAlphabet). The original generated language is ignored. Method: This function calls Automaton() first and then inverts the marking of the states of the result.

Determinism: Input parameter has to be deterministic for correct result, see Automaton() for explanations. If FAUDES_CHECKED is defined a warning on non-deterministic input is issued. (by function Automaton()).

The alphabet of rGen has to be a subset of rAlphabet. No further restrictions on parameter.

Parameters:
rGen generator on which the language complement is performed

Example:

Generator G LanguageComplement(G)
tmp_boolean_g1.png
tmp_complement_g1.png

Definition at line 313 of file regular.cpp.

void faudes::LanguageConcatenate const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Language Concatenation, deterministic version: With the languages Lm1 and Lm2 marked by rGen1 and rGen2, respectively, the result rResGen marks the concatenation LmRes=Lm1Lm2.

The languages generated by rGen1 and rGen2 are ignored. It would be possible to let the result also generate the concatenation of the generated languages; however, this can produce disproportionate computational overhead, if only the marked languages shall be concatenated. Method: rGen2 is appended to rGen1: first, the initial states of rGen2 are erased. Then, transitions, that formerly started from the initial state(s) of rGen2, are redirected and multiplied such that they start from each marked state of rGen1. The marked states corresponding to rGen2 remain marked. The marked states of rGen1 remain marked only if rGen2 has at least one marked initial state (i.e. if epsilon is concatenated to Lm1.)

Determinism: Input parameters may be nondeterministic. This function calls LanguageUnionNonDet() and then Deterministic() to convert the result into a deterministic generator. Note that this conversion is usually straightforward, but there exist theoretical worst-case examples of exponential complexity.

No restrictions on parameters.

Parameters:
rGen1 generator marking Lm1
rGen2 generator marking Lm2
rResGen Resulting generator marking the language concatenation Lm1Lm2

Example:

Generator G1 LanguageConcatenate(G1,G3,Result)
tmp_concat_g1.png
tmp_concat_g1g3.png
Generator G2 LanguageConcatenate(G1,G4,Result)
tmp_concat_g2.png
tmp_concat_g1g4.png
Generator G3 LanguageConcatenate(G2,G3,Result)
tmp_concat_g3.png
tmp_concat_g2g3.png
Generator G4 LanguageConcatenate(G2,G4,Result)
tmp_concat_g4.png
tmp_concat_g2g4.png

Definition at line 445 of file regular.cpp.

void faudes::LanguageConcatenateNonDet const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Language Concatenation, nondeterministic version: With the languages Lm1 and Lm2 marked by rGen1 and rGen2, respectively, the result rResGen marks the concatenation LmRes=Lm1Lm2.

The languages generated by rGen1 and rGen2 are ignored. It would be possible to let the result also generate the concatenation of the generated languages; however, this can produce disproportionate computational overhead, if only the marked languages shall be concatenated. Method: rGen2 is appended to rGen1: first, the initial states of rGen2 are erased. Then, transitions, that formerly started from the initial state(s) of rGen2, are redirected and multiplied such that they start from each marked state of rGen1. The marked states corresponding to rGen2 remain marked. The marked states of rGen1 remain marked only if rGen2 has at least one marked initial state (i.e. if epsilon is concatenated to Lm1.)

Determinism: Input parameters may be nondeterministic. Result can be nondeterministic even if input parameters are deterministic; see also LanguageConcatenate().

No restrictions on parameters.

Parameters:
rGen1 generator marking Lm1
rGen2 generator marking Lm2
rResGen resulting generator marking the language concatenation Lm1Lm2

Definition at line 322 of file regular.cpp.

bool faudes::LanguageDisjoint const vGenerator &  rGen1,
const vGenerator &  rGen2
 

Disjoint: This function checks if the intersection of two languages marked by two generators is empty, ie the two languages are disjoint.

The involved generated (prefix-closed) languages are not considered. This function is identical to EmptyLanguageIntersection(). Method: This function checks if the Product() of both automata marks the empty language.

ToDo: modify such that the product is computed only to the necessary extend, i.e. do not store product in temporary generator and return false as soon as a common transition is found.

No restrictions on parameters.

Parameters:
rGen1 generator marking Lm1
rGen2 generator marking Lm2
Returns:
true if language intersection is empty, false if not.

Definition at line 188 of file regular.cpp.

bool faudes::LanguageEquality const vGenerator &  rGen1,
const vGenerator &  rGen2
 

Language equality: Test if the language Lm1 marked by rGen1 equals the language Lm2 marked by rGen2.

The generated languages are not considered. Method: This function checks mutual inclusion of Lm1 in Lm2 and of Lm2 in Lm1 using the function LanguageInclusion().

Restrictions on parameters: rGen1 and rGen2 have to be deterministic! If FAUDES_CHECKED is defined a warning on non-deterministic input is issued. (by function Automaton()).

ToDo: implement faster, version using a variant of Product(): compute product without storing result, return false as soon as rGen1 and rGen2 "disagree" on the occurrence of some event.

Parameters:
rGen1 generator marking Lm1
rGen2 generator marking Lm2
Returns:
true if the language marked by rGen1 equals the language marked by rGen2

Definition at line 609 of file regular.cpp.

bool faudes::LanguageInclusion const vGenerator &  rGen1,
const vGenerator &  rGen2
 

Language inclusion: Test if language Lm1 marked by rGen1 is included in language Lm2 marked by rGen2.

The generated languages are not considered. Method: This function checks if there is no string in Lm1 that is not in Lm2 by testing if the intersection of Lm1 and the language complement of Lm2 is empty.

Restrictions on parameters: rGen2 has to be deterministic! If FAUDES_CHECKED is defined a warning on non-deterministic input is issued. (by function Automaton()).

Determinism: correctness in case of nondeterministic parameter rGen1 has been tested with an example (see ExInclusion_simple), but not proven.

ToDo: implement faster version using a variant of Product(): compute product without storing result, return false as soon as some event is possible in Lm2 but not in Lm1.

Parameters:
rGen1 generator marking Lm1
rGen2 generator marking Lm2
Returns:
true if language marked by rGen1 is included in language marked by rGen2

Definition at line 596 of file regular.cpp.

void faudes::LanguageIntersection const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Language intersection: This function performs the intersection of two languages marked by two generators; the resulting generator marks the resulting language.

Moreover, the same is done for the involved generated (prefix-closed) languages. The resulting languages are defined over the intersection of the involved alphabets. Method: This function calls Product(). In the product of two automata, an event occurs if and only if it occurs in both automata rGen1 and rGen2. The result generates/marks the intersection of the involved languages, see e.g. [Cassandras, Lafortune. Introduction to Discrete Event Systems, p.84]

Determinism: Input parameters may be nondeterministic. Result can be nondeterministic only if input parameters are nondeterministic.

No restrictions on parameters.

Parameters:
rGen1 generator generating/marking L1/Lm1
rGen2 generator generating/marking L2/Lm2
rResGen resulting generator generating/marking the language intersection of L1 and L2/of Lm1 and Lm2

Example:

Generator G1 Generator G2
tmp_boolean_g1.png
tmp_boolean_g2.png
LanguageIntersection(G1,G2,Result)
tmp_intersection_g1g2.png

Definition at line 158 of file regular.cpp.

void faudes::LanguageUnion const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Language union, deterministic version: This function performs the union of two languages marked by two generators; the resulting generator marks the resulting language.

Moreover, the same is done for the involved generated (prefix-closed) |languages. Method: This function implements the textbook version (which textbook??) in taking unions of all generator entities (alphabets, initial states, ...). State sets are taken as disjoint by definition and thus reindexed and renamed to achieve disjoint union. The resulting language is defined over the union of the alphabets of the original languages.

Determinism: Input parameters may be nondeterministic. This function calls LanguageUnionNonDet() and then Deterministic() to convert the result into a deterministic generator. Note that this conversion is usually straightforward, but there exist theoretical worst-case examples of exponential complexity.

No restrictions on parameters.

ToDo: a version similar to parallel composition that produces a deterministic result by construction. (?)

Parameters:
rGen1 generator generating/marking L1/Lm1
rGen2 generator generating/marking L2/Lm2
rResGen resulting generator generating/marking the language union of L1 and L2/of Lm1 and Lm2

Example:

Generator G1 Generator G2
tmp_boolean_g1.png
tmp_boolean_g2.png
LanguageUnion(G1,G2,Result)
tmp_union_g1g2.png

Definition at line 130 of file regular.cpp.

void faudes::LanguageUnionNonDet const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Language union, nondeterministic version: This function performs the union of two languages marked by two generators; the resulting generator marks the resulting language.

Moreover, the same is done for the involved generated (prefix-closed) languages. Method: This function implements the textbook version in taking unions of all generator entities (alphabets, initial states, ...) of rGen1 and rGen2. State sets are taken as disjoint by definition and thus reindexed and renamed to achieve disjoint union. The resulting language is defined over the union of the alphabets of the original languages; original languages defined over different alphabets are treated as if they were defined over the union of both alphabets.

Determinism: Input parameters may be nondeterministic. This function is more economical than the deterministic version, but likely to produce a non-deterministic result; see also LanguageUnion().

No restrictions on parameters.

Parameters:
rGen1 generator generating/marking L1/Lm1
rGen2 generator generating/marking L2/Lm2
rResGen resulting generator generating/marking the language union of L1 and L2/of Lm1 and Lm2

Definition at line 48 of file regular.cpp.

void faudes::Parallel const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Parallel composition.

Constructs the parallel composition of two generators, where shared events are synchronised while non-shared events are executed independantly. The resulting generators alphabet is the union of the argument alphabets. In this implementation, only accessible states are generated. On deterministic input this functions constructs a deterministic output. See also Parallel(const vGenerator&,std::map< std::pair<Idx,Idx>, Idx>&,const vGenerator&, vGenerator&).

Parameters:
rGen1 First generator
rGen2 Second generator
rResGen Reference to resulting parallel composition generator

Definition at line 28 of file parallel.cpp.

void faudes::PrefixClosure vGenerator &  rGen  ) 
 

Prefix Closure: This function computes the prefix closure the language Lm marked by rGen.

A language Lm is prefix closed if each string of Lm implies that all its prefixes are also element of Lm. The prefix closure of a language marked by a generator is always a subset of the generated language and is represented by the set of coaccessible states of the generator. Method: First, Coaccessible() is called to erase all states of rGen that do not represent prefixes of marked strings. Then, all remaining states are marked.

No restrictions on parameter.

ToDo: (slightly) more efficient version: implement generator function CoAccessibleSet() similar to AccessibleSet() and call InjectMarkedStates(AccessibleSet()).

Parameters:
rGen generator marking the language Lm to which prefix closure is applied

Example:

Generator G PrefixClosure(G)
tmp_prefixclosure_g.png
tmp_prefixclosure_gRes.png

Definition at line 680 of file regular.cpp.

void faudes::Project const vGenerator &  rGen,
const EventSet rProjectAlphabet,
vGenerator &  rResGen
 

Minimized deterministic projection.

Projects the generated and marked languages to a subalphabet of the original alphabet, and subsequently calls Deterministic and StateMin to construct a deterministic minimal realisation of the result. The input generator does not need to be deterministic.

Parameters:
rGen Reference to generator
rProjectAlphabet Projection alphabet
rResGen Reference to resulting deterministic generator

Example:

Generator G Project(G,(a,c,g,e),Result)
tmp_project_g.png
tmp_project_prog.png

Definition at line 432 of file project.cpp.

void faudes::ProjectNonDet vGenerator &  rGen,
const EventSet rProjectAlphabet
 

Language projection.

Projects the generated and marked languages to another alphabet. Transitions with events not in the projection alphabet are considered invisible and therefor acordingly relinked with a visible lable to the appropriate successor state. The projection alphabet is intended (but not required) to be a subset of the original alphabet. The results in general is nondeterministic. The input generator does not need to be deterministic. See Project(const vGenerator&,const EventSet&, vGenerator&) for a version with deterministic result.

Parameters:
rGen Reference to generator
rProjectAlphabet Projection alphabet

Definition at line 351 of file project.cpp.

void faudes::SelfLoop vGenerator &  rGen,
const EventSet rAlphabet,
const StateSet rStates
 

SelfLoop: This function selfoops the states rStates of rGen with the events from rAlphabet.

Method: The alphabet of rGen is extended by rAlphabet. For each state x of rStates and each event alpha of rAlphabet, a transition (x,alpha,x) is inserted, irrespective of whether this event was already active in x before. See also SelfLoop(rGen,rAlphabet) and SelfLoopMarkedStates(rGen,rAlphabet).

No restrictions on parameter.

Determinism: resulting generator is nondeterministic, if it was nondeterministic before, or if rGen already contains one or more (non selfloop) transitions starting from a state of rState with events from rAlphabet.

Parameters:
rGen generator with marked states to be selflooped with events from rAlphabet
rAlphabet alphabet with selfloop events
rStates states to apply selfloop
Exceptions:
Exception 
  • rStates is not a subset of rGen.States() (id 100).

Example:

Generator G SelfLoop(G,Sigma={e,f},G.InitStates())
tmp_selfloop_g.png
tmp_selfloopInit_gRes.png

Definition at line 755 of file regular.cpp.

void faudes::SelfLoop vGenerator &  rGen,
const EventSet rAlphabet
 

SelfLoop: This function selfoops all states of rGen with the events from rAlphabet.

Method: The alphabet of rGen is extended by rAlphabet. For each state x of rGen and each event alpha of rAlphabet, a transition (x,alpha,x) is inserted, irrespective of whether this event was already active in x before. See also SelfLoop(rGen,rAlphabet,rStates) and SelfLoopMarkedStates(rGen,rAlphabet).

No restrictions on parameter.

Determinism: resulting generator is nondeterministic, if it was nondeterministic before, or if rGen already contains one or more (non selfloop) transitions with events from rAlphabet.

Parameters:
rGen generator to be selflooped with events from rAlphabet
rAlphabet alphabet with selfloop events

Example:

Generator G SelfLoop(G,Sigma={e,f})
tmp_selfloop_g.png
tmp_selfloop_gRes.png

Definition at line 699 of file regular.cpp.

void faudes::SelfLoopMarkedStates vGenerator &  rGen,
const EventSet rAlphabet
 

SelfLoopMarkedStates: This function selfoops all marked states of rGen with the events from rAlphabet.

Method: The alphabet of rGen is extended by rAlphabet. For each marked state x of rGen and each event alpha of rAlphabet, a transition (x,alpha,x) is inserted, irrespective of whether this event was already active in x before. See also SelfLoop(rGen,rAlphabet) and SelfLoop(rGen,rAlphabet,rStates).

No restrictions on parameter.

Determinism: resulting generator is nondeterministic, if it was nondeterministic before, or if rGen already contains one or more (non selfloop) transitions starting from a marked state with events from rAlphabet.

Parameters:
rGen generator with marked states to be selflooped with events from rAlphabet
rAlphabet alphabet with selfloop events

Example:

Generator G SelfLoopMarkedStates(G,Sigma={e,f})
tmp_selfloop_g.png
tmp_selfloopMarked_gRes.png

Definition at line 726 of file regular.cpp.

void faudes::SParallel const vGenerator &  rGen1,
const vGenerator &  rGen2,
vGenerator &  rResGen
 

Shared event parallel composition.

Parallel composition that executes shared events only. The resulting generators alphabet is the interscetion of the argument alphabets. In this implementation, only accessible states are generated. Assumes deterministic input generators, result is deterministic.

Parameters:
rGen1 First generator
rGen2 Second generator
rResGen Reference to resulting parallel composition generator

Definition at line 220 of file parallel.cpp.

void faudes::StateMin vGenerator &  rGen,
vGenerator &  rResGen
 

State set minimization.

Constructs a generator with minimal stateset while preserving the generated und marked languages. This function implements the (n*log n) set partitioning algorithm by John E. Hopcroft. The given generator will be made accessible before computing minimized generator. See also StateMin(vGenerator&,vGenerator&,std::vector<StateSet>&,std::vector<Idx>&).

Parameters:
rGen Generator
rResGen Minimized generator (result)
Exceptions:
Exception Input automaton nondeterministic (id 101)

Example:

Generator G StateMin(G,Result)
tmp_minimal_nonmin.png
tmp_minimal_min.png

Definition at line 30 of file statemin.cpp.

void faudes::SupCon const vGenerator &  rPlantGen,
const EventSet rCAlph,
const vGenerator &  rSpecGen,
vGenerator &  rResGen
 

Supremal Controllable Sublanguage.

Parameter restrictions: both generators must be deterministic and have the same alphabet.

Parameters:
rPlantGen Plant G
rCAlph Controllable events
rSpecGen Specification E
rResGen Reference to resulting Generator, the minimal restrictive supervisor
Exceptions:
Exception 
  • alphabets of generators don't match (id 100)
  • plant nondeterministic (id 201)
  • spec nondeterministic (id 203)
  • plant and spec nondeterministic (id 204)

Definition at line 719 of file supcon.cpp.

void faudes::SupConNB const vGenerator &  rPlantGen,
const EventSet rCAlph,
const vGenerator &  rSpecGen,
vGenerator &  rResGen
 

Nonblocking Supremal Controllable Sublanguage.

Computes the supremal nonblocking sublanguage of the specification E that is controllable w.r.t. the plant G. The result is given as a trim deterministic generator that may be used to supervise G in order to enforce H. This implementation does not require E to represent a sublanguage of G

See "C.G CASSANDRAS AND S. LAFORTUNE. Introduction to Discrete Event Systems. Kluwer, 1999." for base algorithm.

Parameter restrictions: both generators must be deterministic and have the same alphabet.

Parameters:
rPlantGen Plant G
rCAlph Controllable events
rSpecGen Specification Generator E
rResGen Reference to resulting Generator, the minimal restrictive nonblocking supervisor
Exceptions:
Exception 
  • alphabets of generators don't match (id 100)
  • plant nondeterministic (id 201)
  • spec nondeterministic (id 203)
  • plant and spec nondeterministic (id 204)

Definition at line 625 of file supcon.cpp.

void faudes::UniqueInit vGenerator &  rGen  ) 
 

Make initial states unique.

If the argument generator has precisely one initial state, this function does nothing. Else, this function introduces a new and unique initial state and relinks transitions accordinly. If the argument generator used to have more than one initial state, this operation may render the output nondeterministic. If the argument generator used to have no initial state, the output generator will generate the empty string language as opposed to the empty language. Otherwise, generated and marked languages are preserved.

Note: call this function followed by determine to convert the generator to a deterministic generator with exactly one initial state.

Parameters:
rGen Reference to generator

Definition at line 28 of file project.cpp.


Generated on Fri May 9 11:26:48 2008 for libFAUDES 2.09b by  doxygen 1.4.4