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

libFAUDES 2.24g --- 2014.09.15 --- c++ api documentaion by doxygen