cfl_project.h

Go to the documentation of this file.
00001 /** @file cfl_project.h language projection */
00002 
00003 /* FAU Discrete Event Systems Library (libfaudes)
00004 
00005    Copyright (C) 2006  Bernd Opitz
00006    Exclusive copyright is granted to Klaus Schmidt
00007 
00008    This library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Lesser General Public
00010    License as published by the Free Software Foundation; either
00011    version 2.1 of the License, or (at your option) any later version.
00012 
00013    This library is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Lesser General Public License for more details.
00017 
00018    You should have received a copy of the GNU Lesser General Public
00019    License along with this library; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00021 
00022 
00023 #ifndef FAUDES_PROJECT_H
00024 
00025 #include "cfl_definitions.h"
00026 #include "cfl_agenerator.h"
00027 
00028 namespace faudes {
00029 
00030 
00031 /**
00032  * Language projection.
00033  *
00034  * Projects the generated and marked languages to another alphabet.
00035  * Transitions with events not in the projection alphabet are considered 
00036  * invisible and therefor acordingly relinked with a visible lable to the appropriate 
00037  * successor state. The projection alphabet is intended (but not required) to be 
00038  * a subset of the original alphabet. 
00039  *
00040  * The default implementation is based on a local forward reachability analysis per state. 
00041  * It known to suffer from performance issues for certain large automata. This was 
00042  * in particular the case for the variation used in libFAUDES 2.14 up to 2.23. A number of 
00043  * alternatives are now available in "cfl_project.cpp" and can bet set as the default by adjusting 
00044  * the respective wrapper function (grep for "wrapper" in "cfl_project.cpp"). If you experience
00045  * trouble with the current revision, you can set the default to revert to pre libFAUDES 2.24 behaviour --
00046  * and please report back to us. The candidate for future releases is available for testing,
00047  * see ProjectNonDetScc(Generator&, const EventSet&).
00048  *
00049  * The results in general is nondeterministic. The input generator does not need to 
00050  * be deterministic. See Project(const Generator&,const EventSet&, Generator&) for
00051  * a version with deterministic result. 
00052  *
00053  *
00054  * @param rGen
00055  *   Reference to generator
00056  * @param rProjectAlphabet
00057  *   Projection alphabet
00058  *
00059  * @ingroup GeneratorFunctions
00060  */
00061 void ProjectNonDet(Generator& rGen, const EventSet& rProjectAlphabet);
00062 
00063 
00064 
00065 /**
00066  * Language projection.
00067  *
00068  * Projects the generated and marked languages to another alphabet, see
00069  * also ProjectNonDetScc(Generator&, const EventSet&). This implementation
00070  * first eliminates silent strongly connected components and then applies a
00071  * local backward reachability analysis. Performance benefits are significant for
00072  * certain large generators.
00073  *
00074  * The input generator does not need to be deterministic. The results in general 
00075  * is nondeterministic. You may manually invoke Deterministic() to convert the result.
00076  *
00077  *
00078  * @param rGen
00079  *   Reference to generator
00080  * @param rProjectAlphabet
00081  *   Projection alphabet
00082  *
00083  * @ingroup GeneratorFunctions
00084  */
00085 void ProjectNonDetScc(Generator& rGen, const EventSet& rProjectAlphabet);
00086 
00087 /**
00088  * Deterministic projection. 
00089  *
00090  * Projects the generated and marked languages to a subalphabet of the original alphabet, 
00091  * and subsequently calls Deterministic to construct a deterministic 
00092  * realisation of the result. The input generator does not need to be deterministic.
00093  *
00094  * @param rGen
00095  *   Reference to generator
00096  * @param rProjectAlphabet
00097  *   Projection alphabet
00098  * @param rResGen
00099  *   Reference to resulting deterministic generator
00100  *
00101  * <h4>Example:</h4>
00102  * <table>
00103  * <tr> <td> Generator G </td> <td> Project(G,(a,c,g,e),Result) </td> </tr>
00104  * <tr>
00105  * <td> @image html tmp_project_g.png </td>
00106  * <td> @image html tmp_project_prog.png </td>
00107  * </tr>
00108  * </table> 
00109  *
00110  * @ingroup GeneratorFunctions
00111  */
00112 void Project(const Generator& rGen, const EventSet& rProjectAlphabet, Generator& rResGen);
00113 
00114 /**
00115  * Deterministic projection. 
00116  *
00117  * See also Project(const Generator&, const EventSet&, Generator&).
00118  * This version tries to be transparent on event attributes: if
00119  * argument attributes match and if the result can take the respective
00120  * attributes, then they are copied; it is considered an error if 
00121  * argument attributes do not match.
00122  *
00123  * @param rGen
00124  *   Reference to generator
00125  * @param rProjectAlphabet
00126  *   Projection alphabet
00127  * @param rResGen
00128  *   Reference to resulting deterministic generator
00129  *
00130  *
00131  * @ingroup GeneratorFunctions
00132  */
00133 void aProject(const Generator& rGen, const EventSet& rProjectAlphabet, Generator& rResGen);
00134 
00135 /**
00136  * Language projection.
00137  *
00138  * See also ProjectNonDet(const Generator&, const EventSet&).
00139  * This version tries to be transparent on event attributes: result maintains
00140  * its attributes. 
00141  *
00142  * @param rGen
00143  *   Reference to generator
00144  * @param rProjectAlphabet
00145  *   Projection alphabet
00146  *
00147  * @ingroup GeneratorFunctions
00148  */
00149 void aProjectNonDet(Generator& rGen, const EventSet& rProjectAlphabet);
00150 
00151 
00152 /**
00153  * Deterministic projection. 
00154  * 
00155  * Projects the generated and marked languages to a subalphabet of the original alphabet, 
00156  * and subsequently calls Deterministic to construct a deterministic minimal
00157  * realisation of the result. The input generator does not need to be deterministic.
00158  *
00159  * @param rGen
00160  *   Reference to generator
00161  * @param rProjectAlphabet
00162  *   Projection alphabet
00163  * @param rEntryStatesMap
00164  *   Reference to entry states map, see Deterministic(..) (result)
00165  * @param rResGen
00166  *   Reference to resulting deterministic generator (result)
00167  */
00168 void Project(const Generator& rGen, const EventSet& rProjectAlphabet,
00169           std::map<Idx,StateSet>& rEntryStatesMap, Generator& rResGen);
00170 
00171 /**
00172  * Inverse projection. This adds selfloop transition at every state for
00173  * all missing events.
00174  *
00175  * @param rGen
00176  *   Reference to generator
00177  * @param rProjectAlphabet
00178  *   Alphabet for inverse projection
00179  *
00180  * @ingroup GeneratorFunctions
00181  */
00182 void InvProject(Generator& rGen, const EventSet& rProjectAlphabet);
00183 
00184 /**
00185  * Inverse projection. This adds selfloop transition at every state for
00186  * all missing events. This version tries to be transparent to attributes.
00187  *
00188  * @param rGen
00189  *   Reference to generator
00190  * @param rProjectAlphabet
00191  *   Alphabet for inverse projection
00192  *
00193  * @ingroup GeneratorFunctions
00194  */
00195 void aInvProject(Generator& rGen, const EventSet& rProjectAlphabet);
00196 
00197 
00198 /**
00199  * Inverse projection. This adds selfloop transition at every state for
00200  * all missing events. This version tries to be transparent to attributes.
00201  *
00202  * @param rGen
00203  *   Reference to argumant generator
00204  * @param rProjectAlphabet
00205  *   Alphabet for inverse projection
00206  * @param rResGen
00207  *   Alphabet to result.
00208  *
00209  * @ingroup GeneratorFunctions
00210  */
00211 void aInvProject(const Generator& rGen, const EventSet& rProjectAlphabet, Generator& rResGen);
00212 
00213 
00214 } // namespace faudes
00215 
00216 #define FAUDES_PROJECT_H
00217 #endif 
00218 

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen