syn_functions.h
Go to the documentation of this file.
1 /** @file syn_functions.h Misc functions related to synthesis */
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_SYN_FUNCTIONS_H
23 #define FAUDES_SYN_FUNCTIONS_H
24 
25 #include "corefaudes.h"
26 
27 namespace faudes {
28 
29 
30 
31 /**
32  * Test for relative marking.
33  *
34  * Tests whether the language Lm(GCand) is relatively marked w.r.t.
35  * the language Lm(GPlant). The formal definition of this property
36  * requires
37  *
38  * closure(Lm(GCand)) ^ Lm(GPlant) <= Lm(GCand).
39  *
40  * The implementation tests
41  *
42  * L(GCand) ^ Lm(GPlant) <= Lm(GCand)
43  *
44  * by first performing the product composition and then inspecting
45  * the marking to require
46  *
47  * ( forall accessible (qPlant,qCand) ) [ qPlant in QPlant_m implies qCand in QCand_m ].
48  *
49  * In general, the test is only sufficient.
50  * Provided the arguments are trim and deterministic, the test
51  * is sufficient and necessary.
52  *
53  * @param rGenPlant
54  * Generator GPlant
55  * @param rGenCand
56  * Generator GCand
57  *
58  *
59  * @exception Exception
60  * - alphabets of generators don't match (id 100)
61  * - arguments are not trim (id 201, only if FAUDES_CHECKED is set)
62  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
63  *
64  * @return
65  * true / false
66  *
67  * @ingroup SynthesisPlugIn
68  */
69 extern FAUDES_API bool IsRelativelyMarked(const Generator& rGenPlant, const Generator& rGenCand);
70 
71 
72 /**
73  * Test for relative prefix-closedness.
74  *
75  * Tests whether the language Lm(GCand) is relatively closed w.r.t.
76  * the language Lm(GPant). The formal definition of this property
77  * requires
78  *
79  * closure(Lm(GCand)) ^ Lm(GPlant) = Lm(GCand).
80  *
81  * The implementation tests
82  *
83  * L(GCand) ^ Lm(GPland) = Lm(GCand)
84  *
85  * by performing the product composition and by testing
86  *
87  * - for L(GCand) subseteq L(GPlant), and
88  * - ( forall accessible (qPland,qCand) ) [ qPlant in QPlant_m if and only if qCand in QCand_m ].
89  *
90  * In general, the test is only sufficient.
91  * Provided the arguments are trim and deterministic, the test
92  * is sufficient and necessary.
93  *
94  * @param rGenPlant
95  * Generator GPlant
96  * @param rGenCand
97  * Generator GCand
98  *
99  * @exception Exception
100  * - alphabets of generators don't match (id 100)
101  * - arguments are not trim (id 201, only if FAUDES_CHECKED is set)
102  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
103  *
104  * @return
105  * true / false
106  *
107  * @ingroup SynthesisPlugIn
108  */
109 extern FAUDES_API bool IsRelativelyPrefixClosed(const Generator& rGenPlant, const Generator& rGenCand);
110 
111 /**
112  * Supremal Relatively Closed Sublanguage
113  *
114  * Computes the supremal sublanguage of the specification E that is relatively closed
115  * w.r.t. the plant G. The result is given as a trim deterministic generator that
116  * may be used as a specification for a subsequent controller design via SupConNB.
117  *
118  * The implementation removes states from the product GxE that conflict with
119  * relative closedness. From the known formula supR(E)= (L^E) - (L-E)Sigma*, we know that
120  * the supremal sublanguage can be realized as a subautomaton of GxE. Thus, we conclude
121  * that our implementation indeed returns the supremum.
122  *
123  * Parameter restrictions: both generators must be deterministic and
124  * have the same alphabet.
125  *
126  *
127  * @param rPlantGen
128  * Plant G
129  * @param rSpecGen
130  * Specification Generator E
131  * @param rResGen
132  * Reference to resulting Generator
133  *
134  * @exception Exception
135  * - alphabets of generators don't match (id 100)
136  * - plant nondeterministic (id 201)
137  * - spec nondeterministic (id 203)
138  * - plant and spec nondeterministic (id 204)
139  *
140  * @ingroup SynthesisPlugIn
141  *
142  */
144  const Generator& rPlantGen,
145  const Generator& rSpecGen,
146  Generator& rResGen);
147 
148 
149 /**
150  * Supremal Relatively Closed Sublanguage (internal function)
151  *
152  *
153  * This version of SupRelativelyPrefixClosed performs no consistency test of the given parameter.
154  * It set's up a "composition map" as in the parallel composition, however,
155  * the map may still contain states that have been removed from the result
156  * to obtain controllability.
157  *
158  * Parameter restrictions: both generators must be deterministic and
159  * have the same alphabet.
160  *
161  *
162  * @param rPlantGen
163  * Plant G
164  * @param rSpecGen
165  * Specification Generator E
166  * @param rResGen
167  * Reference to resulting Generator,
168  *
169  */
171  const Generator& rPlantGen,
172  const Generator& rSpecGen,
173  std::map< std::pair<Idx,Idx>,Idx >& rCompositionMap,
174  Generator& rResGen);
175 
176 
177 /**
178  * Test for relative marking, omega langauges.
179  *
180  * Tests whether the omega language Bm(GCand)
181  * is relatively marked w.r.t.
182  * the omega language Bm(GPlant). The formal definition of this property
183  * requires
184  *
185  * closure(Bm(GCand)) ^ Bm(GPlant) <= Bm(GCand).
186  *
187  * The implementation first performs the product composition
188  * of the two generators with product state space QPlant x QCand and
189  * generated language L(GPlant x GCand) = L(Plant) ^ L(Cand). It then investigates
190  * all SCCs that do not
191  * contain a state that corresponds to GCand-marking. If and only if
192  * none of the considered SCCs has a GPlant marking, the function
193  * returns true.
194  *
195  * The arguments GCand and GPlant are required to be deterministic and omega trim.
196  *
197  * @param rGenPlant
198  * Generator GPlant
199  * @param rGenCand
200  * Generator GCand
201  *
202  * @exception Exception
203  * - alphabets of generators don't match (id 100)
204  * - arguments are not omega-trim (id 201, only if FAUDES_CHECKED is set)
205  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
206  *
207  *
208  * @return
209  * true / false
210  *
211  * @ingroup SynthesisPlugIn
212  */
213 extern FAUDES_API bool IsRelativelyOmegaMarked(const Generator& rGenPlant, const Generator& rGenCand);
214 
215 /**
216  * Test for relative closedness, omega languages.
217  *
218  * Tests whether the omega language Bm(GCand)
219  * is relatively closed w.r.t.
220  * the omega language Bm(GPlant). The formal definition of this property
221  * requires
222  *
223  * closure(Bm(GCand)) ^ Bm(GPlant) = Bm(GCand).
224  *
225  *
226  * The implementation first performs the product composition
227  * of the two generators with product state space QPlant x QCand and
228  * generated language L(GPlant x GCand) = L(GPlant) ^ L(GCand). It uses the composition
229  * to test the follwing three conditions:
230  * - L(GCand) subseteq L(GPlant);
231  * - no SCC of GPlant x GCand without GCand-marking contains a state with GPlant-marking; and
232  * - no SCC of GPlant x GCand without GPlant-marking contains a state with GCand-marking.
233  * If and only if all three tests are passed, the function
234  * returns true.
235  *
236  * The arguments GCand and GPlant are required to be deterministic and omega trim.
237  *
238  * @param rGenPlant
239  * Generator GPlant
240  * @param rGenCand
241  * Generator GCand
242  *
243  *
244  * @exception Exception
245  * - alphabets of generators don't match (id 100)
246  * - arguments are not omega trim (id 201, only if FAUDES_CHECKED is set)
247  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
248  *
249  *
250  * @return
251  * true / false
252  *
253  * @ingroup SynthesisPlugIn
254  */
255 extern FAUDES_API bool IsRelativelyOmegaClosed(const Generator& rGenPlant, const Generator& rGenCand);
256 
257 /**
258  * Test for relative closedness, omega languages.
259  *
260  * This variant does not perform consitency tests on the parameters. Neither
261  * does it handle the special cases on empty arguments.
262  * See also IsRelativelyOmegaClosed(const Generator&, const Generator& )
263  *
264  * @param rGenPlant
265  * Generator GPlant
266  * @param rGenCand
267  * Generator GCand
268  *
269  */
270 extern FAUDES_API bool IsRelativelyOmegaClosedUnchecked(const Generator& rGenPlant, const Generator& rGenCand);
271 
272 
273 
274 
275 
276 } // namespace faudes
277 
278 #endif
279 
280 

libFAUDES 2.28c --- 2016.09.30 --- c++ api documentaion by doxygen