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

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