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 
38 #ifndef FAUDES_OP_OBSERVERCOMPUTATION_H
39 #define FAUDES_OP_OBSERVERCOMPUTATION_H
40 
41 #include "corefaudes.h"
42 #include "op_debug.h"
43 #include <map>
44 #include <vector>
45 #include <stack>
46 
47 
48 
49 
50 namespace faudes {
51 
52 // ================================================================================================
53 // Functions that compute dynamic systems for different properties related to nonblocking and
54 // maximally permissive hierarchical control
55 // ================================================================================================
56 
57 
58 /**
59  * Computation of the dynamic system for Delta_sigma (reachable states after the occurrence of one high-level event).
60  * This function computes the part of the dynamic system that is needed for evaluating the observer
61  * algorithm for closed languages.
62  *
63  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
64  * rGen must be a deterministic generator.
65  * There are no further restrictions on parameters.
66  *
67  * @param rGen
68  * Generator for which the dynamic system is computed
69  * @param rHighAlph
70  * Abstraction alphabet
71  * @param rGenDyn
72  * Generator representing the dynamic system
73  */
74 extern FAUDES_API void calculateDynamicSystemClosedObs(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn);
75 
76 /**
77  * Computation of the dynamic system for Delta_obs (local reachability of a marked state).
78  * This function computes the part of the dynamic system that is needed for evaluating the observer
79  * algorithm for marked languages.
80  *
81  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
82  * rGen must be a deterministic generator.
83  * There are no further restrictions on parameters.
84  *
85  * @param rGen
86  * Generator for which the dynamic system is computed
87  * @param rHighAlph
88  * Abstraction alphabet
89  * @param rGenDyn
90  * Generator representing the dynamic system
91  */
92 void calculateDynamicSystemObs(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn);
93 
94 /**
95  * Computation of the dynamic system for Delta_msa (local fulfillment of the msa-observer property).
96  * This function computes the part of the dynamic system that is needed for evaluating the observer
97  * algorithm for msa-observers.
98  *
99  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
100  * rGen must be a deterministic generator.
101  * There are no further restrictions on parameters.
102  *
103  * @param rGen
104  * Generator for which the dynamic system is computed
105  * @param rHighAlph
106  * Abstraction alphabet
107  * @param rGenDyn
108  * Generator representing the dynamic system
109  */
110 extern FAUDES_API void calculateDynamicSystemMSA(const Generator& rGen, EventSet& rHighAlph, Generator& rGenDyn);
111 
112 /**
113  * Check if the msa-observer conditions is fulfilled for a given state.
114  * This function performs a forward reachability computation to determine
115  * if the msa-observer condition is fulfilled for a given state.
116  *
117  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
118  * rGen must be a deterministic generator.
119  * There are no further restrictions on parameters.
120  *
121  * @param rGen
122  * Generator for which the dynamic system is computed
123  * @param rHighAlph
124  * Abstraction alphabet
125  * @param currentState
126  * Index of the state to be checked
127  * @param rDoneStates
128  * Set of already investigated states
129  * @return
130  * True if the condition is fulfilled, false otherwise
131  */
132 bool recursiveCheckMSAForward(const Generator& rGen, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates);
133 
134 /**
135  * Check if the msa-observer conditions is fulfilled for a given state.
136  * This function performs a backward reachability computation to determine
137  * if the msa-observer condition is fulfilled for a given state.
138  *
139  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
140  * rGen must be a deterministic generator.
141  * There are no further restrictions on parameters.
142  *
143  * @param rGen
144  * Generator for which the dynamic system is computed
145  * @param rRevTransSet
146  * Reversely ordered transition relation
147  * @param rHighAlph
148  * Abstraction alphabet
149  * @param currentState
150  * Index of the state to be checked
151  * @param rDoneStates
152  * Set of already investigated states
153  * @return
154  * True if the condition is fulfilled, false otherwise
155  */
156 extern FAUDES_API bool recursiveCheckMSABackward(const Generator& rGen, const TransSetX2EvX1& rRevTransSet, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates);
157 
158 /**
159  * Computation of the dynamic system for Delta_lcc (fulfillment of the local control consistency property).
160  * This function computes the part of the dynamic system that is needed for evaluating the observer
161  * algorithm for local control consistency
162  *
163  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
164  * rGen must be a deterministic generator.
165  * There are no further restrictions on parameters.
166  *
167  * @param rGen
168  * Generator for which the dynamic system is computed
169  * @param rControllableEvents
170  * Set of controllable events
171  * @param rHighAlph
172  * Abstraction alphabet
173  * @param rGenDyn
174  * Generator representing the dynamic system
175  */
176 void calculateDynamicSystemLCC(const Generator& rGen, const EventSet& rControllableEvents, const EventSet& rHighAlph, Generator& rGenDyn);
177 
178 /**
179  * Find states that fulfill the lcc condition.
180  * This function performs a backward reachability computation to determine
181  * states where the lcc condition is fulfilled
182  *
183  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
184  * rGen must be a deterministic generator.
185  * There are no further restrictions on parameters.
186  *
187  * @param rRevTransSet
188  * Reversely ordered transition relation
189  * @param rControllableEvents
190  * Set of controllable events
191  * @param rHighAlph
192  * Abstraction alphabet
193  * @param currentState
194  * Index of the start state of the backward reachability computation
195  * @param rDoneStates
196  * Set of already investigated states
197  */
198 extern FAUDES_API 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 extern FAUDES_API 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 extern FAUDES_API 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 extern FAUDES_API 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 extern FAUDES_API 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 extern FAUDES_API 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 extern FAUDES_API void ExtendHighAlphabet(const Generator& rGenObs, EventSet& rHighAlph, std::map<Idx,Idx>& rMapStateToPartition);
448 
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 extern FAUDES_API 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  *
484  * This function evaluates the observer algorithm as described in
485  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
486  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
487  *
488  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
489  * rGenObs must be a deterministic generator.
490  * There are no further restrictions on parameters.
491  *
492  * @param rGenObs
493  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
494  * @param rHighAlph
495  * Initial abstraction alphabet
496  * @param rNewHighAlph
497  * Modified abstraction alphabet such that the abstraction is an Lm-observer
498  * @param rMapRelabeledEvents
499  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
500  *
501  * <h4>Example: Computation of an L(G)-observer</h4>
502  * <table class="large_image_table"> <tr> <td> <table>
503  * <tr> <td> Generator with relabeled events </td> </tr>
504  * <tr>
505  * <td> @image html ex_relabel_closed_result.png </td>
506  * </tr>
507  * <tr>
508  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
509  * </table> </td> </tr> <tr> <td> <table width=100%>
510  * <tr> <td> Result of calcAbstAlphClosed(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
511  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
512  * <tr> <td> @image html ex_relabel_closed_high.png</td> </tr>
513  * </table> </td> </tr> </table>
514  *
515  * @ingroup ObserverPlugin
516  */
517 extern FAUDES_API void calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
518 
519 /**
520  * L(G)-observer computation.
521  * This function is called by calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
522  * It modifies a given generator and an associated natural projection
523  * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of
524  * the resulting generator.
525  * This function evaluates the observer algorithm as described in
526  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
527  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
528  *
529  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
530  * rGenObs must be a deterministic generator
531  * no further restrictions on parameters.
532  *
533  * @param rGenObs
534  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
535  * @param rControllableEvents
536  * Set of controllable events
537  * @param rHighAlph
538  * Initial abstraction alphabet
539  * @param rNewHighAlph
540  * Modified abstraction alphabet such that the abstraction is an Lm-observer
541  * @param rMapRelabeledEvents
542  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
543  */
544 extern FAUDES_API void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
545 
546 /**
547  * L(G)-observer computation.
548  * This function is called by void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
549  * It modifies a given generator and an associated natural projection
550  * such that the resulting natural projection is an Lm-observer for the prefix-closed language of
551  * the resulting generator.
552  * This function evaluates the observer algorithm as described in
553  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
554  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
555  *
556  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
557  * rGenObs must be a deterministic generator.
558  * There are no further restrictions on parameters.
559  *
560  * @param rGenObs
561  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
562  * @param rControllableEvents
563  * Set of controllable events
564  * @param rHighAlph
565  * Initial abstraction alphabet
566  * @param rNewHighAlph
567  * Modified abstraction alphabet such that the abstraction is an Lm-observer
568  * @param rMapChangedTrans
569  * Maps the original relabeled transitions to the new events
570  */
571 extern FAUDES_API void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
572 
573 
574 /**
575  * Lm-observer computation.
576  * This function modifies a given generator and an associated natural projection
577  * such that the resulting natural projection is an Lm-observer for the language marked by
578  * the resulting generator.
579  * This function evaluates the observer algorithm as described in
580  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
581  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
582  *
583  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
584  * rGenObs must be a deterministic generator.
585  * There are no further restrictions on parameters.
586  *
587  * @param rGenObs
588  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
589  * @param rHighAlph
590  * Initial abstraction alphabet
591  * @param rNewHighAlph
592  * Modified abstraction alphabet such that the abstraction is an Lm-observer
593  * @param rMapRelabeledEvents
594  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
595  *
596  * <h4>Example: Computation of an Lm(G)-observer</h4>
597  * <table class="large_image_table"> <tr> <td> <table>
598  * <tr> <td> Generator with relabeled events </td> </tr>
599  * <tr>
600  * <td> @image html ex_relabel_obs_result.png </td>
601  * </tr>
602  * <tr>
603  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
604  * </table> </td> </tr> <tr> <td> <table width=100%>
605  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
606  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
607  * <tr> <td> @image html ex_relabel_obs_high.png </td> </tr>
608  * </table> </td> </tr> </table>
609  *
610  * @ingroup ObserverPlugin
611  */
612 extern FAUDES_API void calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
613 
614 /**
615  * Lm-observer computation.
616  * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
617  * It modifies a given generator and an associated natural projection
618  * such that the resulting natural projection is an Lm-observer for the language marked by
619  * the resulting generator.
620  * This function evaluates the observer algorithm as described in
621  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
622  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
623  *
624  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
625  * rGenObs must be a deterministic generator
626  * no further restrictions on parameters.
627  *
628  * @param rGenObs
629  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
630  * @param rControllableEvents
631  * Set of controllable events
632  * @param rHighAlph
633  * Initial abstraction alphabet
634  * @param rNewHighAlph
635  * Modified abstraction alphabet such that the abstraction is an Lm-observer
636  * @param rMapRelabeledEvents
637  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
638  */
639 extern FAUDES_API void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
640 
641 /**
642  * Lm-observer computation.
643  * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
644  * It modifies a given generator and an associated natural projection
645  * such that the resulting natural projection is an Lm-observer for the language marked by
646  * the resulting generator.
647  *
648  * This function evaluates the observer algorithm as described in
649  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
650  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
651  *
652  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
653  * rGenObs must be a deterministic generator.
654  * There are no further restrictions on parameters.
655  *
656  * @param rGenObs
657  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
658  * @param rControllableEvents
659  * Set of controllable events
660  * @param rHighAlph
661  * Initial abstraction alphabet
662  * @param rNewHighAlph
663  * Modified abstraction alphabet such that the abstraction is an Lm-observer
664  * @param rMapChangedTrans
665  * Maps the original relabeled transitions to the new events
666  */
667 extern FAUDES_API void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
668 
669 /**
670  * MSA-observer computation.
671  * This function modifies a given generator and an associated natural projection
672  * such that the resulting natural projection is an msa-observer for the language marked by
673  * the resulting generator.
674  *
675  * This function evaluates the msa-observer algorithm as described in
676  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
677  * Workshop on Discrete Event Systems, 2006.
678  *
679  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
680  * rGenObs must be a deterministic generator.
681  * There are no further restrictions on parameters.
682  *
683  * @param rGenObs
684  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
685  * @param rHighAlph
686  * Initial abstraction alphabet
687  * @param rNewHighAlph
688  * Modified abstraction alphabet such that the abstraction is an Lm-observer
689  * @param rMapRelabeledEvents
690  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
691  *
692  * <h4>Example: Computation of an MSA-observer</h4>
693  * <table class="large_image_table"> <tr> <td> <table>
694  * <tr> <td> Generator with relabeled events </td> </tr>
695  * <tr>
696  * <td> @image html ex_relabel_msa_result.png </td>
697  * </tr>
698  * <tr>
699  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
700  * </table> </td> </tr> <tr> <td> <table width=100%>
701  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
702  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
703  * <tr> <td> @image html ex_relabel_msa_high.png </td> </tr>
704  * </table> </td> </tr> </table>
705  *
706  * @ingroup ObserverPlugin
707  */
708 extern FAUDES_API void calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
709 
710 /**
711  * MSA-observer computation.
712  * This function is called by calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
713  * It modifies a given generator and an associated natural projection
714  * such that the resulting natural projection is an MSA-observer for the language marked by
715  * the resulting generator.
716  *
717  * This function evaluates the observer algorithm as described in
718  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
719  * Workshop on Discrete Event Systems, 2006.
720  *
721  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
722  * rGenObs must be a deterministic generator
723  * no further restrictions on parameters.
724  *
725  * @param rGenObs
726  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
727  * @param rControllableEvents
728  * Set of controllable events
729  * @param rHighAlph
730  * Initial abstraction alphabet
731  * @param rNewHighAlph
732  * Modified abstraction alphabet such that the abstraction is an Lm-observer
733  * @param rMapRelabeledEvents
734  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
735  */
736 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
737 
738 /**
739  * MSA-observer computation.
740  * This function is called by void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
741  * It modifies a given generator and an associated natural projection
742  * such that the resulting natural projection is an MSA-observer for the language marked by
743  * the resulting generator.
744  * This function evaluates the observer algorithm as described in
745  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
746  * Workshop on Discrete Event Systems, 2006.
747  *
748  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
749  * rGenObs must be a deterministic generator.
750  * There are no further restrictions on parameters.
751  *
752  * @param rGenObs
753  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
754  * @param rControllableEvents
755  * Set of controllable events
756  * @param rHighAlph
757  * Initial abstraction alphabet
758  * @param rNewHighAlph
759  * Modified abstraction alphabet such that the abstraction is an Lm-observer
760  * @param rMapChangedTrans
761  * Maps the original relabeled transitions to the new events
762  */
763 extern FAUDES_API void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
764 
765 // /**
766 // * Lm-observer computation including output control consistency (OCC).
767 // * This function modifies a given generator and an associated natural projection
768 // * such that the resulting natural projection is an Lm-observer for the language marked by
769 // * the resulting generator and at the same time fulfills the output control consistency
770 // * condition (OCC).
771 // * This function evaluates the observer algorithm as described in
772 // * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
773 // * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
774 // * with an extension to OCC as indicated in
775 // * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
776 // * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
777 // *
778 // * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
779 // * rGenObs must be a deterministic generator.
780 // * There are no further restrictions on parameters.
781 // *
782 // * @param rGenObs
783 // * Low-level generator. It is modified by the algorithm by relabeling transitions and events
784 // * @param rHighAlph
785 // * Initial abstraction alphabet
786 // * @param rNewHighAlph
787 // * Modified abstraction alphabet such that the abstraction is an Lm-observer
788 // * @param rMapRelabeledEvents
789 // * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
790 // *
791 // * <h4>Example: Computation of an Lm-observer with output control consistency (OCC)</h4>
792 // * <table class="large_image_table"> <tr> <td> <table>
793 // * <tr> <td> Generator with relabeled events </td> </tr>
794 // * <tr>
795 // * <td> @image html ex_observer_all.png </td>
796 // * </tr>
797 // * <tr>
798 // * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
799 // * </table> </td> </tr> <tr> <td> <table width=100%>
800 // * <tr> <td> Result of calcAbstAlphObsOCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
801 // * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_3, bNewHLevent_2,
802 // * cNewHLevent_2, eNewHLevent_3 </td> </tr>
803 // * <tr> <td> @image html ex_synthesis_occ_result.png </td> </tr>
804 // * </table> </td> </tr> </table>
805 // *
806 // * @ingroup ObserverPlugin
807 // */
808 // void calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx*/,std::set<Idx > > & rMapRelabeledEvents);
809 
810 /*
811 
812  * Lm-observer computation including output control consistency (OCC).
813  * This function is called by calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
814  * It modifies a given generator and an associated natural projection
815  * such that the resulting natural projection is an Lm-observer for the language marked by
816  * the resulting generator and at the same time fulfills the output control consistency
817  * condition (OCC).
818  * This function evaluates the observer algorithm as described in
819  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
820  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
821  * with an extension to OCC as indicated in
822  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
823  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
824  *
825  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
826  * rGenObs must be a deterministic generator.
827  * There are no further restrictions on parameters.
828  *
829  * @param rGenObs
830  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
831  * @param rControllableEvents
832  * Set of controllable events
833  * @param rHighAlph
834  * Initial abstraction alphabet
835  * @param rNewHighAlph
836  * Modified abstraction alphabet such that the abstraction is an Lm-observer
837  * @param rMapChangedTrans
838  * Maps the original relabeled transitions to the new events
839 
840  void calcAbstAlphObsOCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
841 */
842 
843 /**
844  * Lm-observer computation including local control consistency (LCC).
845  * This function modifies a given generator and an associated natural projection
846  * such that the resulting natural projection is an Lm-observer for the language marked by
847  * the resulting generator and at the same time fulfills the local control consistency
848  * condition (LCC).
849  * The function evaluates the observer algorithm as described in
850  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
851  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
852  * with an extension to LCC as indicated in
853  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
854  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
855  *
856  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
857  * rGenObs must be a deterministic generator.
858  * There are no further restrictions on parameters.
859  *
860  * @param rGenObs
861  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
862  * @param rHighAlph
863  * Initial abstraction alphabet
864  * @param rNewHighAlph
865  * Modified abstraction alphabet such that the abstraction is an Lm-observer
866  * @param rMapRelabeledEvents
867  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
868  *
869  * <h4>Example: Computation of an Lm(G)-observer with local control consistency (LCC)</h4>
870  * <table class="large_image_table"> <tr> <td> <table>
871  * <tr> <td> Generator with relabeled events </td> </tr>
872  * <tr>
873  * <td> @image html ex_relabel_obslcc_result.png </td>
874  * </tr>
875  * <tr>
876  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
877  * </table> </td> </tr> <tr> <td> <table width="100%">
878  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
879  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
880  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
881  * <tr> <td> @image html ex_relabel_obslcc_high.png </td> </tr>
882  * </table> </td> </tr> </table>
883  *
884  * @ingroup ObserverPlugin
885  */
886 extern FAUDES_API void calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
887 
888 /**
889  * Lm-observer computation including local control consistency (LCC).
890  * This function is called by calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
891  * It modifies a given generator and an associated natural projection
892  * such that the resulting natural projection is an Lm-observer for the language marked by
893  * the resulting generator and at the same time fulfills the local control consistency
894  * condition (LCC).
895  * This function evaluates the observer algorithm as described in
896  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
897  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
898  * with an extension to LCC as indicated in
899  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
900  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
901  *
902  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
903  * rGenObs must be a deterministic generator.
904  * There are no further restrictions on parameters.
905  *
906  * @param rGenObs
907  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
908  * @param rControllableEvents
909  * Set of controllable events
910  * @param rHighAlph
911  * Initial abstraction alphabet
912  * @param rNewHighAlph
913  * Modified abstraction alphabet such that the abstraction is an Lm-observer
914  * @param rMapChangedTrans
915  * Maps the original relabeled transitions to the new events
916  */
917 extern FAUDES_API void calcAbstAlphObsLCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
918 
919 /**
920  * MSA-observer computation including local control consistency (LCC).
921  * This function modifies a given generator and an associated natural projection
922  * such that the resulting natural projection is an MSA-observer for the language marked by
923  * the resulting generator and at the same time fulfills the local control consistency
924  * condition (LCC).
925  * This function evaluates the msa-observer algorithm as described in
926  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
927  * Modular Supervisory Control Approaches for Discrete Event Systems,
928  * Workshop on Discrete Event Systems, 2008.
929  * with an extension to LCC as indicated in
930  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
931  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
932  *
933  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
934  * rGenObs must be a deterministic generator.
935  * There are no further restrictions on parameters.
936  *
937  * @param rGenObs
938  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
939  * @param rHighAlph
940  * Initial abstraction alphabet
941  * @param rNewHighAlph
942  * Modified abstraction alphabet such that the abstraction is an Lm-observer
943  * @param rMapRelabeledEvents
944  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
945  *
946  * <h4>Example: Computation of an MSA-observer with local control consistency (LCC)</h4>
947  * <table class="large_image_table"> <tr> <td> <table>
948  * <tr> <td> Generator with relabeled events </td> </tr>
949  * <tr>
950  * <td> @image html ex_relabel_msalcc_result.png </td>
951  * </tr>
952  * <tr>
953  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
954  * </table> </td> </tr> <tr> <td> <table width=100%>
955  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
956  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
957  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
958  * <tr> <td> @image html ex_relabel_msalcc_high.png </td> </tr>
959  * </table> </td> </tr> </table>
960  *
961  * @ingroup ObserverPlugin
962  */
963 extern FAUDES_API void calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
964 
965 /**
966  * MSA-observer computation including local control consistency (LCC).
967  * This function is called by calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
968  * It modifies a given generator and an associated natural projection
969  * such that the resulting natural projection is an MSA-observer for the language marked by
970  * the resulting generator and at the same time fulfills the local control consistency
971  * condition (LCC).
972  * This function evaluates the observer algorithm as described in
973  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
974  * Modular Supervisory Control Approaches for Discrete Event Systems,
975  * Workshop on Discrete Event Systems, 2008.
976  * with an extension to LCC as indicated in
977  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
978  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
979  *
980  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
981  * rGenObs must be a deterministic generator.
982  * There are no further restrictions on parameters.
983  *
984  * @param rGenObs
985  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
986  * @param rControllableEvents
987  * Set of controllable events
988  * @param rHighAlph
989  * Initial abstraction alphabet
990  * @param rNewHighAlph
991  * Modified abstraction alphabet such that the abstraction is an Lm-observer
992  * @param rMapChangedTrans
993  * Maps the original relabeled transitions to the new events
994  */
995 extern FAUDES_API void calcAbstAlphMSALCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
996 
997 /**
998  * Relabeling algorithm for the computation of an Lm-observer.
999  * This function checks the termination criterion of the observer algorithm. If required, transitions of
1000  * the input generator are relabeled.
1001  *
1002  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenRelabel.
1003  * There are no further restrictions on parameters.
1004  *
1005  * @param rGenRelabel
1006  * Generator whose transitions are modified
1007  * @param rControllableEvents
1008  * Set of controllable events
1009  * @param rHighAlph
1010  * Abstraction alphabet
1011  * @param rMapStateToPartition
1012  * Maps each state of rGenRelabel to an equivalence class
1013  * @param rMapChangedTransReverse
1014  * Maps the relabeled transitions to the original transitions
1015  * @param rMapChangedTrans
1016  * Maps the the modified original transitions to its new events
1017  * @param rMapRelabeledEvents
1018  * Maps the original events to the set of new events they were relabeled with
1019  */
1020 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);
1021 
1022 /**
1023  * Convenience function for relabeling events in a given generator.
1024  * This function inserts new events and respective transitions given by a relableing map
1025  * into a given generator. The function is used to adjust plant components to the relableing
1026  * from another plant component.
1027  *
1028  * Technical note: This version records newly inserted events incl. their respective controllability attribute
1029  * in the third parameter. T
1030  *
1031  * There are no restrictions on parameters.
1032  *
1033  * @param rGenPlant
1034  * Plant component automaton
1035  * @param rMapRelabeledEvents
1036  * Maps the original events to sets of newly introduced events
1037  * @param rNewEvents
1038  * Returns the newly inserted events (accumulative, call clear before)
1039  */
1040 extern FAUDES_API void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, Alphabet& rNewEvents);
1041 
1042 /**
1043  * Convenience function for relabeling events in a given generator.
1044  * This function inserts new events and respective transitions given by a relableing map
1045  * into a given generator.
1046  *
1047  * Technical note: Recording of new events includes attributes, provided that the third parameter has a
1048  * compatible attribute type.
1049  *
1050  * There are no restrictions on parameters.
1051  *
1052  * @param rGenPlant
1053  * Plant component automaton
1054  * @param rMapRelabeledEvents
1055  * Maps the original events to sets of newly introduced events
1056  * @param rNewEvents
1057  * Returns the newly inserted events (accumulative, call clear before)
1058  */
1059 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, EventSet& rNewEvents);
1060 
1061 /**
1062  * Convenience function for relabeling events in a given generator.
1063  * See insertRelabeledEvents(System&, const std::map<Idx, std::set<Idx> >&, Alphabet&)
1064  *
1065  * There are no restrictions on parameters.
1066  *
1067  * @param rGenPlant
1068  * Plant component automaton
1069  * @param rMapRelabeledEvents
1070  * maps the original events to sets of newly introduced events
1071  */
1072 extern FAUDES_API void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
1073 
1074 
1075 /**
1076  * Convenience function for relabeling events in a given generator.
1077  * See insertRelabeledEvents(Generator&, const std::map<Idx, std::set<Idx> >&, EventSet&)
1078  *
1079  * There are no restrictions on parameters.
1080  *
1081  * @param rGenPlant
1082  * Plant component automaton
1083  * @param rMapRelabeledEvents
1084  * maps the original events to sets of newly introduced events
1085  */
1086 void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
1087 
1088 
1089 
1090 /**
1091  * RTI convenience wrapper for relabeling maps.
1092  *
1093  * The observer plugin uses an STL map from integers to sets of integers
1094  * as re-labeling map. In order to support this data type in the libfaudes
1095  * run-time interface, we provide a wrapper class that is derived
1096  * from faudes Type. The implementation is minimal (no token io).
1097  * Later revisions may use a faudes set with set valued attributes.
1098  */
1101 public:
1102  // std faudes type
1103  EventRelabelMap(void);
1104  EventRelabelMap(const EventRelabelMap& rOther);
1105  virtual ~EventRelabelMap(void);
1106  virtual void Clear(void);
1107  // access data
1108  const std::map<Idx, std::set<Idx> >& StlMap(void) const;
1109  std::map<Idx, std::set<Idx> >& StlMap(void);
1110  void StlMap(const std::map<Idx, std::set<Idx> >& rMap);
1111 protected:
1112  // std faudes type
1113  virtual void DoAssign(const EventRelabelMap& rSrc);
1114  virtual bool DoEqual(const EventRelabelMap& rOther) const;
1115  // my data
1116  std::map<Idx, std::set<Idx> > mMap;
1117 };
1118 
1119 
1120 /**
1121  * Rti convenience wrapper
1122  */
1123 extern FAUDES_API void calcAbstAlphObs(
1124  System& rGenObs,
1125  EventSet& rHighAlph,
1126  EventSet& rNewHighAlph,
1127  EventRelabelMap& rMapRelabeledEvents);
1128 
1129 
1130 /**
1131  * Rti convenience wrapper
1132  */
1133 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents, EventSet& rNewEvents);
1134 
1135 /**
1136  * Rti convenience wrapper
1137  */
1138 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents);
1139 
1140 
1141 
1142 
1143 } // namespace
1144 
1145 #endif
1146 
#define FAUDES_API
Definition: cfl_platform.h:85
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition: cfl_types.h:879
std::map< Idx, std::set< Idx > > mMap
IndexSet StateSet
Definition: cfl_indexset.h:296
TTransSet< TransSort::X2EvX1 > TransSetX2EvX1
NameSet EventSet
Definition: cfl_nameset.h:546
vGenerator Generator
void calcAbstAlphObsLCC(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
Int calcNaturalObserver(const Generator &rGen, EventSet &rHighAlph)
void calcAbstAlphObs(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
void calcAbstAlphMSA(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
Int calcMSAObserverLCC(const Generator &rGen, const EventSet &rControllableEvents, EventSet &rHighAlph)
void calcAbstAlphClosed(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
void calcAbstAlphMSALCC(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
Int calcNaturalObserverLCC(const Generator &rGen, const EventSet &rControllableEvents, EventSet &rHighAlph)
Idx calcClosedObserver(const Generator &rGen, EventSet &rHighAlph)
void ExtendHighAlphabet(const Generator &rGen, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition)
Int calcMSAObserver(const Generator &rGen, EventSet &rHighAlph)
uint32_t Idx
bool recursiveCheckMSABackward(const Generator &rGen, const TransSetX2EvX1 &rRevTransSet, const EventSet &rHighAlph, Idx currentState, StateSet &rDoneStates)
void calculateDynamicSystemMSA(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
void calculateDynamicSystemClosedObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
void calculateDynamicSystemLCC(const Generator &rGen, const EventSet &rControllableEvents, const EventSet &rHighAlph, Generator &rGenDyn)
void insertRelabeledEvents(System &rGenPlant, const map< Idx, set< Idx > > &rMapRelabeledEvents, Alphabet &rNewEvents)
void recursiveCheckLCC(const TransSetX2EvX1 &rRevTransSet, const EventSet &rControllableEvents, const EventSet &rHighAlph, Idx currentState, StateSet &rDoneStates)
bool CheckSplit(const Generator &rGen, const EventSet &rSplitAlphabet, const vector< pair< StateSet, Idx > > &rNondeterministicStates, Idx entryState)
bool recursiveCheckMSAForward(const Generator &rGen, const EventSet &rHighAlph, Idx currentState, StateSet &rDoneStates)
bool relabel(Generator &rGenRelabel, EventSet &rControllableEvents, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition, map< Transition, Transition > &rMapChangedTransReverse, map< Transition, Idx > &rMapChangedTrans, map< Idx, EventSet > &rMapRelabeledEvents)
long int Int
void calculateDynamicSystemObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)

libFAUDES 2.33l --- 2025.09.16 --- c++ api documentaion by doxygen