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  * @return
198  * True if the condition is fulfilled, false otherwise
199  */
200 extern FAUDES_API void recursiveCheckLCC(const TransSetX2EvX1& rRevTransSet, const EventSet& rControllableEvents, const EventSet& rHighAlph, Idx currentState, StateSet& rDoneStates);
201 
202 // ================================================================================================
203 // Functions that extend a given abstraction alphabet to achieve the observer property
204 // ================================================================================================
205 
206 
207 // \section ObserverF2 Functions that extend a given abstraction alphabet
208 
209 
210 /**
211  * L(G)-observer computation by adding events to the high-level alphabet.
212  * This function extends a given high-level alphabet such that the resulting natural projection
213  * is an L(G)-observer for the prefix-closed language of the given generator.
214  * This function evaluates the natural observer algorithm as described in
215  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
216  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
217  *
218  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
219  * rGenObs must be a deterministic generator.
220  * There are no further restrictions on parameters.
221  *
222  * @param rGenObs
223  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
224  * @param rHighAlph
225  * Reference to the initial abstraction alphabet that is modified by the algorithm
226  * @return
227  * number of states of the high-level generator
228  *
229  * <h4>Example: Computation of an L(G)-observer</h4>
230  * <table class="large_image_table"> <tr> <td> <table>
231  * <tr> <td> Original generator </td> </tr>
232  * <tr>
233  * <td> @image html ex_natural_all.png </td>
234  * </tr>
235  * <tr>
236  * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr>
237  * </table> </td> </tr> <tr> <td> <table width=100%>
238  * <tr> <td> Result of calcClosedObserver(rGenObs, rHighAlph); </td> </tr>
239  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, h </td> </tr>
240  * <tr> <td> @image html ex_natural_closed_proj.png </td> </tr>
241  * </table> </td> </tr> </table>
242  *
243  * @ingroup ObserverPlugin
244  */
245 extern FAUDES_API Idx calcClosedObserver(const Generator& rGenObs, EventSet& rHighAlph);
246 
247 /**
248  * Lm(G)-observer computation by adding events to the high-level alphabet.
249  * This function extends a given high-level alphabet such that the resulting natural projection
250  * is an Lm(G)-observer for the marked language of the given generator.
251  * This function evaluates the natural observer algorithm as described in
252  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
253  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
254  *
255  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
256  * rGenObs must be a deterministic generator.
257  * There are no further restrictions on parameters.
258  *
259  * @param rGenObs
260  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
261  * @param rHighAlph
262  * Reference to the initial abstraction alphabet that is modified by the algorithm
263  * @return
264  * number of states of the high-level generator
265  *
266  * <h4>Example: Computation of an Lm(G)-observer</h4>
267  * <table class="large_image_table"> <tr> <td> <table>
268  * <tr> <td> Original generator </td> </tr>
269  * <tr>
270  * <td> @image html ex_natural_all.png </td>
271  * </tr>
272  * <tr>
273  * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr>
274  * </table> </td> </tr> <tr> <td> <table width=100%>
275  * <tr> <td> Result of calcNaturalObserver(rGenObs, rHighAlph); </td> </tr>
276  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, delta, h </td> </tr>
277  * <tr> <td> @image html ex_natural_obs_proj.png </td> </tr>
278  * </table> </td> </tr> </table>
279  *
280  * @ingroup ObserverPlugin
281  */
282 extern FAUDES_API Int calcNaturalObserver(const Generator& rGenObs, EventSet& rHighAlph);
283 
284 /**
285  * Lm(G)-observer computation including local control consistency (LCC) by adding events to the high-level alphabet.
286  * This function extends a given high-level alphabet such that the resulting natural projection
287  * is an Lm(G)-observer and locally control consistent (lcc) for the marked language of the given generator.
288  * This function evaluates the natural observer algorithm as described in
289  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
290  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
291  * and uses LCC as defined in
292  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
293  * Modular Supervisory Control Approaches for Discrete Event Systems
294  *
295  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
296  * rGenObs must be a deterministic generator.
297  * There are no further restrictions on parameters.
298  *
299  * @param rGen
300  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
301  * @param rHighAlph
302  * Reference to the initial abstraction alphabet that is modified by the algorithm
303  * @param rControllableEvents
304  * @return
305  * number of states of the high-level generator
306  *
307  * <h4>Example: Computation of an Lm(G)-observer with LCC</h4>
308  * <table class="large_image_table"> <tr> <td> <table>
309  * <tr> <td> Original generator </td> </tr>
310  * <tr>
311  * <td> @image html ex_natural_all.png </td>
312  * </tr>
313  * <tr>
314  * <td> Original high-level alphabet (rHighAlph): alpha, gamma; controllable events: a, f, g, h </td> </tr>
315  * </table> </td> </tr> <tr> <td> <table width=100%>
316  * <tr> <td> Result of calcNaturalObserverLCC(rGenObs, rControllableEvents, rHighAlph); </td> </tr>
317  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, delta, a, e, f, g, h </td> </tr>
318  * <tr> <td> @image html ex_natural_obslcc_proj.png </td> </tr>
319  * </table> </td> </tr> </table>
320  *
321  * @ingroup ObserverPlugin
322  */
323 extern FAUDES_API Int calcNaturalObserverLCC(const Generator& rGen, const EventSet& rControllableEvents, EventSet& rHighAlph);
324 
325 /**
326  * MSA-observer computation by adding events to the high-level alphabet.
327  * This function extends a given high-level alphabet such that the resulting natural projection
328  * is an MSA-observer for the marked language of the given generator.
329  * This function adapts the natural observer algorithm as described in
330  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
331  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
332  * to the msa-obsever property.
333  *
334  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
335  * rGenObs must be a deterministic generator.
336  * There are no further restrictions on parameters.
337  *
338  * @param rGen
339  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
340  * @param rHighAlph
341  * Reference to the initial abstraction alphabet that is modified by the algorithm
342  * @return
343  * number of states of the high-level generator
344  *
345  * <h4>Example: Computation of an msa-observer</h4>
346  * <table class="large_image_table"> <tr> <td> <table>
347  * <tr> <td> Original generator </td> </tr>
348  * <tr>
349  * <td> @image html ex_natural_all.png </td>
350  * </tr>
351  * <tr>
352  * <td> Original high-level alphabet (rHighAlph): alpha, gamma </td> </tr>
353  * </table> </td> </tr> <tr> <td> <table width=100%>
354  * <tr> <td> Result of calcMSAObserver(rGenObs, rHighAlph); </td> </tr>
355  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, h </td> </tr>
356  * <tr> <td> @image html ex_natural_msa_proj.png </td> </tr>
357  * </table> </td> </tr> </table>
358  *
359  * @ingroup ObserverPlugin
360  */
361 extern FAUDES_API Int calcMSAObserver(const Generator& rGen, EventSet& rHighAlph);
362 
363 /**
364  * MSA-observer computation including local control consistency (LCC) by adding events to the high-level alphabet.
365  * This function extends a given high-level alphabet such that the resulting natural projection
366  * is an MSA-observer and locally control consistent (lcc) for the marked language of the given generator.
367  * This function adapts the natural observer algorithm as described in
368  * Lei Feng; Wonham, W.M., "On the Computation of Natural Observers in Discrete-Event Systems,"
369  * Decision and Control, 2006 45th IEEE Conference on , vol., no., pp.428-433, 13-15 Dec. 2006
370  * to the msa-obsever property and uses LCC as defined in
371  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
372  * Modular Supervisory Control Approaches for Discrete Event Systems,
373  * Workshop on Discrete Event Systems, 2008.
374  *
375  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
376  * rGenObs must be a deterministic generator.
377  * There are no further restrictions on parameters.
378  *
379  * @param rGen
380  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
381  * @param rControllableEvents
382  * @param rHighAlph
383  * Reference to the initial abstraction alphabet that is modified by the algorithm
384  * @return
385  * number of states of the high-level generator
386  *
387  * <h4>Example: Computation of an msa-observer with LCC</h4>
388  * <table class="large_image_table"> <tr> <td> <table>
389  * <tr> <td> Original generator </td> </tr>
390  * <tr>
391  * <td> @image html ex_natural_all.png </td>
392  * </tr>
393  * <tr>
394  * <td> Original high-level alphabet (rHighAlph): alpha, gamma; controllable events: a, f, g, h </td> </tr>
395  * </table> </td> </tr> <tr> <td> <table width=100%>
396  * <tr> <td> Result of calcMSAObserverLCC(rGenObs, rControllableEvents, rHighAlph); </td> </tr>
397  * <tr> <td> New high-level alphabet (rHighAlph): alpha, beta, gamma, a, e, f, g, h </td> </tr>
398  * <tr> <td> @image html ex_natural_msalcc_proj.png </td> </tr>
399  * </table> </td> </tr> </table>
400  *
401  * @ingroup ObserverPlugin
402  */
403 extern FAUDES_API Int calcMSAObserverLCC(const Generator& rGen, const EventSet& rControllableEvents, EventSet& rHighAlph);
404 
405 /*
406 
407  obsolet?
408 
409  * Computation of the dynamic system for Delta_occ (fulfillment of the output control consistency property).
410  * This function computes the part of the dynamic system that is needed for evaluating the observer
411  * algorithm for output control consistency
412  *
413  * The alphabet rHighAlph has to be a subset of the alphabet of rGen.
414  * rGen must be a deterministic generator.
415  * There are no further restrictions on parameters.
416  *
417  * @param rGen
418  * Generator for which the dynamic system is computed
419  * @param rControllableEvents
420  * Set of controllable events
421  * @param rHighAlph
422  * Abstraction alphabet
423  * @param rGenDyn
424  * Generator representing the dynamic system
425 
426  void calculateDynamicSystemOCC(const Generator& rGen, EventSet& rControllableEvents, EventSet& rHighAlph, Generator& rGenDyn);
427 
428 */
429 
430 /**
431  * Extension of the high-level alphabet to achieve the Lm-observer property.
432  * This algorithm extends the given high-level alphabet such that nondeterminism and unobservable
433  * transitions in the quotient automaton computed with the current high-level alphabet are removed.
434  * The function is called by calcNaturalObserver.
435  *
436  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
437  * rGenObs must be a deterministic generator.
438  * There are no further restrictions on parameters.
439  *
440  * @param rGenObs
441  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
442  * @param rHighAlph
443  * Reference to the initial abstraction alphabet that is modified by the algorithm
444  * @param rMapStateToPartition
445  * Map from states in rGenObs to states (partitions) in the computed quotient automaton
446  *
447  * @ingroup ObserverPlugin
448  */
449 extern FAUDES_API void ExtendHighAlphabet(const Generator& rGenObs, EventSet& rHighAlph, std::map<Idx,Idx>& rMapStateToPartition);
450 
451 
452 /**
453  * Check if the current alphabet splits all local automata with nondeterminims or unobservable transitions.
454  * This algorithm verifies if nondetermisisms or unobservable transitions are resolved if the given events in
455  * are added to the high-level alphabet. The function is called by ExtendHighAlphabet,
456  *
457  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
458  * rGenObs must be a deterministic generator.
459  * There are no further restrictions on parameters.
460  *
461  * @param rGenObs
462  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
463  * @param rSplitAlphabet
464  * Reference to the current alphabet for splitting verification
465  * @param rNondeterministicStates
466  * vector with states where nondeterminism has to be resolved and the related event
467  * @param entryState
468  * current state that is investigated
469  */
470 extern FAUDES_API bool CheckSplit(const Generator& rGenObs, const EventSet& rSplitAlphabet, const std::vector<std::pair<StateSet, Idx> >& rNondeterministicStates, Idx entryState);
471 
472 
473 // ================================================================================================
474 // Functions that modify the alphabet/transitions of the generator to achieve the observer property
475 // ================================================================================================
476 
477 // \section ObserverF3 Functions that modify a given abstraction alphabet
478 
479 
480 /**
481  * L(G)-observer computation.
482  * This function modifies a given generator and an associated natural projection
483  * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of
484  * the resulting generator.
485  * This function evaluates the observer algorithm as described in
486  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
487  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
488  *
489  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
490  * rGenObs must be a deterministic generator.
491  * There are no further restrictions on parameters.
492  *
493  * @param rGenObs
494  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
495  * @param rHighAlph
496  * Initial abstraction alphabet
497  * @param rNewHighAlph
498  * Modified abstraction alphabet such that the abstraction is an Lm-observer
499  * @param rMapRelabeledEvents
500  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
501  *
502  * <h4>Example: Computation of an L(G)-observer</h4>
503  * <table class="large_image_table"> <tr> <td> <table>
504  * <tr> <td> Generator with relabeled events </td> </tr>
505  * <tr>
506  * <td> @image html ex_relabel_closed_result.png </td>
507  * </tr>
508  * <tr>
509  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
510  * </table> </td> </tr> <tr> <td> <table width=100%>
511  * <tr> <td> Result of calcAbstAlphClosed(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
512  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
513  * <tr> <td> @image html ex_relabel_closed_high.png</td> </tr>
514  * </table> </td> </tr> </table>
515  *
516  * @ingroup ObserverPlugin
517  */
518 extern FAUDES_API void calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
519 
520 /**
521  * L(G)-observer computation.
522  * This function is called by calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
523  * It modifies a given generator and an associated natural projection
524  * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of
525  * the resulting generator.
526  * This function evaluates the observer algorithm as described in
527  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
528  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
529  *
530  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
531  * rGenObs must be a deterministic generator
532  * no further restrictions on parameters.
533  *
534  * @param rGenObs
535  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
536  * @param rControllableEvents
537  * Set of controllable events
538  * @param rHighAlph
539  * Initial abstraction alphabet
540  * @param rNewHighAlph
541  * Modified abstraction alphabet such that the abstraction is an Lm-observer
542  * @param rMapRelabeledEvents
543  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
544  */
545 extern FAUDES_API void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
546 
547 /**
548  * L(G)-observer computation.
549  * This function is called by void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
550  * It modifies a given generator and an associated natural projection
551  * such that the resulting natural projection is an Lm-observer for the prefix-closed language of
552  * the resulting generator.
553  * This function evaluates the observer algorithm as described in
554  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
555  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
556  *
557  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
558  * rGenObs must be a deterministic generator.
559  * There are no further restrictions on parameters.
560  *
561  * @param rGenObs
562  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
563  * @param rControllableEvents
564  * Set of controllable events
565  * @param rHighAlph
566  * Initial abstraction alphabet
567  * @param rNewHighAlph
568  * Modified abstraction alphabet such that the abstraction is an Lm-observer
569  * @param rMapChangedTrans
570  * Maps the original relabeled transitions to the new events
571  */
572 extern FAUDES_API void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
573 
574 
575 /**
576  * Lm-observer computation.
577  * This function modifies a given generator and an associated natural projection
578  * such that the resulting natural projection is an Lm-observer for the language marked by
579  * the resulting generator.
580  * This function evaluates the observer algorithm as described in
581  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
582  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
583  *
584  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
585  * rGenObs must be a deterministic generator.
586  * There are no further restrictions on parameters.
587  *
588  * @param rGenObs
589  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
590  * @param rHighAlph
591  * Initial abstraction alphabet
592  * @param rNewHighAlph
593  * Modified abstraction alphabet such that the abstraction is an Lm-observer
594  * @param rMapRelabeledEvents
595  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
596  *
597  * <h4>Example: Computation of an Lm(G)-observer</h4>
598  * <table class="large_image_table"> <tr> <td> <table>
599  * <tr> <td> Generator with relabeled events </td> </tr>
600  * <tr>
601  * <td> @image html ex_relabel_obs_result.png </td>
602  * </tr>
603  * <tr>
604  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
605  * </table> </td> </tr> <tr> <td> <table width=100%>
606  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
607  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
608  * <tr> <td> @image html ex_relabel_obs_high.png </td> </tr>
609  * </table> </td> </tr> </table>
610  *
611  * @ingroup ObserverPlugin
612  */
613 extern FAUDES_API void calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
614 
615 /**
616  * Lm-observer computation.
617  * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
618  * It modifies a given generator and an associated natural projection
619  * such that the resulting natural projection is an Lm-observer for the language marked by
620  * the resulting generator.
621  * This function evaluates the observer algorithm as described in
622  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
623  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
624  *
625  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
626  * rGenObs must be a deterministic generator
627  * no further restrictions on parameters.
628  *
629  * @param rGenObs
630  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
631  * @param rControllableEvents
632  * Set of controllable events
633  * @param rHighAlph
634  * Initial abstraction alphabet
635  * @param rNewHighAlph
636  * Modified abstraction alphabet such that the abstraction is an Lm-observer
637  * @param rMapRelabeledEvents
638  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
639  */
640 extern FAUDES_API void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
641 
642 /**
643  * Lm-observer computation.
644  * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
645  * It modifies a given generator and an associated natural projection
646  * such that the resulting natural projection is an Lm-observer for the language marked by
647  * the resulting generator.
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  * This function evaluates the msa-observer algorithm as described in
675  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
676  * Workshop on Discrete Event Systems, 2006.
677  *
678  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
679  * rGenObs must be a deterministic generator.
680  * There are no further restrictions on parameters.
681  *
682  * @param rGenObs
683  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
684  * @param rHighAlph
685  * Initial abstraction alphabet
686  * @param rNewHighAlph
687  * Modified abstraction alphabet such that the abstraction is an Lm-observer
688  * @param rMapRelabeledEvents
689  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
690  *
691  * <h4>Example: Computation of an MSA-observer</h4>
692  * <table class="large_image_table"> <tr> <td> <table>
693  * <tr> <td> Generator with relabeled events </td> </tr>
694  * <tr>
695  * <td> @image html ex_relabel_msa_result.png </td>
696  * </tr>
697  * <tr>
698  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
699  * </table> </td> </tr> <tr> <td> <table width=100%>
700  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
701  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
702  * <tr> <td> @image html ex_relabel_msa_high.png </td> </tr>
703  * </table> </td> </tr> </table>
704  *
705  * @ingroup ObserverPlugin
706  */
707 extern FAUDES_API void calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
708 
709 /**
710  * MSA-observer computation.
711  * This function is called by calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
712  * It modifies a given generator and an associated natural projection
713  * such that the resulting natural projection is an MSA-observer for the language marked by
714  * the resulting generator.
715  * This function evaluates the observer algorithm as described in
716  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
717  * Workshop on Discrete Event Systems, 2006.
718  *
719  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
720  * rGenObs must be a deterministic generator
721  * no further restrictions on parameters.
722  *
723  * @param rGenObs
724  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
725  * @param rControllableEvents
726  * Set of controllable events
727  * @param rHighAlph
728  * Initial abstraction alphabet
729  * @param rNewHighAlph
730  * Modified abstraction alphabet such that the abstraction is an Lm-observer
731  * @param rMapRelabeledEvents
732  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
733  */
734 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
735 
736 /**
737  * MSA-observer computation.
738  * This function is called by void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
739  * It modifies a given generator and an associated natural projection
740  * such that the resulting natural projection is an MSA-observer for the language marked by
741  * the resulting generator.
742  * This function evaluates the observer algorithm as described in
743  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
744  * Workshop on Discrete Event Systems, 2006.
745  *
746  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
747  * rGenObs must be a deterministic generator.
748  * There are no further restrictions on parameters.
749  *
750  * @param rGenObs
751  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
752  * @param rControllableEvents
753  * Set of controllable events
754  * @param rHighAlph
755  * Initial abstraction alphabet
756  * @param rNewHighAlph
757  * Modified abstraction alphabet such that the abstraction is an Lm-observer
758  * @param rMapChangedTrans
759  * Maps the original relabeled transitions to the new events
760  */
761 extern FAUDES_API void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
762 
763 // /**
764 // * Lm-observer computation including output control consistency (OCC).
765 // * This function modifies a given generator and an associated natural projection
766 // * such that the resulting natural projection is an Lm-observer for the language marked by
767 // * the resulting generator and at the same time fulfills the output control consistency
768 // * condition (OCC).
769 // * This function evaluates the observer algorithm as described in
770 // * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
771 // * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
772 // * with an extension to OCC as indicated in
773 // * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
774 // * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
775 // *
776 // * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
777 // * rGenObs must be a deterministic generator.
778 // * There are no further restrictions on parameters.
779 // *
780 // * @param rGenObs
781 // * Low-level generator. It is modified by the algorithm by relabeling transitions and events
782 // * @param rHighAlph
783 // * Initial abstraction alphabet
784 // * @param rNewHighAlph
785 // * Modified abstraction alphabet such that the abstraction is an Lm-observer
786 // * @param rMapRelabeledEvents
787 // * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
788 // *
789 // * <h4>Example: Computation of an Lm-observer with output control consistency (OCC)</h4>
790 // * <table class="large_image_table"> <tr> <td> <table>
791 // * <tr> <td> Generator with relabeled events </td> </tr>
792 // * <tr>
793 // * <td> @image html ex_observer_all.png </td>
794 // * </tr>
795 // * <tr>
796 // * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
797 // * </table> </td> </tr> <tr> <td> <table width=100%>
798 // * <tr> <td> Result of calcAbstAlphObsOCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
799 // * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_3, bNewHLevent_2,
800 // * cNewHLevent_2, eNewHLevent_3 </td> </tr>
801 // * <tr> <td> @image html ex_synthesis_occ_result.png </td> </tr>
802 // * </table> </td> </tr> </table>
803 // *
804 // * @ingroup ObserverPlugin
805 // */
806 // void calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx*/,std::set<Idx > > & rMapRelabeledEvents);
807 
808 /*
809 
810  * Lm-observer computation including output control consistency (OCC).
811  * This function is called by calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
812  * It modifies a given generator and an associated natural projection
813  * such that the resulting natural projection is an Lm-observer for the language marked by
814  * the resulting generator and at the same time fulfills the output control consistency
815  * condition (OCC).
816  * This function evaluates the observer algorithm as described in
817  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
818  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
819  * with an extension to OCC as indicated in
820  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
821  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
822  *
823  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
824  * rGenObs must be a deterministic generator.
825  * There are no further restrictions on parameters.
826  *
827  * @param rGenObs
828  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
829  * @param rControllableEvents
830  * Set of controllable events
831  * @param rHighAlph
832  * Initial abstraction alphabet
833  * @param rNewHighAlph
834  * Modified abstraction alphabet such that the abstraction is an Lm-observer
835  * @param rMapChangedTrans
836  * Maps the original relabeled transitions to the new events
837 
838  void calcAbstAlphObsOCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
839 */
840 
841 /**
842  * Lm-observer computation including local control consistency (LCC).
843  * This function modifies a given generator and an associated natural projection
844  * such that the resulting natural projection is an Lm-observer for the language marked by
845  * the resulting generator and at the same time fulfills the local control consistency
846  * condition (LCC).
847  * The function evaluates the observer algorithm as described in
848  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
849  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
850  * with an extension to LCC as indicated in
851  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
852  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
853  *
854  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
855  * rGenObs must be a deterministic generator.
856  * There are no further restrictions on parameters.
857  *
858  * @param rGenObs
859  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
860  * @param rHighAlph
861  * Initial abstraction alphabet
862  * @param rNewHighAlph
863  * Modified abstraction alphabet such that the abstraction is an Lm-observer
864  * @param rMapRelabeledEvents
865  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
866  *
867  * <h4>Example: Computation of an Lm(G)-observer with local control consistency (LCC)</h4>
868  * <table class="large_image_table"> <tr> <td> <table>
869  * <tr> <td> Generator with relabeled events </td> </tr>
870  * <tr>
871  * <td> @image html ex_relabel_obslcc_result.png </td>
872  * </tr>
873  * <tr>
874  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
875  * </table> </td> </tr> <tr> <td> <table width="100%">
876  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
877  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
878  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
879  * <tr> <td> @image html ex_relabel_obslcc_high.png </td> </tr>
880  * </table> </td> </tr> </table>
881  *
882  * @ingroup ObserverPlugin
883  */
884 extern FAUDES_API void calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
885 
886 /**
887  * Lm-observer computation including local control consistency (LCC).
888  * This function is called by calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
889  * It modifies a given generator and an associated natural projection
890  * such that the resulting natural projection is an Lm-observer for the language marked by
891  * the resulting generator and at the same time fulfills the local control consistency
892  * condition (LCC).
893  * This function evaluates the observer algorithm as described in
894  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
895  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
896  * with an extension to LCC as indicated in
897  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
898  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
899  *
900  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
901  * rGenObs must be a deterministic generator.
902  * There are no further restrictions on parameters.
903  *
904  * @param rGenObs
905  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
906  * @param rControllableEvents
907  * Set of controllable events
908  * @param rHighAlph
909  * Initial abstraction alphabet
910  * @param rNewHighAlph
911  * Modified abstraction alphabet such that the abstraction is an Lm-observer
912  * @param rMapChangedTrans
913  * Maps the original relabeled transitions to the new events
914  */
915 extern FAUDES_API void calcAbstAlphObsLCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
916 
917 /**
918  * MSA-observer computation including local control consistency (LCC).
919  * This function modifies a given generator and an associated natural projection
920  * such that the resulting natural projection is an MSA-observer for the language marked by
921  * the resulting generator and at the same time fulfills the local control consistency
922  * condition (LCC).
923  * This function evaluates the msa-observer algorithm as described in
924  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
925  * Modular Supervisory Control Approaches for Discrete Event Systems,
926  * Workshop on Discrete Event Systems, 2008.
927  * with an extension to LCC as indicated in
928  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
929  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
930  *
931  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
932  * rGenObs must be a deterministic generator.
933  * There are no further restrictions on parameters.
934  *
935  * @param rGenObs
936  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
937  * @param rHighAlph
938  * Initial abstraction alphabet
939  * @param rNewHighAlph
940  * Modified abstraction alphabet such that the abstraction is an Lm-observer
941  * @param rMapRelabeledEvents
942  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
943  *
944  * <h4>Example: Computation of an MSA-observer with local control consistency (LCC)</h4>
945  * <table class="large_image_table"> <tr> <td> <table>
946  * <tr> <td> Generator with relabeled events </td> </tr>
947  * <tr>
948  * <td> @image html ex_relabel_msalcc_result.png </td>
949  * </tr>
950  * <tr>
951  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
952  * </table> </td> </tr> <tr> <td> <table width=100%>
953  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
954  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
955  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
956  * <tr> <td> @image html ex_relabel_msalcc_high.png </td> </tr>
957  * </table> </td> </tr> </table>
958  *
959  * @ingroup ObserverPlugin
960  */
961 extern FAUDES_API void calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
962 
963 /**
964  * MSA-observer computation including local control consistency (LCC).
965  * This function is called by calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
966  * It modifies a given generator and an associated natural projection
967  * such that the resulting natural projection is an MSA-observer for the language marked by
968  * the resulting generator and at the same time fulfills the local control consistency
969  * condition (LCC).
970  * This function evaluates the observer algorithm as described in
971  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
972  * Modular Supervisory Control Approaches for Discrete Event Systems,
973  * Workshop on Discrete Event Systems, 2008.
974  * with an extension to LCC as indicated in
975  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
976  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
977  *
978  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
979  * rGenObs must be a deterministic generator.
980  * There are no further restrictions on parameters.
981  *
982  * @param rGenObs
983  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
984  * @param rControllableEvents
985  * Set of controllable events
986  * @param rHighAlph
987  * Initial abstraction alphabet
988  * @param rNewHighAlph
989  * Modified abstraction alphabet such that the abstraction is an Lm-observer
990  * @param rMapChangedTrans
991  * Maps the original relabeled transitions to the new events
992  */
993 extern FAUDES_API void calcAbstAlphMSALCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
994 
995 /**
996  * Relabeling algorithm for the computation of an Lm-observer.
997  * This function checks the termination criterion of the observer algorithm. If required, transitions of
998  * the input generator are relabeled.
999  *
1000  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenRelabel.
1001  * There are no further restrictions on parameters.
1002  *
1003  * @param rGenRelabel
1004  * Generator whose transitions are modified
1005  * @param rControllableEvents
1006  * Set of controllable events
1007  * @param rHighAlph
1008  * Abstraction alphabet
1009  * @param rMapStateToPartition
1010  * Maps each state of rGenRelabel to an equivalence class
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::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 extern FAUDES_API 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 extern FAUDES_API 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 extern FAUDES_API 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  */
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 extern FAUDES_API void calcAbstAlphObs(
1122  System& rGenObs,
1123  EventSet& rHighAlph,
1124  EventSet& rNewHighAlph,
1125  EventRelabelMap& rMapRelabeledEvents);
1126 
1127 
1128 /**
1129  * Rti convenience wrapper
1130  */
1131 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents, EventSet& rNewEvents);
1132 
1133 /**
1134  * Rti convenience wrapper
1135  */
1136 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents);
1137 
1138 
1139 
1140 
1141 } // namespace
1142 
1143 #endif
1144 
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
faudes type declaration macro
Definition: cfl_types.h:867
Rti convenience wrapper for relabeling maps.
std::map< Idx, std::set< Idx > > mMap
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
Set of indices with symbolic names and attributes.
Definition: cfl_nameset.h:564
Generator with controllability attributes.
Base class of all libFAUDES objects that participate in the run-time interface.
Definition: cfl_types.h:239
Base class of all FAUDES generators.
Includes all libFAUDES headers, no plugins.
IndexSet StateSet
Definition: cfl_indexset.h:271
TTransSet< TransSort::X2EvX1 > TransSetX2EvX1
Type definition for x2, ev, x1 sorted TTransSet.
Definition: cfl_transset.h:966
NameSet EventSet
Convenience typedef for plain event sets.
Definition: cfl_nameset.h:531
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
void calcAbstAlphObsLCC(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
Lm-observer computation including local control consistency (LCC).
void calcAbstAlphObs(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
Lm-observer computation.
void calcAbstAlphMSA(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
MSA-observer computation.
Int calcMSAObserverLCC(const Generator &rGen, const EventSet &rControllableEvents, EventSet &rHighAlph)
MSA-observer computation including local control consistency (LCC) by adding events to the high-level...
void calcAbstAlphClosed(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
L(G)-observer computation.
Idx calcClosedObserver(const Generator &rGen, EventSet &rHighAlph)
L(G)-observer computation by adding events to the high-level alphabet.
void calcAbstAlphMSALCC(System &rGenObs, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Idx, set< Idx > > &rMapRelabeledEvents)
MSA-observer computation including local control consistency (LCC).
Int calcNaturalObserverLCC(const Generator &rGen, const EventSet &rControllableEvents, EventSet &rHighAlph)
Lm(G)-observer computation including local control consistency (LCC) by adding events to the high-lev...
void ExtendHighAlphabet(const Generator &rGen, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition)
Extension of the high-level alphabet to achieve the Lm-observer property.
Int calcNaturalObserver(const Generator &rGen, EventSet &rHighAlph)
Lm(G)-observer computation by adding events to the high-level alphabet.
Int calcMSAObserver(const Generator &rGen, EventSet &rHighAlph)
MSA-observer computation by adding events to the high-level alphabet.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
bool recursiveCheckMSABackward(const Generator &rGen, const TransSetX2EvX1 &rRevTransSet, const EventSet &rHighAlph, Idx currentState, StateSet &rDoneStates)
Check if the msa-observer conditions is fulfilled for a given state.
void recursiveCheckLCC(const TransSetX2EvX1 &rRevTransSet, const EventSet &rControllableEvents, const EventSet &rHighAlph, Idx currentState, StateSet &rDoneStates)
Find states that fulfill the lcc condition.
void calculateDynamicSystemMSA(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
Computation of the dynamic system for Delta_msa (local fulfillment of the msa-observer property).
void calculateDynamicSystemClosedObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
Computation of the dynamic system for Delta_sigma (reachable states after the occurrence of one high-...
void calculateDynamicSystemLCC(const Generator &rGen, const EventSet &rControllableEvents, const EventSet &rHighAlph, Generator &rGenDyn)
Computation of the dynamic system for Delta_lcc (fulfillment of the local control consistency propert...
void insertRelabeledEvents(System &rGenPlant, const map< Idx, set< Idx > > &rMapRelabeledEvents, Alphabet &rNewEvents)
Convenience function for relabeling events in a given generator.
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)
Check if the msa-observer conditions is fulfilled for a given state.
bool relabel(Generator &rGenRelabel, EventSet &rControllableEvents, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition, map< Transition, Transition > &rMapChangedTransReverse, map< Transition, Idx > &rMapChangedTrans, map< Idx, EventSet > &rMapRelabeledEvents)
Relabeling algorithm for the computation of an Lm-observer.
long int Int
Type definition for integer type (let target system decide, minimum 32bit)
void calculateDynamicSystemObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
Computation of the dynamic system for Delta_obs (local reachability of a marked state).

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen