cfl_project.h
Go to the documentation of this file.
1 /** @file cfl_project.h language projection */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2006 Bernd Opitz
6  Exclusive copyright is granted to Klaus Schmidt
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
21 
22 
23 #ifndef FAUDES_PROJECT_H
24 #define FAUDES_PROJECT_H
25 
26 #include "cfl_definitions.h"
27 #include "cfl_agenerator.h"
28 
29 namespace faudes {
30 
31 
32 /**
33  * Language projection.
34  *
35  * Projects the generated and marked languages to another alphabet.
36  * Transitions with events not in the projection alphabet are considered
37  * invisible and therefor acordingly relinked with a visible lable to the appropriate
38  * successor state. The projection alphabet is intended (but not required) to be
39  * a subset of the original alphabet.
40  *
41  * The default implementation is based on a local forward reachability analysis per state.
42  * It known to suffer from performance issues for certain large automata. This was
43  * in particular the case for the variation used in libFAUDES 2.14 up to 2.23. A number of
44  * alternatives are now available in "cfl_project.cpp" and can bet set as the default by adjusting
45  * the respective wrapper function (grep for "wrapper" in "cfl_project.cpp"). If you experience
46  * trouble with the current revision, you can set the default to revert to pre libFAUDES 2.24 behaviour --
47  * and please report back to us. The candidate for future releases is available for testing,
48  * see ProjectNonDetScc(Generator&, const EventSet&).
49  *
50  * The results in general is nondeterministic. The input generator does not need to
51  * be deterministic. See Project(const Generator&,const EventSet&, Generator&) for
52  * a version with deterministic result.
53  *
54  *
55  * @param rGen
56  * Reference to generator
57  * @param rProjectAlphabet
58  * Projection alphabet
59  *
60  * @ingroup GeneratorFunctions
61  */
62 extern FAUDES_API void ProjectNonDet(Generator& rGen, const EventSet& rProjectAlphabet);
63 
64 
65 
66 /**
67  * Language projection.
68  *
69  * Projects the generated and marked languages to another alphabet, see
70  * also ProjectNonDetScc(Generator&, const EventSet&). This implementation
71  * first eliminates silent strongly connected components and then applies a
72  * local backward reachability analysis. Performance benefits are significant for
73  * certain large generators.
74  *
75  * The input generator does not need to be deterministic. The results in general
76  * is nondeterministic. You may manually invoke Deterministic() to convert the result.
77  *
78  *
79  * @param rGen
80  * Reference to generator
81  * @param rProjectAlphabet
82  * Projection alphabet
83  *
84  * @ingroup GeneratorFunctions
85  */
86 extern FAUDES_API void ProjectNonDetScc(Generator& rGen, const EventSet& rProjectAlphabet);
87 
88 /**
89  * Deterministic projection.
90  *
91  * Projects the generated and marked languages to a subalphabet of the original alphabet,
92  * and subsequently calls Deterministic to construct a deterministic
93  * realisation of the result. The input generator does not need to be deterministic.
94  *
95  * @param rGen
96  * Reference to generator
97  * @param rProjectAlphabet
98  * Projection alphabet
99  * @param rResGen
100  * Reference to resulting deterministic generator
101  *
102  * <h4>Example:</h4>
103  * <table>
104  * <tr> <td> Generator G </td> <td> Project(G,(a,c,g,e),Result) </td> </tr>
105  * <tr>
106  * <td> @image html tmp_project_g.png </td>
107  * <td> @image html tmp_project_prog.png </td>
108  * </tr>
109  * </table>
110  *
111  * @ingroup GeneratorFunctions
112  */
113 extern FAUDES_API void Project(const Generator& rGen, const EventSet& rProjectAlphabet, Generator& rResGen);
114 
115 /**
116  * Deterministic projection.
117  *
118  * See also Project(const Generator&, const EventSet&, Generator&).
119  * This version tries to be transparent on event attributes: if
120  * argument attributes match and if the result can take the respective
121  * attributes, then they are copied; it is considered an error if
122  * argument attributes do not match.
123  *
124  * @param rGen
125  * Reference to generator
126  * @param rProjectAlphabet
127  * Projection alphabet
128  * @param rResGen
129  * Reference to resulting deterministic generator
130  *
131  *
132  * @ingroup GeneratorFunctions
133  */
134 extern FAUDES_API void aProject(const Generator& rGen, const EventSet& rProjectAlphabet, Generator& rResGen);
135 
136 /**
137  * Language projection.
138  *
139  * See also ProjectNonDet(const Generator&, const EventSet&).
140  * This version tries to be transparent on event attributes: result maintains
141  * its attributes.
142  *
143  * @param rGen
144  * Reference to generator
145  * @param rProjectAlphabet
146  * Projection alphabet
147  *
148  * @ingroup GeneratorFunctions
149  */
150 extern FAUDES_API void aProjectNonDet(Generator& rGen, const EventSet& rProjectAlphabet);
151 
152 
153 /**
154  * Deterministic projection.
155  *
156  * Projects the generated and marked languages to a subalphabet of the original alphabet,
157  * and subsequently calls Deterministic to construct a deterministic minimal
158  * realisation of the result. The input generator does not need to be deterministic.
159  *
160  * @param rGen
161  * Reference to generator
162  * @param rProjectAlphabet
163  * Projection alphabet
164  * @param rEntryStatesMap
165  * Reference to entry states map, see Deterministic(..) (result)
166  * @param rResGen
167  * Reference to resulting deterministic generator (result)
168  */
169 extern FAUDES_API void Project(const Generator& rGen, const EventSet& rProjectAlphabet,
170  std::map<Idx,StateSet>& rEntryStatesMap, Generator& rResGen);
171 
172 /**
173  * Inverse projection. This adds selfloop transition at every state for
174  * all missing events.
175  *
176  * @param rGen
177  * Reference to generator
178  * @param rProjectAlphabet
179  * Alphabet for inverse projection
180  *
181  * @ingroup GeneratorFunctions
182  */
183 extern FAUDES_API void InvProject(Generator& rGen, const EventSet& rProjectAlphabet);
184 
185 /**
186  * Inverse projection. This adds selfloop transition at every state for
187  * all missing events. This version tries to be transparent to attributes.
188  *
189  * @param rGen
190  * Reference to generator
191  * @param rProjectAlphabet
192  * Alphabet for inverse projection
193  *
194  * @ingroup GeneratorFunctions
195  */
196 extern FAUDES_API void aInvProject(Generator& rGen, const EventSet& rProjectAlphabet);
197 
198 
199 /**
200  * Inverse projection. This adds selfloop transition at every state for
201  * all missing events. This version tries to be transparent to attributes.
202  *
203  * @param rGen
204  * Reference to argumant generator
205  * @param rProjectAlphabet
206  * Alphabet for inverse projection
207  * @param rResGen
208  * Alphabet to result.
209  *
210  * @ingroup GeneratorFunctions
211  */
212 extern FAUDES_API void aInvProject(const Generator& rGen, const EventSet& rProjectAlphabet, Generator& rResGen);
213 
214 
215 } // namespace faudes
216 
217 #endif
218 
Attributed generator class TaGenerator.
Compiletime options.
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
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 ProjectNonDetScc(Generator &rGen, const EventSet &rProjectAlphabet)
Language projection.
void aProjectNonDet(Generator &rGen, const EventSet &rProjectAlphabet)
Language projection.
void aInvProject(Generator &rGen, const EventSet &rProjectAlphabet)
Inverse projection.
void ProjectNonDet(Generator &rGen, const EventSet &rProjectAlphabet)
Language projection.
void Project(const Generator &rGen, const EventSet &rProjectAlphabet, Generator &rResGen)
Deterministic projection.
void InvProject(Generator &rGen, const EventSet &rProjectAlphabet)
Inverse projection.
void aProject(const Generator &rGen, const EventSet &rProjectAlphabet, Generator &rResGen)
Deterministic projection.
libFAUDES resides within the namespace faudes.

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