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 rCompositionMap
167  * Record parallel composition state mapping
168  * @param rResGen
169  * Reference to resulting Generator,
170  *
171  */
173  const Generator& rPlantGen,
174  const Generator& rSpecGen,
175  std::map< std::pair<Idx,Idx>,Idx >& rCompositionMap,
176  Generator& rResGen);
177 
178 
179 /**
180  * Test for relative marking, omega langauges.
181  *
182  * Tests whether the omega language Bm(GCand)
183  * is relatively marked w.r.t.
184  * the omega language Bm(GPlant). The formal definition of this property
185  * requires
186  *
187  * closure(Bm(GCand)) ^ Bm(GPlant) <= Bm(GCand).
188  *
189  * The implementation first performs the product composition
190  * of the two generators with product state space QPlant x QCand and
191  * generated language L(GPlant x GCand) = L(Plant) ^ L(Cand). It then investigates
192  * all SCCs that do not
193  * contain a state that corresponds to GCand-marking. If and only if
194  * none of the considered SCCs has a GPlant marking, the function
195  * returns true.
196  *
197  * The arguments GCand and GPlant are required to be deterministic and omega trim.
198  *
199  * @param rGenPlant
200  * Generator GPlant
201  * @param rGenCand
202  * Generator GCand
203  *
204  * @exception Exception
205  * - alphabets of generators don't match (id 100)
206  * - arguments are not omega-trim (id 201, only if FAUDES_CHECKED is set)
207  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
208  *
209  *
210  * @return
211  * true / false
212  *
213  * @ingroup SynthesisPlugIn
214  */
215 extern FAUDES_API bool IsRelativelyOmegaMarked(const Generator& rGenPlant, const Generator& rGenCand);
216 
217 /**
218  * Test for relative closedness, omega languages.
219  *
220  * Tests whether the omega language Bm(GCand)
221  * is relatively closed w.r.t.
222  * the omega language Bm(GPlant). The formal definition of this property
223  * requires
224  *
225  * closure(Bm(GCand)) ^ Bm(GPlant) = Bm(GCand).
226  *
227  *
228  * The implementation first performs the product composition
229  * of the two generators with product state space QPlant x QCand and
230  * generated language L(GPlant x GCand) = L(GPlant) ^ L(GCand). It uses the composition
231  * to test the follwing three conditions:
232  * - L(GCand) subseteq L(GPlant);
233  * - no SCC of GPlant x GCand without GCand-marking contains a state with GPlant-marking; and
234  * - no SCC of GPlant x GCand without GPlant-marking contains a state with GCand-marking.
235  * If and only if all three tests are passed, the function
236  * returns true.
237  *
238  * The arguments GCand and GPlant are required to be deterministic and omega trim.
239  *
240  * @param rGenPlant
241  * Generator GPlant
242  * @param rGenCand
243  * Generator GCand
244  *
245  *
246  * @exception Exception
247  * - alphabets of generators don't match (id 100)
248  * - arguments are not omega trim (id 201, only if FAUDES_CHECKED is set)
249  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
250  *
251  *
252  * @return
253  * true / false
254  *
255  * @ingroup SynthesisPlugIn
256  */
257 extern FAUDES_API bool IsRelativelyOmegaClosed(const Generator& rGenPlant, const Generator& rGenCand);
258 
259 /**
260  * Test for relative closedness, omega languages.
261  *
262  * This variant does not perform consitency tests on the parameters. Neither
263  * does it handle the special cases on empty arguments.
264  * See also IsRelativelyOmegaClosed(const Generator&, const Generator& )
265  *
266  * @param rGenPlant
267  * Generator GPlant
268  * @param rGenCand
269  * Generator GCand
270  *
271  */
272 extern FAUDES_API bool IsRelativelyOmegaClosedUnchecked(const Generator& rGenPlant, const Generator& rGenCand);
273 
274 
275 
276 
277 
278 } // namespace faudes
279 
280 #endif
281 
282 
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:80
Includes all libFAUDES headers, no plugins.
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
bool IsRelativelyMarked(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative marking.
bool IsRelativelyOmegaMarked(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative marking, omega langauges.
bool IsRelativelyPrefixClosed(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative prefix-closedness.
bool IsRelativelyOmegaClosed(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative closedness, omega languages.
void SupRelativelyPrefixClosed(const Generator &rPlantGen, const Generator &rSpecGen, Generator &rResGen)
Supremal Relatively Closed Sublanguage.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
void SupRelativelyPrefixClosedUnchecked(const Generator &rPlantGen, const Generator &rSpecGen, std::map< std::pair< Idx, Idx >, Idx > &rCompositionMap, Generator &rResGen)
Supremal Relatively Closed Sublanguage (internal function)
bool IsRelativelyOmegaClosedUnchecked(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative closedness, omega languages.

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