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  * This function evaluates the observer algorithm as described in
484  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
485  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
486  *
487  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
488  * rGenObs must be a deterministic generator.
489  * There are no further restrictions on parameters.
490  *
491  * @param rGenObs
492  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
493  * @param rHighAlph
494  * Initial abstraction alphabet
495  * @param rNewHighAlph
496  * Modified abstraction alphabet such that the abstraction is an Lm-observer
497  * @param rMapRelabeledEvents
498  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
499  *
500  * <h4>Example: Computation of an L(G)-observer</h4>
501  * <table class="large_image_table"> <tr> <td> <table>
502  * <tr> <td> Generator with relabeled events </td> </tr>
503  * <tr>
504  * <td> @image html ex_relabel_closed_result.png </td>
505  * </tr>
506  * <tr>
507  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
508  * </table> </td> </tr> <tr> <td> <table width=100%>
509  * <tr> <td> Result of calcAbstAlphClosed(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
510  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
511  * <tr> <td> @image html ex_relabel_closed_high.png</td> </tr>
512  * </table> </td> </tr> </table>
513  *
514  * @ingroup ObserverPlugin
515  */
516 extern FAUDES_API void calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
517 
518 /**
519  * L(G)-observer computation.
520  * This function is called by calcAbstAlphClosed(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
521  * It modifies a given generator and an associated natural projection
522  * such that the resulting natural projection is an L(G)-observer for the prefix-closed language of
523  * the resulting generator.
524  * This function evaluates the observer algorithm as described in
525  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
526  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
527  *
528  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
529  * rGenObs must be a deterministic generator
530  * no further restrictions on parameters.
531  *
532  * @param rGenObs
533  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
534  * @param rControllableEvents
535  * Set of controllable events
536  * @param rHighAlph
537  * Initial abstraction alphabet
538  * @param rNewHighAlph
539  * Modified abstraction alphabet such that the abstraction is an Lm-observer
540  * @param rMapRelabeledEvents
541  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
542  */
543 extern FAUDES_API void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
544 
545 /**
546  * L(G)-observer computation.
547  * This function is called by void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
548  * It modifies a given generator and an associated natural projection
549  * such that the resulting natural projection is an Lm-observer for the prefix-closed language of
550  * the resulting generator.
551  * This function evaluates the observer algorithm as described in
552  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
553  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
554  *
555  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
556  * rGenObs must be a deterministic generator.
557  * There are no further restrictions on parameters.
558  *
559  * @param rGenObs
560  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
561  * @param rControllableEvents
562  * Set of controllable events
563  * @param rHighAlph
564  * Initial abstraction alphabet
565  * @param rNewHighAlph
566  * Modified abstraction alphabet such that the abstraction is an Lm-observer
567  * @param rMapChangedTrans
568  * Maps the original relabeled transitions to the new events
569  */
570 extern FAUDES_API void calcAbstAlphClosed(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
571 
572 
573 /**
574  * Lm-observer computation.
575  * This function modifies a given generator and an associated natural projection
576  * such that the resulting natural projection is an Lm-observer for the language marked by
577  * the resulting generator.
578  * This function evaluates the observer algorithm as described in
579  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
580  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
581  *
582  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
583  * rGenObs must be a deterministic generator.
584  * There are no further restrictions on parameters.
585  *
586  * @param rGenObs
587  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
588  * @param rHighAlph
589  * Initial abstraction alphabet
590  * @param rNewHighAlph
591  * Modified abstraction alphabet such that the abstraction is an Lm-observer
592  * @param rMapRelabeledEvents
593  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
594  *
595  * <h4>Example: Computation of an Lm(G)-observer</h4>
596  * <table class="large_image_table"> <tr> <td> <table>
597  * <tr> <td> Generator with relabeled events </td> </tr>
598  * <tr>
599  * <td> @image html ex_relabel_obs_result.png </td>
600  * </tr>
601  * <tr>
602  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
603  * </table> </td> </tr> <tr> <td> <table width=100%>
604  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
605  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
606  * <tr> <td> @image html ex_relabel_obs_high.png </td> </tr>
607  * </table> </td> </tr> </table>
608  *
609  * @ingroup ObserverPlugin
610  */
611 extern FAUDES_API void calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
612 
613 /**
614  * Lm-observer computation.
615  * This function is called by calcAbstAlphObs(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
616  * It modifies a given generator and an associated natural projection
617  * such that the resulting natural projection is an Lm-observer for the language marked by
618  * the resulting generator.
619  * This function evaluates the observer algorithm as described in
620  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
621  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
622  *
623  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
624  * rGenObs must be a deterministic generator
625  * no further restrictions on parameters.
626  *
627  * @param rGenObs
628  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
629  * @param rControllableEvents
630  * Set of controllable events
631  * @param rHighAlph
632  * Initial abstraction alphabet
633  * @param rNewHighAlph
634  * Modified abstraction alphabet such that the abstraction is an Lm-observer
635  * @param rMapRelabeledEvents
636  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
637  */
638 extern FAUDES_API void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
639 
640 /**
641  * Lm-observer computation.
642  * This function is called by void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
643  * It modifies a given generator and an associated natural projection
644  * such that the resulting natural projection is an Lm-observer for the language marked by
645  * the resulting generator.
646  * This function evaluates the observer algorithm as described in
647  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
648  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
649  *
650  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
651  * rGenObs must be a deterministic generator.
652  * There are no further restrictions on parameters.
653  *
654  * @param rGenObs
655  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
656  * @param rControllableEvents
657  * Set of controllable events
658  * @param rHighAlph
659  * Initial abstraction alphabet
660  * @param rNewHighAlph
661  * Modified abstraction alphabet such that the abstraction is an Lm-observer
662  * @param rMapChangedTrans
663  * Maps the original relabeled transitions to the new events
664  */
665 extern FAUDES_API void calcAbstAlphObs(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
666 
667 /**
668  * MSA-observer computation.
669  * This function modifies a given generator and an associated natural projection
670  * such that the resulting natural projection is an msa-observer for the language marked by
671  * the resulting generator.
672  * This function evaluates the msa-observer algorithm as described in
673  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
674  * Workshop on Discrete Event Systems, 2006.
675  *
676  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
677  * rGenObs must be a deterministic generator.
678  * There are no further restrictions on parameters.
679  *
680  * @param rGenObs
681  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
682  * @param rHighAlph
683  * Initial abstraction alphabet
684  * @param rNewHighAlph
685  * Modified abstraction alphabet such that the abstraction is an Lm-observer
686  * @param rMapRelabeledEvents
687  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
688  *
689  * <h4>Example: Computation of an MSA-observer</h4>
690  * <table class="large_image_table"> <tr> <td> <table>
691  * <tr> <td> Generator with relabeled events </td> </tr>
692  * <tr>
693  * <td> @image html ex_relabel_msa_result.png </td>
694  * </tr>
695  * <tr>
696  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
697  * </table> </td> </tr> <tr> <td> <table width=100%>
698  * <tr> <td> Result of calcAbstAlphObs(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
699  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, aNewHLevent_1, eNewHLevent_1, hNewHLevent_1 </td> </tr>
700  * <tr> <td> @image html ex_relabel_msa_high.png </td> </tr>
701  * </table> </td> </tr> </table>
702  *
703  * @ingroup ObserverPlugin
704  */
705 extern FAUDES_API void calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
706 
707 /**
708  * MSA-observer computation.
709  * This function is called by calcAbstAlphMSA(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
710  * It modifies a given generator and an associated natural projection
711  * such that the resulting natural projection is an MSA-observer for the language marked by
712  * the resulting generator.
713  * This function evaluates the observer algorithm as described in
714  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
715  * Workshop on Discrete Event Systems, 2006.
716  *
717  * the alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs
718  * rGenObs must be a deterministic generator
719  * no further restrictions on parameters.
720  *
721  * @param rGenObs
722  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
723  * @param rControllableEvents
724  * Set of controllable events
725  * @param rHighAlph
726  * Initial abstraction alphabet
727  * @param rNewHighAlph
728  * Modified abstraction alphabet such that the abstraction is an Lm-observer
729  * @param rMapRelabeledEvents
730  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
731  */
732 void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
733 
734 /**
735  * MSA-observer computation.
736  * This function is called by void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx, set<Idx> >& rMapRelabeledEvents).
737  * It modifies a given generator and an associated natural projection
738  * such that the resulting natural projection is an MSA-observer for the language marked by
739  * the resulting generator.
740  * This function evaluates the observer algorithm as described in
741  * K. Schmidt and Th. Moor, "Marked String Accepting Observers for the Hierarchical and Decentralized Control of Discrete Event Systems,"
742  * Workshop on Discrete Event Systems, 2006.
743  *
744  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
745  * rGenObs must be a deterministic generator.
746  * There are no further restrictions on parameters.
747  *
748  * @param rGenObs
749  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
750  * @param rControllableEvents
751  * Set of controllable events
752  * @param rHighAlph
753  * Initial abstraction alphabet
754  * @param rNewHighAlph
755  * Modified abstraction alphabet such that the abstraction is an Lm-observer
756  * @param rMapChangedTrans
757  * Maps the original relabeled transitions to the new events
758  */
759 extern FAUDES_API void calcAbstAlphMSA(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
760 
761 // /**
762 // * Lm-observer computation including output control consistency (OCC).
763 // * This function modifies a given generator and an associated natural projection
764 // * such that the resulting natural projection is an Lm-observer for the language marked by
765 // * the resulting generator and at the same time fulfills the output control consistency
766 // * condition (OCC).
767 // * This function evaluates the observer algorithm as described in
768 // * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
769 // * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
770 // * with an extension to OCC as indicated in
771 // * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
772 // * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
773 // *
774 // * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
775 // * rGenObs must be a deterministic generator.
776 // * There are no further restrictions on parameters.
777 // *
778 // * @param rGenObs
779 // * Low-level generator. It is modified by the algorithm by relabeling transitions and events
780 // * @param rHighAlph
781 // * Initial abstraction alphabet
782 // * @param rNewHighAlph
783 // * Modified abstraction alphabet such that the abstraction is an Lm-observer
784 // * @param rMapRelabeledEvents
785 // * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
786 // *
787 // * <h4>Example: Computation of an Lm-observer with output control consistency (OCC)</h4>
788 // * <table class="large_image_table"> <tr> <td> <table>
789 // * <tr> <td> Generator with relabeled events </td> </tr>
790 // * <tr>
791 // * <td> @image html ex_observer_all.png </td>
792 // * </tr>
793 // * <tr>
794 // * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
795 // * </table> </td> </tr> <tr> <td> <table width=100%>
796 // * <tr> <td> Result of calcAbstAlphObsOCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
797 // * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_3, bNewHLevent_2,
798 // * cNewHLevent_2, eNewHLevent_3 </td> </tr>
799 // * <tr> <td> @image html ex_synthesis_occ_result.png </td> </tr>
800 // * </table> </td> </tr> </table>
801 // *
802 // * @ingroup ObserverPlugin
803 // */
804 // void calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx*/,std::set<Idx > > & rMapRelabeledEvents);
805 
806 /*
807 
808  * Lm-observer computation including output control consistency (OCC).
809  * This function is called by calcAbstAlphObsOCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
810  * It modifies a given generator and an associated natural projection
811  * such that the resulting natural projection is an Lm-observer for the language marked by
812  * the resulting generator and at the same time fulfills the output control consistency
813  * condition (OCC).
814  * This function evaluates the observer algorithm as described in
815  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
816  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
817  * with an extension to OCC as indicated in
818  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
819  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
820  *
821  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
822  * rGenObs must be a deterministic generator.
823  * There are no further restrictions on parameters.
824  *
825  * @param rGenObs
826  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
827  * @param rControllableEvents
828  * Set of controllable events
829  * @param rHighAlph
830  * Initial abstraction alphabet
831  * @param rNewHighAlph
832  * Modified abstraction alphabet such that the abstraction is an Lm-observer
833  * @param rMapChangedTrans
834  * Maps the original relabeled transitions to the new events
835 
836  void calcAbstAlphObsOCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
837 */
838 
839 /**
840  * Lm-observer computation including local control consistency (LCC).
841  * This function modifies a given generator and an associated natural projection
842  * such that the resulting natural projection is an Lm-observer for the language marked by
843  * the resulting generator and at the same time fulfills the local control consistency
844  * condition (LCC).
845  * The function evaluates the observer algorithm as described in
846  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
847  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
848  * with an extension to LCC as indicated in
849  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
850  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
851  *
852  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
853  * rGenObs must be a deterministic generator.
854  * There are no further restrictions on parameters.
855  *
856  * @param rGenObs
857  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
858  * @param rHighAlph
859  * Initial abstraction alphabet
860  * @param rNewHighAlph
861  * Modified abstraction alphabet such that the abstraction is an Lm-observer
862  * @param rMapRelabeledEvents
863  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
864  *
865  * <h4>Example: Computation of an Lm(G)-observer with local control consistency (LCC)</h4>
866  * <table class="large_image_table"> <tr> <td> <table>
867  * <tr> <td> Generator with relabeled events </td> </tr>
868  * <tr>
869  * <td> @image html ex_relabel_obslcc_result.png </td>
870  * </tr>
871  * <tr>
872  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
873  * </table> </td> </tr> <tr> <td> <table width="100%">
874  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
875  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
876  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
877  * <tr> <td> @image html ex_relabel_obslcc_high.png </td> </tr>
878  * </table> </td> </tr> </table>
879  *
880  * @ingroup ObserverPlugin
881  */
882 extern FAUDES_API void calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
883 
884 /**
885  * Lm-observer computation including local control consistency (LCC).
886  * This function is called by calcAbstAlphObsLCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
887  * It modifies a given generator and an associated natural projection
888  * such that the resulting natural projection is an Lm-observer for the language marked by
889  * the resulting generator and at the same time fulfills the local control consistency
890  * condition (LCC).
891  * This function evaluates the observer algorithm as described in
892  * K. C. Wong and W. M. Wonham, "On the Computation of Observers in Discrete Event Systems,"
893  * Discrete Event Dynamic Systems, vol. 14, no. 1, pp. 55-107, 2004.
894  * with an extension to LCC as indicated in
895  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
896  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
897  *
898  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
899  * rGenObs must be a deterministic generator.
900  * There are no further restrictions on parameters.
901  *
902  * @param rGenObs
903  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
904  * @param rControllableEvents
905  * Set of controllable events
906  * @param rHighAlph
907  * Initial abstraction alphabet
908  * @param rNewHighAlph
909  * Modified abstraction alphabet such that the abstraction is an Lm-observer
910  * @param rMapChangedTrans
911  * Maps the original relabeled transitions to the new events
912  */
913 extern FAUDES_API void calcAbstAlphObsLCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
914 
915 /**
916  * MSA-observer computation including local control consistency (LCC).
917  * This function modifies a given generator and an associated natural projection
918  * such that the resulting natural projection is an MSA-observer for the language marked by
919  * the resulting generator and at the same time fulfills the local control consistency
920  * condition (LCC).
921  * This function evaluates the msa-observer algorithm as described in
922  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
923  * Modular Supervisory Control Approaches for Discrete Event Systems,
924  * Workshop on Discrete Event Systems, 2008.
925  * with an extension to LCC as indicated in
926  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
927  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
928  *
929  * The alphabet rHighAlph has to be a subset of the alphabet of rGenObs.
930  * rGenObs must be a deterministic generator.
931  * There are no further restrictions on parameters.
932  *
933  * @param rGenObs
934  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
935  * @param rHighAlph
936  * Initial abstraction alphabet
937  * @param rNewHighAlph
938  * Modified abstraction alphabet such that the abstraction is an Lm-observer
939  * @param rMapRelabeledEvents
940  * Maps the original events to sets of newly introduced events (accumulatoive, call clear before)
941  *
942  * <h4>Example: Computation of an MSA-observer with local control consistency (LCC)</h4>
943  * <table class="large_image_table"> <tr> <td> <table>
944  * <tr> <td> Generator with relabeled events </td> </tr>
945  * <tr>
946  * <td> @image html ex_relabel_msalcc_result.png </td>
947  * </tr>
948  * <tr>
949  * <td> Original high-level alphabet (rHighAlph): alpha, beta, gamma </td> </tr>
950  * </table> </td> </tr> <tr> <td> <table width=100%>
951  * <tr> <td> Result of calcAbstAlphObsLCC(rGenObs, rHighAlph, rNewHighAlph, rMapRelabeledEvents); </td> </tr>
952  * <tr> <td> New high-level alphabet (rNewHighAlph): alpha, beta, gamma, d, f, h, aNewHLevent_2, bNewHLevent_1,
953  * cNewHLevent_1, eNewHLevent_2, hNewHLevent_2 </td> </tr>
954  * <tr> <td> @image html ex_relabel_msalcc_high.png </td> </tr>
955  * </table> </td> </tr> </table>
956  *
957  * @ingroup ObserverPlugin
958  */
959 extern FAUDES_API void calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Idx,std::set<Idx > > & rMapRelabeledEvents);
960 
961 /**
962  * MSA-observer computation including local control consistency (LCC).
963  * This function is called by calcAbstAlphMSALCC(System& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents).
964  * It modifies a given generator and an associated natural projection
965  * such that the resulting natural projection is an MSA-observer for the language marked by
966  * the resulting generator and at the same time fulfills the local control consistency
967  * condition (LCC).
968  * This function evaluates the observer algorithm as described in
969  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and
970  * Modular Supervisory Control Approaches for Discrete Event Systems,
971  * Workshop on Discrete Event Systems, 2008.
972  * with an extension to LCC as indicated in
973  * K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
974  * Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
975  *
976  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenObs.
977  * rGenObs must be a deterministic generator.
978  * There are no further restrictions on parameters.
979  *
980  * @param rGenObs
981  * Low-level generator. It is modified by the algorithm by relabeling transitions and events
982  * @param rControllableEvents
983  * Set of controllable events
984  * @param rHighAlph
985  * Initial abstraction alphabet
986  * @param rNewHighAlph
987  * Modified abstraction alphabet such that the abstraction is an Lm-observer
988  * @param rMapChangedTrans
989  * Maps the original relabeled transitions to the new events
990  */
991 extern FAUDES_API void calcAbstAlphMSALCC(Generator& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, std::map<Transition,Idx>& rMapChangedTrans);
992 
993 /**
994  * Relabeling algorithm for the computation of an Lm-observer.
995  * This function checks the termination criterion of the observer algorithm. If required, transitions of
996  * the input generator are relabeled.
997  *
998  * The alphabets rHighAlph and rControllableEvents have to be subsets of the alphabet of rGenRelabel.
999  * There are no further restrictions on parameters.
1000  *
1001  * @param rGenRelabel
1002  * Generator whose transitions are modified
1003  * @param rControllableEvents
1004  * Set of controllable events
1005  * @param rHighAlph
1006  * Abstraction alphabet
1007  * @param rMapStateToPartition
1008  * Maps each state of rGenRelabel to an equivalence class
1009  * @param rMapChangedTransReverse
1010  * Maps the relabeled transitions to the original transitions
1011  * @param rMapChangedTrans
1012  * Maps the the modified original transitions to its new events
1013  * @param rMapRelabeledEvents
1014  * Maps the original events to the set of new events they were relabeled with
1015  */
1016 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);
1017 
1018 /**
1019  * Convenience function for relabeling events in a given generator.
1020  * This function inserts new events and respective transitions given by a relableing map
1021  * into a given generator. The function is used to adjust plant components to the relableing
1022  * from another plant component.
1023  *
1024  * Technical note: This version records newly inserted events incl. their respective controllability attribute
1025  * in the third parameter. T
1026  *
1027  * There are no restrictions on parameters.
1028  *
1029  * @param rGenPlant
1030  * Plant component automaton
1031  * @param rMapRelabeledEvents
1032  * Maps the original events to sets of newly introduced events
1033  * @param rNewEvents
1034  * Returns the newly inserted events (accumulative, call clear before)
1035  */
1036 extern FAUDES_API void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, Alphabet& rNewEvents);
1037 
1038 /**
1039  * Convenience function for relabeling events in a given generator.
1040  * This function inserts new events and respective transitions given by a relableing map
1041  * into a given generator.
1042  *
1043  * Technical note: Recording of new events includes attributes, provided that the third parameter has a
1044  * compatible attribute type.
1045  *
1046  * There are no restrictions on parameters.
1047  *
1048  * @param rGenPlant
1049  * Plant component automaton
1050  * @param rMapRelabeledEvents
1051  * Maps the original events to sets of newly introduced events
1052  * @param rNewEvents
1053  * Returns the newly inserted events (accumulative, call clear before)
1054  */
1055 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents, EventSet& rNewEvents);
1056 
1057 /**
1058  * Convenience function for relabeling events in a given generator.
1059  * See insertRelabeledEvents(System&, const std::map<Idx, std::set<Idx> >&, Alphabet&)
1060  *
1061  * There are no restrictions on parameters.
1062  *
1063  * @param rGenPlant
1064  * Plant component automaton
1065  * @param rMapRelabeledEvents
1066  * maps the original events to sets of newly introduced events
1067  */
1068 extern FAUDES_API void insertRelabeledEvents(System& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
1069 
1070 
1071 /**
1072  * Convenience function for relabeling events in a given generator.
1073  * See insertRelabeledEvents(Generator&, const std::map<Idx, std::set<Idx> >&, EventSet&)
1074  *
1075  * There are no restrictions on parameters.
1076  *
1077  * @param rGenPlant
1078  * Plant component automaton
1079  * @param rMapRelabeledEvents
1080  * maps the original events to sets of newly introduced events
1081  */
1082 void insertRelabeledEvents(Generator& rGenPlant, const std::map<Idx, std::set<Idx> >& rMapRelabeledEvents);
1083 
1084 
1085 
1086 /**
1087  * Rti convenience wrapper for relabeling maps.
1088  *
1089  * The observer plugin uses an STL map from integers to sets of integers
1090  * as re-labeling map. In order to support this data type in the libfaudes
1091  * run-time interface, we provide a wrapper class that is derived
1092  * from faudes Type. The implementation is minimla (no token io).
1093  * Later revisions may use a faudes set with set valued attributes.
1094  */
1097 public:
1098  // std faudes type
1099  EventRelabelMap(void);
1100  EventRelabelMap(const EventRelabelMap& rOther);
1101  virtual ~EventRelabelMap(void);
1102  virtual void Clear(void);
1103  // access data
1104  const std::map<Idx, std::set<Idx> >& StlMap(void) const;
1105  std::map<Idx, std::set<Idx> >& StlMap(void);
1106  void StlMap(const std::map<Idx, std::set<Idx> >& rMap);
1107 protected:
1108  // std faudes type
1109  virtual void DoAssign(const EventRelabelMap& rSrc);
1110  virtual bool DoEqual(const EventRelabelMap& rOther) const;
1111  // my data
1112  std::map<Idx, std::set<Idx> > mMap;
1113 };
1114 
1115 
1116 /**
1117  * Rti convenience wrapper
1118  */
1119 extern FAUDES_API void calcAbstAlphObs(
1120  System& rGenObs,
1121  EventSet& rHighAlph,
1122  EventSet& rNewHighAlph,
1123  EventRelabelMap& rMapRelabeledEvents);
1124 
1125 
1126 /**
1127  * Rti convenience wrapper
1128  */
1129 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents, EventSet& rNewEvents);
1130 
1131 /**
1132  * Rti convenience wrapper
1133  */
1134 extern FAUDES_API void insertRelabeledEvents(Generator& rGenPlant, const EventRelabelMap& rMapRelabeledEvents);
1135 
1136 
1137 
1138 
1139 } // namespace
1140 
1141 #endif
1142 
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:80
#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:566
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:273
TTransSet< TransSort::X2EvX1 > TransSetX2EvX1
Type definition for x2, ev, x1 sorted TTransSet.
Definition: cfl_transset.h:968
NameSet EventSet
Convenience typedef for plain event sets.
Definition: cfl_nameset.h:533
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.32f --- 2024.12.22 --- c++ api documentaion by doxygen