ios_algorithms.h
Go to the documentation of this file.
1 /** @file ios_algorithms.h Algorithms addressing I/O-systems */
2 
3 /*
4  IO Systems Plug-In
5  for FAU Discrete Event Systems Library (libFAUDES)
6 
7  Copyright (C) 2010, Thomas Wittmann, Thomas Moor
8 
9 */
10 
11 #ifndef FAUDES_IOS_ALGORITHMS
12 #define FAUDES_IOS_ALGORITHMS
13 
14 #include "ios_system.h"
15 
16 namespace faudes {
17 
18 /**
19  * Test whether the system satisfies basic I/O conditions.
20  *
21  * The I/O conditions tested are
22  * - Lm(G) is complete (each string can be extended);
23  * - U and Y are a disjoint decomposition of Sigma;
24  * - neither U nor Y is empty;
25  * - U and Y events alternate;
26  *
27  * To test the last propertie, the procedure partitions the state
28  * set in states QU that enable input events and states QY that enables
29  * output-put events. The latter two state sets are returned in rQY and rQU.
30  * States that either block or enable both input and outputs are
31  * return in rQErr.
32  *
33  * Note: this procedure is not concerned with whether the first event
34  * should be an input or an output; neither does it require the input
35  * to be free; see bool IsInputLocallyFree(IoSystem&).
36  *
37  * Note: this procedure does not set the state attributes;
38  * see also bool IsIoSystem(IoSystem&).
39  *
40  * @param rIoSystem
41  * Generator to test.
42  * @param rQY
43  * Output states
44  * @param rQU
45  * Input states
46  * @param rQErr
47  * Undecided states
48  * @return
49  * True <> system is an io system.
50  *
51  * @ingroup IoSysPlugin
52  */
53 bool IsIoSystem(const IoSystem& rIoSystem,
54  StateSet& rQU,
55  StateSet& rQY,
56  StateSet& rQErr);
57 
58 
59 /**
60  * Test whether the system satisfies the IO conditions.
61  *
62  * Performs the same tests as
63  * bool IsIoSystem(const IoSystem&,StateSet&,StateSet&,StateSet&), but
64  * does set the state attributes accordingly.
65  *
66  * @param rIoSystem
67  * Generator to test.
68  * @return
69  * True <> system is an io system.
70  *
71  * @ingroup IoSysPlugin
72  */
73 bool IsIoSystem(IoSystem& rIoSystem);
74 
75 
76 /**
77  * Construct io state partition.
78  *
79  * This is an rti wrapper for bool IsIoSystem(IoSystem&).
80  *
81  *
82  * @param rIoSystem
83  * Generator to test.
84  *
85  */
86 void IoStatePartition(IoSystem& rIoSystem);
87 
88 
89 /**
90  * Test whether the system has a locally free input.
91  *
92  * The procedure returns True, if every state that enables some
93  * input event enables all input events. If the system in addition
94  * satisfies the basic I/O properties, a locally free input implies
95  * that the behaviour induced by the generated closed language
96  * exhibits a free input in the behavioural sense. This implication
97  * does not hold for the behaviour induced by the marked language.
98  *
99  * If the test fails, any critical states are returned in rQErr.
100  *
101  * @param rIoSystem
102  * Generator to test.
103  * @param rQErr
104  * Error states.
105  * @return
106  * True <> system has an omega-free input
107  *
108  * @ingroup IoSysPlugin
109  */
110  bool IsInputLocallyFree(const IoSystem& rIoSystem, StateSet& rQErr);
111 
112 
113 /**
114  * Test whether the system has a locally free input.
115  *
116  * See also bool IsInputLocallyFree(const IoSystem&,StateSet&).
117  * This version will set the state error attribute to the set
118  * of critical states.
119  *
120  * @param rIoSystem
121  * Generator to test.
122  * @return
123  * True <> system has a locally-free input
124  *
125  * @ingroup IoSysPlugin
126  */
127  bool IsInputLocallyFree(IoSystem& rIoSystem);
128 
129 
130 /**
131  * Enable all input events for each input state.
132  *
133  * If this procedure detetecs a state with some but not all
134  * input events enabled, an error state is introduced
135  * and transitions with the missing input events are inserted.
136  * The error state is setup to allow any alternating sequence
137  * of input and output events.
138  *
139  * Note that his procedure only ensures a locally free input. It does
140  * not guarantee a free input in the behavioural sense.
141  *
142  * It is considered an error if the specified set of input events
143  * is not contained in the generator alphabet.
144  *
145  * @param rIoSystem
146  * Generator argument.
147  * @param rUAlph
148  * Input alphabet
149  *
150  * @exception Exception
151  * - Alphabets don't match (id 100)
152  *
153  * @ingroup IoSysPlugin
154  */
155  void IoFreeInput(Generator& rIoSystem, const EventSet& rUAlph);
156 
157 
158 /**
159  * Enable all input events for each input state.
160  *
161  * Alternative interface to IoFreeInput(Generator&, const EventSet&),
162  * which extracts the input alphabet from the given IO System.
163  *
164  * @param rIoSystem
165  * Generator argument.
166  * @ingroup IoSysPlugin
167  */
168 void IoFreeInput(IoSystem& rIoSystem);
169 
170 
171 /**
172  * Remove dummy states.
173  *
174  *
175  * @param rIoSystem
176  * Generator argument.
177  * @ingroup IoSysPlugin
178  */
179  void RemoveIoDummyStates(IoSystem& rIoSystem);
180 
181 
182 /**
183  * Test whether the system behaviour exhibits a free input.
184  *
185  * The procedure assumes that the specified system satisfies
186  * the basic I/O properties. It returns True, if it has a locally
187  * free input and additionally can allways control its output to
188  * reach a marked state. Technically, the latter condition can be stated
189  * as a controllability condition, referring to the notion of omega-controllabilaty
190  * in the definition of Thistle/Wonham.
191  *
192  * This implementation performs the test in that it iteratively constructs
193  * a set of "good" states: a state is good, if
194  *
195  * - it is marked, or
196  * - it can be controlled to a good state by disableing output events
197  *
198  * If all reachable states are good, the test is passed. Else, all other state
199  * are reported as error states.
200  *
201  * @param rIoSystem
202  * Generator to test.
203  * @param rQErr
204  * Error states.
205  * @return
206  * True <> system has an omega-free input
207  *
208  * @ingroup IoSysPlugin
209  */
210  bool IsInputOmegaFree(const IoSystem& rIoSystem, StateSet& rQErr);
211 
212 
213 /**
214  * Test whether the system behaviour has exhibits a free input.
215  *
216  * See also bool IsInputOmegaFree(const IoSystem&,StateSet&).
217  * This version will set the error flag for stytes that conflict with
218  * a free input.
219  *
220  * @param rIoSystem
221  * Generator to test.
222  * @return
223  * True <> system has an omega-free input
224  *
225  * @ingroup IoSysPlugin
226  */
227  bool IsInputOmegaFree(IoSystem& rIoSystem);
228 
229 
230 
231 /**
232  * IO system synthesis.
233  *
234  * This method esentially is a wrapper for SupConComplete(), which implements
235  * a synthesis procedure to compute the supremal controllable and complete
236  * sublanguage for a given plant and specification. Input events are regarded
237  * controllable. marking is ignored, i.e., synthesis refers to the generated
238  * langugaes rather than the the marked languages. For a version
239  * thet refers to Buchi acceptance condition, see
240  * IoSynthesisNB(const IoSystem&, const Generator&, IoSystem&).
241  *
242  * The resulting supervisor is an IO System with
243  * the plant input events as outputs and vice versa.
244  *
245  * Note that this routine does not test whether the plant has a locally
246  * free input U, nor does it ensure that the resulting supervisor has a
247  * free input Y.
248  *
249  * @param rPlant
250  * IO-System - plant model
251  * @param rSpec
252  * Generator - specification
253  * @param rSup
254  * IO-System - supervisor
255  *
256  * @exception Exception
257  * - Any exceptions passed on from SupConComplete
258  *
259  */
260  void IoSynthesis(const IoSystem& rPlant, const Generator& rSpec, IoSystem& rSup);
261 
262 /**
263  * IO system synthesis.
264  *
265  * This method esentially is a wrapper for SupConOmegaNB(), which implements
266  * a synthesis procedure to compute the supremal omega-controllable.
267  * sublanguage for a given plant and specification. Input events are regarded
268  * controllable. In contrast to IoSynthesis(const IoSystem&, const Generator&, IoSystem&),
269  * this procedure refers to the Bucji acceptance condition and ensures
270  * a omega-nonblocking closed-loop behaviour.
271  *
272  * The resulting supervisor is an IO System with
273  * the plant input events as outputs and vice versa.
274  *
275  * Note that this routine does not test whether the plant has a locally
276  * free input U, nor does it ensure that the resulting supervisor has a
277  * free input Y.
278  *
279  * @param rPlant
280  * IO-System - plant model
281  * @param rSpec
282  * Generator - specification
283  * @param rSup
284  * IO-System - supervisor
285  *
286  * @exception Exception
287  * - Any exceptions passed on from SupConOmegaNB
288  *
289  */
290  void IoSynthesisNB(const IoSystem& rPlant, const Generator& rSpec, IoSystem& rSup);
291 
292 }
293 #endif

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