syn_wsupcon.h
Go to the documentation of this file.
1 /** @file syn_wsupcon.h Supremal controllable sublanguage for infinite time behaviours */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2010 Thomas Moor
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
20 
21 
22 #ifndef FAUDES_WSUPCON_H
23 #define FAUDES_WSUPCON_H
24 
25 #include "corefaudes.h"
26 #include <stack>
27 
28 namespace faudes {
29 
30 
31 
32 
33 /**
34  * Test omega controllability
35  *
36  * Tests whether the candidate supervisor H is omega controllable w.r.t.
37  * the plant G. This implementation invokes IsControllable and IsRelativelyOmegaClosed.
38  * A future implementation may be more efficient.
39  *
40  * Parameter restrictions: both generators must be deterministic, omega-trim and
41  * have the same alphabet.
42  *
43  *
44  * @param rPlantGen
45  * Plant G
46  * @param rCAlph
47  * Controllable events
48  * @param rSupCandGen
49  * Supervisor candidate H
50  *
51  * @exception Exception
52  * - Alphabets of generators don't match (id 100)
53  * - Arguments are not omega trim (id 201, only if FAUDES_CHECKED is set)
54  * - Arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
55  *
56  * @return
57  * true / false
58  *
59  * @ingroup SynthesisPlugIn
60  */
62  const Generator& rPlantGen,
63  const EventSet& rCAlph,
64  const Generator& rSupCandGen);
65 
66 
67 /**
68  * Test omega-controllability.
69  *
70  * Tests whether the candidate supervisor h is omega controllable w.r.t.
71  * the plant g; this is a System wrapper for IsOmegaControllable.
72  *
73  * @param rPlantGen
74  * Plant g generator
75  * @param rSupCandGen
76  * Supervisor candidate h generator
77  *
78  * @exception Exception
79  * - Alphabets of generators don't match (id 100)
80  * - Arguments are not omega trim (id 201, only if FAUDES_CHECKED is set)
81  * - Arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
82  *
83  * @return
84  * true / false
85  *
86  * @ingroup SynthesisPlugIn
87  */
89  const System& rPlantGen,
90  const Generator& rSupCandGen);
91 
92 
93 /**
94  * Supremal controllable and complete sublanguage
95  *
96  * Given a plant and a specification, this function computes a realisation of
97  * the supremal controllable and complete sublange. This version consideres the
98  * generated languages (ignores the marking). In particular, this implies that
99  * the result is prefix closed. It is returned as generated language.
100  *
101  * Starting with a product composition of plant and specification, the implementation
102  * iteratively remove states that either contradict controllability or completeness.
103  * Removal of states is continued until no contradicting states are left.
104  * Thus, the result is indeed controllable and complete. The algorithm was
105  * proposed in
106  *
107  * R. Kumar, V. Garg, and S.I. Marcus. On supervisory control of
108  * sequential behaviors. IEEE Transactions on Automatic Control,
109  * Vol. 37: pp.1978-1985, 1992.
110  *
111  * The paper proves supremality of the result. Provided that the corresponding
112  * omega language of the specification is closed, the result of the above algorithm
113  * also realises the least restrictive closed loop behaviour of the corresponding
114  * omega language control problem.
115  *
116  * Parameter restrictions: both generators must be deterministic and
117  * have the same alphabet. The result will be accessible and deterministic.
118  *
119  *
120  * @param rPlantGen
121  * Plant G
122  * @param rCAlph
123  * Controllable events
124  * @param rSpecGen
125  * Specification Generator E
126  * @param rResGen
127  * Reference to resulting Generator
128  *
129  * @exception Exception
130  * - alphabets of generators don't match (id 100)
131  * - plant nondeterministic (id 201)
132  * - spec nondeterministic (id 203)
133  * - plant and spec nondeterministic (id 204)
134  *
135  * @ingroup SynthesisPlugIn
136  *
137  */
138 extern FAUDES_API void SupConCmplClosed(
139  const Generator& rPlantGen,
140  const EventSet& rCAlph,
141  const Generator& rSpecGen,
142  Generator& rResGen);
143 
144 
145 
146 /**
147  * Supremal controllable and complete sublanguage.
148  *
149  * This is the RTI wrapper for
150  * SupConCmplClosed(const Generator&, const EventSet&, const Generator&, Generator&).
151  * Controllability attributes are taken from the plant argument.
152  * If the result is specified as a System, attributes will be copied
153  * from the plant argument.
154  *
155  *
156  * @param rPlantGen
157  * Plant System
158  * @param rSpecGen
159  * Specification Generator
160  * @param rResGen
161  * Reference to resulting Generator
162  *
163  * @exception Exception
164  * Alphabets of generators don't match (id 100)
165  * plant nondeterministic (id 201)
166  * spec nondeterministic (id 203)
167  * plant and spec nondeterministic (id 204)
168  *
169  * @ingroup SynthesisPlugIn
170  */
171 extern FAUDES_API void SupConCmplClosed(
172  const System& rPlantGen,
173  const Generator& rSpecGen,
174  Generator& rResGen);
175 
176 
177 /**
178  * Supremal controllable and complete sublanguage
179  *
180  *
181  * Given a plant and a specification, this function computes a realisation of
182  * the supremal controllable and complete sublange. This version consideres the
183  * marked languages.
184  *
185  * Starting with a product composition of plant and specification, the implementation
186  * iteratively remove states that contradict controllability or completeness or that
187  * are not coaccessible. Removal of states is continued until no contradicting states are left.
188  * Thus, the result is indeed controllable, complete and coaccessible.
189  *
190  * Considering the marked languages implies that only strings that simultanuosly
191  * reach a marking can survive the above procedure. From an omega-languages perspective,
192  * this is of limited use. However, in the special situation that the specification
193  * is relatively closed w.r.t. the plant, we can replace the specification by its
194  * prefix closure befor invoking SupConComplNB. In this situation we claim that
195  * the procedure returns a realisation of the the least restrictive closed loop behaviour
196  * of the corresponding omega language control problem.
197  *
198  *
199  * @param rPlantGen
200  * Plant G
201  * @param rCAlph
202  * Controllable events
203  * @param rSpecGen
204  * Specification Generator E
205  * @param rResGen
206  * Reference to resulting Generator
207  *
208  * @exception Exception
209  * - alphabets of generators don't match (id 100)
210  * - plant nondeterministic (id 201)
211  * - spec nondeterministic (id 203)
212  * - plant and spec nondeterministic (id 204)
213  *
214  * @ingroup SynthesisPlugIn
215  *
216  */
217 extern FAUDES_API void SupConCmplNB(
218  const Generator& rPlantGen,
219  const EventSet& rCAlph,
220  const Generator& rSpecGen,
221  Generator& rResGen);
222 
223 
224 
225 /**
226  * Supremal controllable and complete sublanguage.
227  *
228  * This is the RTI wrapper for
229  * SupConCmplNB(const Generator&, const EventSet&, const Generator&, Generator&).
230  * Controllability attributes are taken from the plant argument.
231  * If the result is specified as a System, attributes will be copied
232  * from the plant argument.
233  *
234  *
235  * @param rPlantGen
236  * Plant System
237  * @param rSpecGen
238  * Specification Generator
239  * @param rResGen
240  * Reference to resulting Generator
241  *
242  * @exception Exception
243  * Alphabets of generators don't match (id 100)
244  * plant nondeterministic (id 201)
245  * spec nondeterministic (id 203)
246  * plant and spec nondeterministic (id 204)
247  *
248  * @ingroup SynthesisPlugIn
249  */
250 extern FAUDES_API void SupConCmplNB(
251  const System& rPlantGen,
252  const Generator& rSpecGen,
253  Generator& rResGen);
254 
255 
256 /**
257  * Supremal controllable, normal and complete sublanguage.
258  *
259  *
260  * SupConNormCmplNB computes the supremal sublanguage
261  * of language K (marked by rSpecGen) that
262  * - is controllable w.r.t. the language L (marked by rPlantGen);
263  * - has a prefix closure that is normal w.r.t. the closure of L
264  * - is complete
265  *
266  * The implementation is based on an iteration by Yoo, Lafortune and Lin
267  * "A uniform approach for computing supremal sublanguages arising
268  * in supervisory control theory", 2002, further developped in
269  * Moor, Baier, Yoo, Lin, and Lafortune "On the computation of supremal
270  * sublanguages relevant to supervisory control, WODES 2012. The relationship
271  * to the supervision of omega languages under partial observation is discussed
272  * as an example in the WODES 2012 paper.
273  *
274  * Parameters have to be deterministic, result is deterministic.
275  *
276  *
277  * @param rPlantGen
278  * Plant L
279  * @param rCAlph
280  * Controllable events
281  * @param rOAlph
282  * Observable events
283  * @param rSpecGen
284  * Specification Generator E
285  * @param rResGen
286  * Reference to resulting Generator
287  *
288  * @exception Exception
289  * - alphabets of generators don't match (id 100)
290  * - plant nondeterministic (id 201)
291  * - spec nondeterministic (id 203)
292  * - plant and spec nondeterministic (id 204)
293  *
294  * @ingroup SynthesisPlugIn
295  *
296  */
297 extern FAUDES_API void SupConNormCmplNB(
298  const Generator& rPlantGen,
299  const EventSet& rCAlph,
300  const EventSet& rOAlph,
301  const Generator& rSpecGen,
302  Generator& rResGen);
303 
304 
305 /**
306  * Supremal controllable, normal and complete sublanguage.
307  *
308  * This is the RTI wrapper for
309  * SupConNormCmplNB(const Generator&, const EventSet&, const EventSet&, const Generator&, Generator&).
310  * Event attributes are taken from the plant argument.
311  * If the result is specified as a System, attributes will be copied
312  * from the plant argument.
313  *
314  * @param rPlantGen
315  * Plant System
316  * @param rSpecGen
317  * Specification Generator
318  * @param rResGen
319  * Reference to resulting Generator
320  *
321  * @exception Exception
322  * Alphabets of generators don't match (id 100)
323  * plant nondeterministic (id 201)
324  * spec nondeterministic (id 203)
325  * plant and spec nondeterministic (id 204)
326  *
327  * @ingroup SynthesisPlugIn
328  */
329 extern FAUDES_API void SupConNormCmplNB(
330  const System& rPlantGen,
331  const Generator& rSpecGen,
332  Generator& rResGen);
333 
334 
335 
336 
337 /**
338  * Omega-synthesis
339  *
340  * Computation of the supremal oemga-controllable sublanguage as proposed by
341  * Thistle/Wonham in "Control of w-Automata, Church's Problem, and the Emptiness
342  * Problem for Tree w-Automata", 1992, and, here, applied to the specific case
343  * of deterministic Buechi automata. In the given setting, the result matches the
344  * limit of the controllable prefix intersected with the plant and specification
345  * omega-languages.
346  *
347  * Parameter restrictions: both generators must be deterministic and
348  * refer to the same alphabet.
349  *
350  *
351  * @param rPlantGen
352  * Plant G
353  * @param rCAlph
354  * Controllable events
355  * @param rSpecGen
356  * Specification Generator E
357  * @param rResGen
358  * Reference to resulting Generator to realize
359  * the supremal closed-loop behaviour.
360  *
361  * @exception Exception
362  * - alphabets of generators don't match (id 100)
363  * - plant nondeterministic (id 201)
364  * - spec nondeterministic (id 203)
365  * - plant and spec nondeterministic (id 204)
366  *
367  * @ingroup SynthesisPlugIn
368  *
369  */
370 extern FAUDES_API void OmegaSupConNB(
371  const Generator& rPlantGen,
372  const EventSet& rCAlph,
373  const Generator& rSpecGen,
374  Generator& rResGen);
375 
376 
377 
378 /**
379  * Omega-synthesis
380  *
381  * This is the RTI wrapper for
382  * OmegaSupConNB(const Generator&, const EventSet&, const Generator&, Generator&).
383  * Controllability attributes are taken from the plant argument.
384  * If the result is specified as a System, attributes will be copied
385  * from the plant argument.
386  *
387  *
388  * @param rPlantGen
389  * Plant System
390  * @param rSpecGen
391  * Specification Generator
392  * @param rResGen
393  * Reference to resulting Generator to realize
394  * the supremal closed-loop behaviour.
395  *
396  * @exception Exception
397  * Alphabets of generators don't match (id 100)
398  * plant nondeterministic (id 201)
399  * spec nondeterministic (id 203)
400  * plant and spec nondeterministic (id 204)
401  *
402  * @ingroup SynthesisPlugIn
403  */
404 extern FAUDES_API void OmegaSupConNB(
405  const System& rPlantGen,
406  const Generator& rSpecGen,
407  Generator& rResGen);
408 
409 
410 /**
411  * Omega-synthesis
412  *
413  * This procedure first computes the supremal omega-controllable sublanguage as proposed by
414  * J. Thistle, 1992, applied to the specific case of deterministoc Buechi automata.
415  * It then applies a control pattern to obtain a relatively topologically-closed result,
416  * i.e., the topological closure of the result can be used as a supervisor.
417  *
418  * Parameter restrictions: both generators must be deterministic and
419  * have the same alphabet.
420  *
421  *
422  * @param rPlantGen
423  * Plant G
424  * @param rCAlph
425  * Controllable events
426  * @param rSpecGen
427  * Specification Generator E
428  * @param rResGen
429  * Reference to resulting Generator to realize
430  * the closed-loop behaviour.
431  *
432  * @exception Exception
433  * - alphabets of generators don't match (id 100)
434  * - plant nondeterministic (id 201)
435  * - spec nondeterministic (id 203)
436  * - plant and spec nondeterministic (id 204)
437  *
438  * @ingroup SynthesisPlugIn
439  *
440  */
441 extern FAUDES_API void OmegaConNB(
442  const Generator& rPlantGen,
443  const EventSet& rCAlph,
444  const Generator& rSpecGen,
445  Generator& rResGen);
446 
447 
448 
449 /**
450  * Omega-synthesis
451  *
452  * This is the RTI wrapper for
453  * OmegaConNB(const Generator&, const EventSet&, const Generator&, Generator&).
454  * Controllability attributes are taken from the plant argument.
455  * If the result is specified as a System, attributes will be copied
456  * from the plant argument.
457  *
458  *
459  * @param rPlantGen
460  * Plant System
461  * @param rSpecGen
462  * Specification Generator
463  * @param rResGen
464  * Reference to resulting Generator to realize
465  * the closed-loop behaviour.
466  *
467  * @exception Exception
468  * Alphabets of generators don't match (id 100)
469  * plant nondeterministic (id 201)
470  * spec nondeterministic (id 203)
471  * plant and spec nondeterministic (id 204)
472  *
473  * @ingroup SynthesisPlugIn
474  */
475 extern FAUDES_API void OmegaConNB(
476  const System& rPlantGen,
477  const Generator& rSpecGen,
478  Generator& rResGen);
479 
480 
481 /**
482  * Omega-synthesis for partial observation (experimental!)
483  *
484  * Variation of supremal omega-controllable sublanguage to address
485  * normality requirements in the context of partial observation. The test
486  * used in this implementation is sufficient but not known to be necessary.
487  * Thus, the function may return only a subset of the relevant controllable
488  * prefix.
489  *
490  * Parameter restrictions: both generators must be deterministic and
491  * have the same alphabet.
492  *
493  *
494  * @param rPlantGen
495  * Plant G
496  * @param rCAlph
497  * Controllable events
498  * @param rOAlph
499  * Observable events
500  * @param rSpecGen
501  * Specification Generator E
502  * @param rResGen
503  * Reference to resulting Generator to realize
504  * the supremal closed-loop behaviour.
505  *
506  * @exception Exception
507  * - alphabets of generators don't match (id 100)
508  * - plant nondeterministic (id 201)
509  * - spec nondeterministic (id 203)
510  * - plant and spec nondeterministic (id 204)
511  *
512  * @ingroup SynthesisPlugIn
513  *
514  */
515 extern FAUDES_API void OmegaSupConNormNB(
516  const Generator& rPlantGen,
517  const EventSet& rCAlph,
518  const EventSet& rOAlph,
519  const Generator& rSpecGen,
520  Generator& rResGen);
521 
522 
523 
524 /**
525  * Omega-synthesis for partial observation
526  *
527  *
528  * This is the RTI wrapper for
529  * OmegaSupConNormNB(const Generator&, const EventSet&, const Generator&, Generator&).
530  * Controllability attributes and observability attributes are taken from the plant argument.
531  * If the result is specified as a System, attributes will be copied
532  * from the plant argument.
533  *
534  *
535  * @param rPlantGen
536  * Plant System
537  * @param rSpecGen
538  * Specification Generator
539  * @param rResGen
540  * Reference to resulting Generator to realize
541  * the supremal closed-loop behaviour.
542  *
543  * @exception Exception
544  * Alphabets of generators don't match (id 100)
545  * plant nondeterministic (id 201)
546  * spec nondeterministic (id 203)
547  * plant and spec nondeterministic (id 204)
548  *
549  * @ingroup SynthesisPlugIn
550  */
551 extern FAUDES_API void OmegaSupConNormNB(
552  const System& rPlantGen,
553  const Generator& rSpecGen,
554  Generator& rResGen);
555 
556 
557 
558 /**
559  * Omega-synthesis for partial observation (experimental!)
560  *
561  * Variation of supremal controllable prefix under partial observation.
562  * This variation applies a control pattern to obtain a relatively closed and
563  * omega-normal result. The latter properties are validated and an exception
564  * is thrown on an error. Thus, this function should not produce "false-positives".
565  * However, since it is derived from OmegaSupConNormNB(), is may return the
566  * empty languages even if a non-empty controller exists.
567  *
568  * Parameter restrictions: both generators must be deterministic and
569  * have the same alphabet.
570  *
571  *
572  * @param rPlantGen
573  * Plant G
574  * @param rCAlph
575  * Controllable events
576  * @param rOAlph
577  * Observable events
578  * @param rSpecGen
579  * Specification Generator E
580  * @param rResGen
581  * Reference to resulting Generator to realize
582  * the supremal closed-loop behaviour.
583  *
584  * @exception Exception
585  * - alphabets of generators don't match (id 100)
586  * - plant nondeterministic (id 201)
587  * - spec nondeterministic (id 203)
588  * - plant and spec nondeterministic (id 204)
589  *
590  * @ingroup SynthesisPlugIn
591  *
592  */
593 extern FAUDES_API void OmegaConNormNB(
594  const Generator& rPlantGen,
595  const EventSet& rOAlph,
596  const EventSet& rCAlph,
597  const Generator& rSpecGen,
598  Generator& rResGen);
599 
600 
601 
602 /**
603  * Omega-synthesis for partial observation (experimental!)
604  *
605  * This is the RTI wrapper for
606  * OmegaConNormNB(const Generator&, const EventSet&, const Generator&, Generator&).
607  * Controllability attributes are taken from the plant argument.
608  * If the result is specified as a System, attributes will be copied
609  * from the plant argument.
610  *
611  *
612  * @param rPlantGen
613  * Plant System
614  * @param rSpecGen
615  * Specification Generator
616  * @param rResGen
617  * Reference to resulting Generator to realize
618  * the closed-loop behaviour.
619  *
620  * @exception Exception
621  * Alphabets of generators don't match (id 100)
622  * plant nondeterministic (id 201)
623  * spec nondeterministic (id 203)
624  * plant and spec nondeterministic (id 204)
625  *
626  * @ingroup SynthesisPlugIn
627  */
628 extern FAUDES_API void OmegaConNormNB(
629  const System& rPlantGen,
630  const Generator& rSpecGen,
631  Generator& rResGen);
632 
633 
634 
635 
636 } // namespace faudes
637 
638 #endif
639 
640 
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:80
Includes all libFAUDES headers, no plugins.
NameSet EventSet
Convenience typedef for plain event sets.
Definition: cfl_nameset.h:533
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > System
Convenience typedef for std System.
void OmegaConNormNB(const Generator &rPlantGen, const EventSet &rCAlph, const EventSet &rOAlph, const Generator &rSpecGen, Generator &rResGen)
Omega-synthesis for partial observation (experimental!)
void OmegaSupConNormNB(const Generator &rPlantGen, const EventSet &rCAlph, const EventSet &rOAlph, const Generator &rSpecGen, Generator &rResGen)
Omega-synthesis for partial observation (experimental!)
bool IsOmegaControllable(const Generator &rGenPlant, const EventSet &rCAlph, const Generator &rGenCand)
Test omega controllability.
Definition: syn_wsupcon.cpp:42
void SupConCmplClosed(const Generator &rPlantGen, const EventSet &rCAlph, const Generator &rSpecGen, Generator &rResGen)
Supremal controllable and complete sublanguage.
void OmegaSupConNB(const Generator &rPlantGen, const EventSet &rCAlph, const Generator &rSpecGen, Generator &rResGen)
Omega-synthesis.
void SupConCmplNB(const Generator &rPlantGen, const EventSet &rCAlph, const Generator &rSpecGen, Generator &rResGen)
Supremal controllable and complete sublanguage.
void SupConNormCmplNB(const Generator &rL, const EventSet &rCAlph, const EventSet &rOAlph, const Generator &rK, Generator &rResult)
Supremal controllable, normal and complete sublanguage.
void OmegaConNB(const Generator &rPlantGen, const EventSet &rCAlph, const Generator &rSpecGen, Generator &rResGen)
Omega-synthesis.
libFAUDES resides within the namespace faudes.

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen