op_observercomputation.h
Go to the documentation of this file.
1 /** @file op_observercomputation.h
2 
3 Methods to compute natural projections that exhibit the observer property.
4 The observer algorithm is elaborated in
5 K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event
6 Systems," Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
7 In addition, methods to compute natural projections that exhibit
8 output control consistency (OCC) and local control consistency (LCC) are provided. See for example
9 K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
10 Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
11 Furthermore, an algorithm for computing natural observers without changing event labels as
12 presented in
13 Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
14 Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
15 is implemented.
16 */
17 
18 /* FAU Discrete Event Systems Library (libfaudes)
19 
20  Copyright (C) 2006 Bernd Opitz
21  Exclusive copyright is granted to Klaus Schmidt
22 
23  This library is free software; you can redistribute it and/or
24  modify it under the terms of the GNU Lesser General Public
25  License as published by the Free Software Foundation; either
26  version 2.1 of the License, or (at your option) any later version.
27 
28  This library is distributed in the hope that it will be useful,
29  but WITHOUT ANY WARRANTY; without even the implied warranty of
30  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31  Lesser General Public License for more details.
32 
33  You should have received a copy of the GNU Lesser General Public
34  License along with this library; if not, write to the Free Software
35  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
36 
37 #include "corefaudes.h"
38 #include "op_debug.h"
39 #include <map>
40 #include <vector>
41 #include <stack>
42 
43 #ifndef FAUDES_OP_OBSERVERCOMPUTATION_H
44 #define FAUDES_OP_OBSERVERCOMPUTATION_H
45 
46 
47 
48 namespace faudes {
49 
50 // ================================================================================================
51 // Functions that compute dynamic systems for different properties related to nonblocking and
52 // maximally permissive hierarchical control
53 // ================================================================================================
54 
55 
56 /**
57  * Computation of the dynamic system for Delta_sigma (reachable states after the occurrence of one high-level event).
58  * This function computes the part of the dynamic system that is needed for evaluating the observer
59  * algorithm for closed languages.
60  *
61  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
62  * rGen must be a deterministic generator.
63  * There are no further restrictions on parameters.
64  *
65  * @param rGen
66  * Generator for which the dynamic system is computed
67  * @param rHighAlph
68  * Abstraction alphabet
69  * @param rGenDyn
70  * Generator representing the dynamic system
71  */
72 void calculateDynamicSystemClosedObs(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn);
73 //
74 /**
75  * Computation of the dynamic system for Delta_obs (local reachability of a marked state).
76  * This function computes the part of the dynamic system that is needed for evaluating the observer
77  * algorithm for marked languages.
78  *
79  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
80  * rGen must be a deterministic generator.
81  * There are no further restrictions on parameters.
82  *
83  * @param rGen
84  * Generator for which the dynamic system is computed
85  * @param rHighAlph
86  * Abstraction alphabet
87  * @param rGenDyn
88  * Generator representing the dynamic system
89  */
90 void calculateDynamicSystemObs(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn);
91 
92 /**
93  * Computation of the dynamic system for Delta_msa (local fulfillment of the msa-observer property).
94  * This function computes the part of the dynamic system that is needed for evaluating the observer
95  * algorithm for msa-observers.
96  *
97  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
98  * rGen must be a deterministic generator.
99  * There are no further restrictions on parameters.
100  *
101  * @param rGen
102  * Generator for which the dynamic system is computed
103  * @param rHighAlph
104  * Abstraction alphabet
105  * @param rGenDyn
106  * Generator representing the dynamic system
107  */
108 void calculateDynamicSystemMSA(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn);
109 
110 /**
111  * Check if the msa-observer conditions is fulfilled for a given state.
112  * This function performs a forward reachability computation to determine
113  * if the msa-observer condition is fulfilled for a given state.
114  *
115  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
116  * rGen must be a deterministic generator.
117  * There are no further restrictions on parameters.
118  *
119  * @param rGen
120  * Generator for which the dynamic system is computed
121  * @param rHighAlph
122  * Abstraction alphabet
123  * @param currentState
124  * Index of the state to be checked
125  * @param rDoneStates
126  * Set of already investigated states
127  * @return
128  * True if the condition is fulfilled, false otherwise
129  */
130 bool recursiveCheckMSAForward(const Generator& rGen, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates);
131 
132 /**
133  * Check if the msa-observer conditions is fulfilled for a given state.
134  * This function performs a backward reachability computation to determine
135  * if the msa-observer condition is fulfilled for a given state.
136  *
137  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
138  * rGen must be a deterministic generator.
139  * There are no further restrictions on parameters.
140  *
141  * @param rGen
142  * Generator for which the dynamic system is computed
143  * @param rRevTransSet
144  * Reversely ordered transition relation
145  * @param rHighAlph
146  * Abstraction alphabet
147  * @param currentState
148  * Index of the state to be checked
149  * @param rDoneStates
150  * Set of already investigated states
151  * @return
152  * True if the condition is fulfilled, false otherwise
153  */
154 bool recursiveCheckMSABackward(const Generator& rGen, const TransSetX2EvX1& rRevTransSet, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates);
155 
156 /**
157  * Computation of the dynamic system for Delta_lcc (fulfillment of the local control consistency property).
158  * This function computes the part of the dynamic system that is needed for evaluating the observer
159  * algorithm for local control consistency
160  *
161  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
162  * rGen must be a deterministic generator.
163  * There are no further restrictions on parameters.
164  *
165  * @param rGen
166  * Generator for which the dynamic system is computed
167  * @param rControllableEvents
168  * Set of controllable events
169  * @param rHighAlph
170  * Abstraction alphabet
171  * @param rGenDyn
172  * Generator representing the dynamic system
173  */
174 void calculateDynamicSystemLCC(const Generator& rGen, const EventSet& rControllableEvents, const EventSet& rHighAlph, Generator& rGenDyn);
175 
176 /**
177  * Find states that fulfill the lcc condition.
178  * This function performs a backward reachability computation to determine
179  * states where the lcc condition is fulfilled
180  *
181  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
182  * rGen must be a deterministic generator.
183  * There are no further restrictions on parameters.
184  *
185  * @param rRevTransSet
186  * Reversely ordered transition relation
187  * @param rControllableEvents
188  * Set of controllable events
189  * @param rHighAlph
190  * Abstraction alphabet
191  * @param currentState
192  * Index of the start state of the backward reachability computation
193  * @param rDoneStates
194  * Set of already investigated states
195  * @return
196  * True if the condition is fulfilled, false otherwise
197  */
198 void recursiveCheckLCC(const TransSetX2EvX1& rRevTransSet, const EventSet& rControllableEvents, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates);
199 
200 // ================================================================================================
201 // Functions that extend a given abstraction alphabet to achieve the observer property
202 // ================================================================================================
203 
204 
205 // \section ObserverF2 Functions that extend a given abstraction alphabet
206 
207 
208 /**
209  * L(G)-observer computation by adding events to the high-level alphabet.
210  * This function extends a given high-level alphabet such that the resulting natural projection
211  * is an L(G)-observer for the prefix-closed language of the given generator.
212  * This function evaluates the natural observer algorithm as described in
213  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
214  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
215  *
216  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
217  * rGenObs must be a deterministic generator.
218  * There are no further restrictions on parameters.
219  *
220  * @param rGenObs
221  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
222  * @param rHighAlph
223  * Reference to the initial abstraction alphabet that is modified by the algorithm
224  * @return
225  * number of states of the high-level generator
226  *
227  * <h4>Example: Computation of an L(G)-observer</h4>
228  * <table class="large_image_table"> <tr> <td> <table>
229  * <tr> <td> Original generator </td> </tr>
230  * <tr>
231  * <td> @image html ex_natural_all.png </td>
232  * </tr>
233  * <tr>
234  * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr>
235  * </table> </td> </tr> <tr> <td> <table width=100%>
236  * <tr> <td> Result of calcClosedObserver(rGenObs, rHighAlph); </td> </tr>
237  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, h </td> </tr>
238  * <tr> <td> @image html ex_natural_closed_proj.png </td> </tr>
239  * </table> </td> </tr> </table>
240  *
241  * @ingroup ObserverPlugin
242  */
243 Idx calcClosedObserver(const Generator& rGenObs, EventSet& rHighAlph);
244 
245 /**
246  * Lm(G)-observer computation by adding events to the high-level alphabet.
247  * This function extends a given high-level alphabet such that the resulting natural projection
248  * is an Lm(G)-observer for the marked language of the given generator.
249  * This function evaluates the natural observer algorithm as described in
250  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
251  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
252  *
253  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
254  * rGenObs must be a deterministic generator.
255  * There are no further restrictions on parameters.
256  *
257  * @param rGenObs
258  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
259  * @param rHighAlph
260  * Reference to the initial abstraction alphabet that is modified by the algorithm
261  * @return
262  * number of states of the high-level generator
263  *
264  * <h4>Example: Computation of an Lm(G)-observer</h4>
265  * <table class="large_image_table"> <tr> <td> <table>
266  * <tr> <td> Original generator </td> </tr>
267  * <tr>
268  * <td> @image html ex_natural_all.png </td>
269  * </tr>
270  * <tr>
271  * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr>
272  * </table> </td> </tr> <tr> <td> <table width=100%>
273  * <tr> <td> Result of calcNaturalObserver(rGenObs, rHighAlph); </td> </tr>
274  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, delta, h </td> </tr>
275  * <tr> <td> @image html ex_natural_obs_proj.png </td> </tr>
276  * </table> </td> </tr> </table>
277  *
278  * @ingroup ObserverPlugin
279  */
280 Int calcNaturalObserver(const Generator& rGenObs, EventSet& rHighAlph);
281 
282 /**
283  * Lm(G)-observer computation including local control consistency (LCC) by adding events to the high-level alphabet.
284  * This function extends a given high-level alphabet such that the resulting natural projection
285  * is an Lm(G)-observer and locally control consistent (lcc) for the marked language of the given generator.
286  * This function evaluates the natural observer algorithm as described in
287  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
288  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
289  * and uses LCC as defined in
290  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
291  * Modular Supervisory Control Approaches for Discrete Event Systems
292  *
293  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
294  * rGenObs must be a deterministic generator.
295  * There are no further restrictions on parameters.
296  *
297  * @param rGen
298  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
299  * @param rHighAlph
300  * Reference to the initial abstraction alphabet that is modified by the algorithm
301  * @param rControllableEvents
302  * @return
303  * number of states of the high-level generator
304  *
305  * <h4>Example: Computation of an Lm(G)-observer with LCC</h4>
306  * <table class="large_image_table"> <tr> <td> <table>
307  * <tr> <td> Original generator </td> </tr>
308  * <tr>
309  * <td> @image html ex_natural_all.png </td>
310  * </tr>
311  * <tr>
312  * <td> Original high-level alphabet (rHighAlph): alpha, gamma; controllable events: a, f, g, h </td> </tr>
313  * </table> </td> </tr> <tr> <td> <table width=100%>
314  * <tr> <td> Result of calcNaturalObserverLCC(rGenObs, rControllableEvents, rHighAlph); </td> </tr>
315  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, delta, a, e, f, g, h </td> </tr>
316  * <tr> <td> @image html ex_natural_obslcc_proj.png </td> </tr>
317  * </table> </td> </tr> </table>
318  *
319  * @ingroup ObserverPlugin
320  */
321 Int calcNaturalObserverLCC(const Generator& rGen, const EventSet& rControllableEvents, EventSet& rHighAlph);
322 
323 /**
324  * MSA-observer computation by adding events to the high-level alphabet.
325  * This function extends a given high-level alphabet such that the resulting natural projection
326  * is an MSA-observer for the marked language of the given generator.
327  * This function adapts the natural observer algorithm as described in
328  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
329  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
330  * to the msa-obsever property.
331  *
332  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
333  * rGenObs must be a deterministic generator.
334  * There are no further restrictions on parameters.
335  *
336  * @param rGen
337  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
338  * @param rHighAlph
339  * Reference to the initial abstraction alphabet that is modified by the algorithm
340  * @return
341  * number of states of the high-level generator
342  *
343  * <h4>Example: Computation of an msa-observer</h4>
344  * <table class="large_image_table"> <tr> <td> <table>
345  * <tr> <td> Original generator </td> </tr>
346  * <tr>
347  * <td> @image html ex_natural_all.png </td>
348  * </tr>
349  * <tr>
350  * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr>
351  * </table> </td> </tr> <tr> <td> <table width=100%>
352  * <tr> <td> Result of calcMSAObserver(rGenObs, rHighAlph); </td> </tr>
353  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, h </td> </tr>
354  * <tr> <td> @image html ex_natural_msa_proj.png </td> </tr>
355  * </table> </td> </tr> </table>
356  *
357  * @ingroup ObserverPlugin
358  */
359 Int calcMSAObserver(const Generator& rGen, EventSet& rHighAlph);
360 
361 /**
362  * MSA-observer computation including local control consistency (LCC) by adding events to the high-level alphabet.
363  * This function extends a given high-level alphabet such that the resulting natural projection
364  * is an MSA-observer and locally control consistent (lcc) for the marked language of the given generator.
365  * This function adapts the natural observer algorithm as described in
366  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
367  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
368  * to the msa-obsever property and uses LCC as defined in
369  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
370  * Modular Supervisory Control Approaches for Discrete Event Systems,
371  * Workshop on Discrete Event Systems, 2008.
372  *
373  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
374  * rGenObs must be a deterministic generator.
375  * There are no further restrictions on parameters.
376  *
377  * @param rGen
378  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
379  * @param rControllableEvents
380  * @param rHighAlph
381  * Reference to the initial abstraction alphabet that is modified by the algorithm
382  * @return
383  * number of states of the high-level generator
384  *
385  * <h4>Example: Computation of an msa-observer with LCC</h4>
386  * <table class="large_image_table"> <tr> <td> <table>
387  * <tr> <td> Original generator </td> </tr>
388  * <tr>
389  * <td> @image html ex_natural_all.png </td>
390  * </tr>
391  * <tr>
392  * <td> Original high-level alphabet (rHighAlph): alpha, gamma; controllable events: a, f, g, h </td> </tr>
393  * </table> </td> </tr> <tr> <td> <table width=100%>
394  * <tr> <td> Result of calcMSAObserverLCC(rGenObs, rControllableEvents, rHighAlph); </td> </tr>
395  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, a, e, f, g, h </td> </tr>
396  * <tr> <td> @image html ex_natural_msalcc_proj.png </td> </tr>
397  * </table> </td> </tr> </table>
398  *
399  * @ingroup ObserverPlugin
400  */
401 Int calcMSAObserverLCC(const Generator& rGen, const EventSet& rControllableEvents, EventSet& rHighAlph);
402 
403 /*
404 
405  obsolet?
406 
407  * Computation of the dynamic system for Delta_occ (fulfillment of the output control consistency property).
408  * This function computes the part of the dynamic system that is needed for evaluating the observer
409  * algorithm for output control consistency
410  *
411  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
412  * rGen must be a deterministic generator.
413  * There are no further restrictions on parameters.
414  *
415  * @param rGen
416  * Generator for which the dynamic system is computed
417  * @param rControllableEvents
418  * Set of controllable events
419  * @param rHighAlph
420  * Abstraction alphabet
421  * @param rGenDyn
422  * Generator representing the dynamic system
423 
424  void calculateDynamicSystemOCC(const Generator& rGen, EventSet& rControllableEvents, EventSet& rHighAlph, Generator& rGenDyn);
425 
426 */
427 
428 /**
429  * Extension of the high-level alphabet to achieve the Lm-observer property.
430  * This algorithm extends the given high-level alphabet such that nondeterminism and unobservable
431  * transitions in the quotient automaton computed with the current high-level alphabet are removed.
432  * The function is called by calcNaturalObserver.
433  *
434  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
435  * rGenObs must be a deterministic generator.
436  * There are no further restrictions on parameters.
437  *
438  * @param rGenObs
439  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
440  * @param rHighAlph
441  * Reference to the initial abstraction alphabet that is modified by the algorithm
442  * @param rMapStateToPartition
443  * Map from states in rGenObs to states (partitions) in the computed quotient automaton
444  *
445  * @ingroup ObserverPlugin
446  */
447 void ExtendHighAlphabet(const Generator& rGenObs, EventSet& rHighAlph, std::map<Idx,Idx>& rMapStateToPartition);
448 
449 /**
450  * Check if the current alphabet splits all local automata with nondeterminims or unobservable transitions.
451  * This algorithm verifies if nondetermisisms or unobservable transitions are resolved if the given events in
452  * are added to the high-level alphabet. The function is called by ExtendHighAlphabet,
453  *
454  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
455  * rGenObs must be a deterministic generator.
456  * There are no further restrictions on parameters.
457  *
458  * @param rGenObs
459  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
460  * @param rSplitAlphabet
461  * Reference to the current alphabet for splitting verification
462  * @param rNondeterministicStates
463  * vector with states where nondeterminism has to be resolved and the related event
464  * @param entryState
465  * current state that is investigated
466  */
467 bool CheckSplit(const Generator& rGenObs, const EventSet& rSplitAlphabet, const std::vector<std::pair<StateSet, Idx> >& rNondeterministicStates, Idx entryState);
468 
469 
470 // ================================================================================================
471 // Functions that modify the alphabet/transitions of the generator to achieve the observer property
472 // ================================================================================================
473 
474 // \section ObserverF3 Functions that modify a given abstraction alphabet
475 
476 
477 /**
478  * L(G)-observer computation.
479  * This function modifies a given generator and an associated natural projection
480  * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of
481  * the resulting generator.
482  * This function evaluates the observer algorithm as described in
483  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
484  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
485  *
486  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
487  * rGenObs must be a deterministic generator.
488  * There are no further restrictions on parameters.
489  *
490  * @param rGenObs
491  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
492  * @param rHighAlph
493  * Initial abstraction alphabet
494  * @param rNewHighAlph
495  * Modified abstraction alphabet such that the abstraction is an Lm-observer
496  * @param rMapRelabeledEvents
497  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
498  *
499  * <h4>Example: Computation of an L(G)-observer</h4>
500  * <table class="large_image_table"> <tr> <td> <table>
501  * <tr> <td> Generator with relabeled events </td> </tr>
502  * <tr>
503  * <td> @image html ex_relabel_closed_result.png </td>
504  * </tr>
505  * <tr>
506  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
507  * </table> </td> </tr> <tr> <td> <table width=100%>
508  * <tr> <td> Result of calcAbstAlphClosed(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
509  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
510  * <tr> <td> @image html ex_relabel_closed_high.png</td> </tr>
511  * </table> </td> </tr> </table>
512  *
513  * @ingroup ObserverPlugin
514  */
515 void calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
516 
517 /**
518  * L(G)-observer computation.
519  * This function is called by calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
520  * It modifies a given generator and an associated natural projection
521  * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of
522  * the resulting generator.
523  * This function evaluates the observer algorithm as described in
524  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
525  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
526  *
527  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
528  * rGenObs must be a deterministic generator
529  * no further restrictions on parameters.
530  *
531  * @param rGenObs
532  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
533  * @param rControllableEvents
534  * Set of controllable events
535  * @param rHighAlph
536  * Initial abstraction alphabet
537  * @param rNewHighAlph
538  * Modified abstraction alphabet such that the abstraction is an Lm-observer
539  * @param rMapRelabeledEvents
540  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
541  */
542 void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
543 
544 /**
545  * L(G)-observer computation.
546  * This function is called by void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
547  * It modifies a given generator and an associated natural projection
548  * such that the resulting natural projection is an Lm-observer for the prefix-closed language of
549  * the resulting generator.
550  * This function evaluates the observer algorithm as described in
551  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
552  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
553  *
554  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
555  * rGenObs must be a deterministic generator.
556  * There are no further restrictions on parameters.
557  *
558  * @param rGenObs
559  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
560  * @param rControllableEvents
561  * Set of controllable events
562  * @param rHighAlph
563  * Initial abstraction alphabet
564  * @param rNewHighAlph
565  * Modified abstraction alphabet such that the abstraction is an Lm-observer
566  * @param rMapChangedTrans
567  * Maps the original relabeled transitions to the new events
568  */
569 void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
570 
571 
572 /**
573  * Lm-observer computation.
574  * This function modifies a given generator and an associated natural projection
575  * such that the resulting natural projection is an Lm-observer for the language marked by
576  * the resulting generator.
577  * This function evaluates the observer algorithm as described in
578  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
579  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
580  *
581  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
582  * rGenObs must be a deterministic generator.
583  * There are no further restrictions on parameters.
584  *
585  * @param rGenObs
586  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
587  * @param rHighAlph
588  * Initial abstraction alphabet
589  * @param rNewHighAlph
590  * Modified abstraction alphabet such that the abstraction is an Lm-observer
591  * @param rMapRelabeledEvents
592  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
593  *
594  * <h4>Example: Computation of an Lm(G)-observer</h4>
595  * <table class="large_image_table"> <tr> <td> <table>
596  * <tr> <td> Generator with relabeled events </td> </tr>
597  * <tr>
598  * <td> @image html ex_relabel_obs_result.png </td>
599  * </tr>
600  * <tr>
601  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
602  * </table> </td> </tr> <tr> <td> <table width=100%>
603  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
604  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
605  * <tr> <td> @image html ex_relabel_obs_high.png </td> </tr>
606  * </table> </td> </tr> </table>
607  *
608  * @ingroup ObserverPlugin
609  */
610 void calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
611 
612 /**
613  * Lm-observer computation.
614  * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
615  * It modifies a given generator and an associated natural projection
616  * such that the resulting natural projection is an Lm-observer for the language marked by
617  * the resulting generator.
618  * This function evaluates the observer algorithm as described in
619  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
620  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
621  *
622  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
623  * rGenObs must be a deterministic generator
624  * no further restrictions on parameters.
625  *
626  * @param rGenObs
627  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
628  * @param rControllableEvents
629  * Set of controllable events
630  * @param rHighAlph
631  * Initial abstraction alphabet
632  * @param rNewHighAlph
633  * Modified abstraction alphabet such that the abstraction is an Lm-observer
634  * @param rMapRelabeledEvents
635  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
636  */
637 void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
638 
639 /**
640  * Lm-observer computation.
641  * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
642  * It modifies a given generator and an associated natural projection
643  * such that the resulting natural projection is an Lm-observer for the language marked by
644  * the resulting generator.
645  * This function evaluates the observer algorithm as described in
646  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
647  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
648  *
649  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
650  * rGenObs must be a deterministic generator.
651  * There are no further restrictions on parameters.
652  *
653  * @param rGenObs
654  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
655  * @param rControllableEvents
656  * Set of controllable events
657  * @param rHighAlph
658  * Initial abstraction alphabet
659  * @param rNewHighAlph
660  * Modified abstraction alphabet such that the abstraction is an Lm-observer
661  * @param rMapChangedTrans
662  * Maps the original relabeled transitions to the new events
663  */
664 void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
665 
666 /**
667  * MSA-observer computation.
668  * This function modifies a given generator and an associated natural projection
669  * such that the resulting natural projection is an msa-observer for the language marked by
670  * the resulting generator.
671  * This function evaluates the msa-observer algorithm as described in
672  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
673  * Workshop on Discrete Event Systems, 2006.
674  *
675  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
676  * rGenObs must be a deterministic generator.
677  * There are no further restrictions on parameters.
678  *
679  * @param rGenObs
680  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
681  * @param rHighAlph
682  * Initial abstraction alphabet
683  * @param rNewHighAlph
684  * Modified abstraction alphabet such that the abstraction is an Lm-observer
685  * @param rMapRelabeledEvents
686  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
687  *
688  * <h4>Example: Computation of an MSA-observer</h4>
689  * <table class="large_image_table"> <tr> <td> <table>
690  * <tr> <td> Generator with relabeled events </td> </tr>
691  * <tr>
692  * <td> @image html ex_relabel_msa_result.png </td>
693  * </tr>
694  * <tr>
695  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
696  * </table> </td> </tr> <tr> <td> <table width=100%>
697  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
698  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
699  * <tr> <td> @image html ex_relabel_msa_high.png </td> </tr>
700  * </table> </td> </tr> </table>
701  *
702  * @ingroup ObserverPlugin
703  */
704 void calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
705 
706 /**
707  * MSA-observer computation.
708  * This function is called by calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
709  * It modifies a given generator and an associated natural projection
710  * such that the resulting natural projection is an MSA-observer for the language marked by
711  * the resulting generator.
712  * This function evaluates the observer algorithm as described in
713  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
714  * Workshop on Discrete Event Systems, 2006.
715  *
716  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
717  * rGenObs must be a deterministic generator
718  * no further restrictions on parameters.
719  *
720  * @param rGenObs
721  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
722  * @param rControllableEvents
723  * Set of controllable events
724  * @param rHighAlph
725  * Initial abstraction alphabet
726  * @param rNewHighAlph
727  * Modified abstraction alphabet such that the abstraction is an Lm-observer
728  * @param rMapRelabeledEvents
729  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
730  */
731 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
732 
733 /**
734  * MSA-observer computation.
735  * This function is called by void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
736  * It modifies a given generator and an associated natural projection
737  * such that the resulting natural projection is an MSA-observer for the language marked by
738  * the resulting generator.
739  * This function evaluates the observer algorithm as described in
740  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
741  * Workshop on Discrete Event Systems, 2006.
742  *
743  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
744  * rGenObs must be a deterministic generator.
745  * There are no further restrictions on parameters.
746  *
747  * @param rGenObs
748  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
749  * @param rControllableEvents
750  * Set of controllable events
751  * @param rHighAlph
752  * Initial abstraction alphabet
753  * @param rNewHighAlph
754  * Modified abstraction alphabet such that the abstraction is an Lm-observer
755  * @param rMapChangedTrans
756  * Maps the original relabeled transitions to the new events
757  */
758 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
759 
760 /**
761  * Lm-observer computation including output control consistency (OCC).
762  * This function modifies a given generator and an associated natural projection
763  * such that the resulting natural projection is an Lm-observer for the language marked by
764  * the resulting generator and at the same time fulfills the output control consistency
765  * condition (OCC).
766  * This function evaluates the observer algorithm as described in
767  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
768  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
769  * with an extension to OCC as indicated in
770  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
771  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
772  *
773  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
774  * rGenObs must be a deterministic generator.
775  * There are no further restrictions on parameters.
776  *
777  * @param rGenObs
778  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
779  * @param rHighAlph
780  * Initial abstraction alphabet
781  * @param rNewHighAlph
782  * Modified abstraction alphabet such that the abstraction is an Lm-observer
783  * @param rMapRelabeledEvents
784  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
785  *
786  * <h4>Example: Computation of an Lm-observer with output control consistency (OCC)</h4>
787  * <table class="large_image_table"> <tr> <td> <table>
788  * <tr> <td> Generator with relabeled events </td> </tr>
789  * <tr>
790  * <td> @image html ex_observer_all.png </td>
791  * </tr>
792  * <tr>
793  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
794  * </table> </td> </tr> <tr> <td> <table width=100%>
795  * <tr> <td> Result of calcAbstAlphObsOCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
796  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_3, bNewHLevent_2,
797  * cNewHLevent_2, eNewHLevent_3 </td> </tr>
798  * <tr> <td> @image html ex_synthesis_occ_result.png </td> </tr>
799  * </table> </td> </tr> </table>
800  *
801  * @ingroup ObserverPlugin
802  */
803 // void calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx*/,std::set<Idx > > & rMapRelabeledEvents);
804 
805 /*
806 
807  * Lm-observer computation including output control consistency (OCC).
808  * This function is called by calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
809  * It modifies a given generator and an associated natural projection
810  * such that the resulting natural projection is an Lm-observer for the language marked by
811  * the resulting generator and at the same time fulfills the output control consistency
812  * condition (OCC).
813  * This function evaluates the observer algorithm as described in
814  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
815  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
816  * with an extension to OCC as indicated in
817  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
818  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
819  *
820  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
821  * rGenObs must be a deterministic generator.
822  * There are no further restrictions on parameters.
823  *
824  * @param rGenObs
825  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
826  * @param rControllableEvents
827  * Set of controllable events
828  * @param rHighAlph
829  * Initial abstraction alphabet
830  * @param rNewHighAlph
831  * Modified abstraction alphabet such that the abstraction is an Lm-observer
832  * @param rMapChangedTrans
833  * Maps the original relabeled transitions to the new events
834 
835  void calcAbstAlphObsOCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
836 */
837 
838 /**
839  * Lm-observer computation including local control consistency (LCC).
840  * This function modifies a given generator and an associated natural projection
841  * such that the resulting natural projection is an Lm-observer for the language marked by
842  * the resulting generator and at the same time fulfills the local control consistency
843  * condition (LCC).
844  * The function evaluates the observer algorithm as described in
845  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
846  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
847  * with an extension to LCC as indicated in
848  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
849  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
850  *
851  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
852  * rGenObs must be a deterministic generator.
853  * There are no further restrictions on parameters.
854  *
855  * @param rGenObs
856  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
857  * @param rHighAlph
858  * Initial abstraction alphabet
859  * @param rNewHighAlph
860  * Modified abstraction alphabet such that the abstraction is an Lm-observer
861  * @param rMapRelabeledEvents
862  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
863  *
864  * <h4>Example: Computation of an Lm(G)-observer with local control consistency (LCC)</h4>
865  * <table class="large_image_table"> <tr> <td> <table>
866  * <tr> <td> Generator with relabeled events </td> </tr>
867  * <tr>
868  * <td> @image html ex_relabel_obslcc_result.png </td>
869  * </tr>
870  * <tr>
871  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
872  * </table> </td> </tr> <tr> <td> <table width="100%">
873  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
874  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
875  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
876  * <tr> <td> @image html ex_relabel_obslcc_high.png </td> </tr>
877  * </table> </td> </tr> </table>
878  *
879  * @ingroup ObserverPlugin
880  */
881 void calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
882 
883 /**
884  * Lm-observer computation including local control consistency (LCC).
885  * This function is called by calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
886  * It modifies a given generator and an associated natural projection
887  * such that the resulting natural projection is an Lm-observer for the language marked by
888  * the resulting generator and at the same time fulfills the local control consistency
889  * condition (LCC).
890  * This function evaluates the observer algorithm as described in
891  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
892  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
893  * with an extension to LCC as indicated in
894  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
895  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
896  *
897  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
898  * rGenObs must be a deterministic generator.
899  * There are no further restrictions on parameters.
900  *
901  * @param rGenObs
902  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
903  * @param rControllableEvents
904  * Set of controllable events
905  * @param rHighAlph
906  * Initial abstraction alphabet
907  * @param rNewHighAlph
908  * Modified abstraction alphabet such that the abstraction is an Lm-observer
909  * @param rMapChangedTrans
910  * Maps the original relabeled transitions to the new events
911  */
912 void calcAbstAlphObsLCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
913 
914 /**
915  * MSA-observer computation including local control consistency (LCC).
916  * This function modifies a given generator and an associated natural projection
917  * such that the resulting natural projection is an MSA-observer for the language marked by
918  * the resulting generator and at the same time fulfills the local control consistency
919  * condition (LCC).
920  * This function evaluates the msa-observer algorithm as described in
921  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
922  * Modular Supervisory Control Approaches for Discrete Event Systems,
923  * Workshop on Discrete Event Systems, 2008.
924  * with an extension to LCC as indicated in
925  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
926  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
927  *
928  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
929  * rGenObs must be a deterministic generator.
930  * There are no further restrictions on parameters.
931  *
932  * @param rGenObs
933  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
934  * @param rHighAlph
935  * Initial abstraction alphabet
936  * @param rNewHighAlph
937  * Modified abstraction alphabet such that the abstraction is an Lm-observer
938  * @param rMapRelabeledEvents
939  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
940  *
941  * <h4>Example: Computation of an MSA-observer with local control consistency (LCC)</h4>
942  * <table class="large_image_table"> <tr> <td> <table>
943  * <tr> <td> Generator with relabeled events </td> </tr>
944  * <tr>
945  * <td> @image html ex_relabel_msalcc_result.png </td>
946  * </tr>
947  * <tr>
948  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
949  * </table> </td> </tr> <tr> <td> <table width=100%>
950  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
951  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
952  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
953  * <tr> <td> @image html ex_relabel_msalcc_high.png </td> </tr>
954  * </table> </td> </tr> </table>
955  *
956  * @ingroup ObserverPlugin
957  */
958 void calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
959 
960 /**
961  * MSA-observer computation including local control consistency (LCC).
962  * This function is called by calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
963  * It modifies a given generator and an associated natural projection
964  * such that the resulting natural projection is an MSA-observer for the language marked by
965  * the resulting generator and at the same time fulfills the local control consistency
966  * condition (LCC).
967  * This function evaluates the observer algorithm as described in
968  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
969  * Modular Supervisory Control Approaches for Discrete Event Systems,
970  * Workshop on Discrete Event Systems, 2008.
971  * with an extension to LCC as indicated in
972  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
973  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
974  *
975  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
976  * rGenObs must be a deterministic generator.
977  * There are no further restrictions on parameters.
978  *
979  * @param rGenObs
980  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
981  * @param rControllableEvents
982  * Set of controllable events
983  * @param rHighAlph
984  * Initial abstraction alphabet
985  * @param rNewHighAlph
986  * Modified abstraction alphabet such that the abstraction is an Lm-observer
987  * @param rMapChangedTrans
988  * Maps the original relabeled transitions to the new events
989  */
990 void calcAbstAlphMSALCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
991 
992 /**
993  * Relabeling algorithm for the computation of an Lm-observer.
994  * This function checks the termination criterion of the observer algorithm. If required, transitions of
995  * the input generator are relabeled.
996  *
997  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenRelabel.
998  * There are no further restrictions on parameters.
999  *
1000  * @param rGenRelabel
1001  * Generator whose transitions are modified
1002  * @param rControllableEvents
1003  * Set of controllable events
1004  * @param rHighAlph
1005  * Abstraction alphabet
1006  * @param rMapStateToPartition
1007  * Maps each state of rGenRelabel to an equivalence class
1008  * @param rMapChangedTransReverse
1009  * Maps the relabeled transitions to the original transitions
1010  * @param rMapChangedTrans
1011  * Maps the the modified original transitions to its new events
1012  * @param rMapRelabeledEvents
1013  * Maps the original events to the set of new events they were relabeled with
1014  */
1015 bool relabel(Generator& rGenRelabel, EventSet& rControllableEvents, EventSet& rHighAlph, std::map<Idx,Idx>& rMapStateToPartition, std::map<Transition,Transition>& rMapChangedTransReverse, std::map<Transition,Idx>& rMapChangedTrans, std::map<Idx, EventSet>& rMapRelabeledEvents);
1016 
1017 /**
1018  * Convenience function for relabeling events in a given generator.
1019  * This function inserts new events and respective transitions given by a relableing map
1020  * into a given generator. The function is used to adjust plant components to the relableing
1021  * from another plant component.
1022  *
1023  * Technical note: This version records newly inserted events incl. their respective controllability attribute
1024  * in the third parameter. T
1025  *
1026  * There are no restrictions on parameters.
1027  *
1028  * @param rGenPlant
1029  * Plant component automaton
1030  * @param rMapRelabeledEvents
1031  * Maps the original events to sets of newly introduced events
1032  * @param rNewEvents
1033  * Returns the newly inserted events (accumulative, call clear before)
1034  */
1035 void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, Alphabet& rNewEvents);
1036 
1037 /**
1038  * Convenience function for relabeling events in a given generator.
1039  * This function inserts new events and respective transitions given by a relableing map
1040  * into a given generator.
1041  *
1042  * Technical note: Recording of new events includes attributes, provided that the third parameter has a
1043  * compatible attribute type.
1044  *
1045  * There are no restrictions on parameters.
1046  *
1047  * @param rGenPlant
1048  * Plant component automaton
1049  * @param rMapRelabeledEvents
1050  * Maps the original events to sets of newly introduced events
1051  * @param rNewEvents
1052  * Returns the newly inserted events (accumulative, call clear before)
1053  */
1054 void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, EventSet& rNewEvents);
1055 
1056 /**
1057  * Convenience function for relabeling events in a given generator.
1058  * See insertRelabeledEvents(System&, const std::map<Idx, std::set<Idx> >&, Alphabet&)
1059  *
1060  * There are no restrictions on parameters.
1061  *
1062  * @param rGenPlant
1063  * Plant component automaton
1064  * @param rMapRelabeledEvents
1065  * maps the original events to sets of newly introduced events
1066  */
1067 void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
1068 
1069 
1070 /**
1071  * Convenience function for relabeling events in a given generator.
1072  * See insertRelabeledEvents(Generator&, const std::map<Idx, std::set<Idx> >&, EventSet&)
1073  *
1074  * There are no restrictions on parameters.
1075  *
1076  * @param rGenPlant
1077  * Plant component automaton
1078  * @param rMapRelabeledEvents
1079  * maps the original events to sets of newly introduced events
1080  */
1081 void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
1082 
1083 
1084 
1085 /**
1086  * Rti convenience wrapper for relabeling maps.
1087  *
1088  * The observer plugin uses an STL map from integers to sets of integers
1089  * as re-labeling map. In order to support this data type in the libfaudes
1090  * run-time interface, we provide a wrapper class that is derived
1091  * from faudes Type. The implementation is minimla (no token io).
1092  * Later revisions may use a faudes set with set valued attributes.
1093  */
1094 class EventRelabelMap : public Type {
1096 public:
1097  // std faudes type
1098  EventRelabelMap(void);
1099  EventRelabelMap(const EventRelabelMap& rOther);
1100  virtual ~EventRelabelMap(void);
1101  virtual void Clear(void);
1102  // access data
1103  const std::map<Idx, std::set<Idx> >& StlMap(void) const;
1104  std::map<Idx, std::set<Idx> >& StlMap(void);
1105  void StlMap(const std::map<Idx, std::set<Idx> >& rMap);
1106 protected:
1107  // std faudes type
1108  virtual void DoAssign(const EventRelabelMap& rSrc);
1109  virtual bool DoEqual(const EventRelabelMap& rOther) const;
1110  // my data
1111  std::map<Idx, std::set<Idx> > mMap;
1112 };
1113 
1114 
1115 /**
1116  * Rti convenience wrapper
1117  */
1118 void calcAbstAlphObs(
1119  System& rGenObs,
1120  EventSet& rHighAlph,
1121  EventSet& rNewHighAlph,
1122  EventRelabelMap& rMapRelabeledEvents);
1123 
1124 
1125 /**
1126  * Rti convenience wrapper
1127  */
1128 void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents, EventSet& rNewEvents);
1129 
1130 /**
1131  * Rti convenience wrapper
1132  */
1133 void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents);
1134 
1135 
1136 
1137 
1138 } // namespace
1139 
1140 #endif
1141 

libFAUDES 2.26g --- 2015.08.17 --- c++ api documentaion by doxygen