mtc_project.h

Go to the documentation of this file.
00001 /** @file mtc_project.h
00002 
00003 Methods for computing the natural projection of multitasking generators
00004 
00005 */
00006 
00007 /* FAU Discrete Event Systems Library (libfaudes)
00008 
00009    Copyright (C) 2008  Matthias Singer
00010    Copyright (C) 2006  Bernd Opitz
00011    Exclusive copyright is granted to Klaus Schmidt
00012 
00013    This library is free software; you can redistribute it and/or
00014    modify it under the terms of the GNU Lesser General Public
00015    License as published by the Free Software Foundation; either
00016    version 2.1 of the License, or (at your option) any later version.
00017 
00018    This library is distributed in the hope that it will be useful,
00019    but WITHOUT ANY WARRANTY; without even the implied warranty of
00020    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021    Lesser General Public License for more details.
00022 
00023    You should have received a copy of the GNU Lesser General Public
00024    License along with this library; if not, write to the Free Software
00025    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00026 
00027 
00028 #ifndef FAUDES_MTCPROJECT_H
00029 #define FAUDES_MTCPROJECT_H
00030 
00031 #include "corefaudes.h"
00032 #include "mtc_generator.h"
00033 #include "mtc_statemin.h"
00034 
00035 namespace faudes {
00036 
00037 
00038 /**
00039  * Make generator deterministic. (function wrapper)
00040  *
00041  * @param rGen
00042  *   Reference to generator
00043  * @param rResGen
00044  *   Reference to resulting deterministic generator
00045  *
00046  * <h4>Example: Converting a nondeterministic MtcSystem to a deterministic one </h4>
00047  * <table border=0> <tr> <td>
00048  *   <table width=100%>
00049  *     <tr> <td> <center> Original MtcSystem gen</center> </td> </tr>
00050  *     <tr> <td> @image html tmp_mtc_functions_2a_nondet.png </td> </tr>
00051  *     <tr> <td> <center> The MtcSystem contains two initial states and, leaving from state 2, it has two transitions containing the same event b which are leading to two separate states. </center> </td> </tr>
00052  *   </table>
00053  *   </td> </tr>
00054  *   <tr> <td>
00055  *   <table width=100%>
00056  *     <tr> <td> <center> Result of the deterministic operation </center> </td> </tr>
00057  *     <tr> <td> @image html tmp_mtc_functions_2b_det.png </td> </tr>
00058  *     <tr> <td> <center> Both initial states are combined to a single one. All color labels appearing in all original states are adapted to the new initial state. Furthermore, states are merged in that way that the generator's language stays the same, but the generator gets deterministic. </center> </td> </tr>
00059  *   </table>
00060  *   </td> </tr>
00061  * </table>
00062  *
00063  * @ingroup MultitaskingPlugin
00064  */
00065 void mtcDeterministic(const MtcSystem& rGen, MtcSystem& rResGen);
00066 
00067 /**
00068  * Make generator deterministic. (function wrapper)
00069  *
00070  * The second parameter is an empty std::map<Idx,StateSet> which holds all
00071  * the pairs of new states and their respective power states set. This
00072  * is used as a so called "entry state map" for deterministic projected
00073  * generators.
00074  *
00075  * @param rGen
00076  *   Reference to generator
00077  * @param rEntryStatesMap
00078  *   Entry state map
00079  * @param rResGen
00080  *   Reference to resulting deterministic generator
00081  */
00082 void mtcDeterministic(const MtcSystem& rGen, std::map<Idx,StateSet>& rEntryStatesMap,
00083     MtcSystem& rResGen);
00084 
00085 /**
00086  * Make generator deterministic. (real function)
00087  *
00088  * Second and third parameter hold the subsets + deterministic states
00089  * in vectors
00090  *
00091  * The multiway merge algorithm is based on a propsal in
00092  * "Ted Leslie, Efficient Approaches to Subset Construction, 
00093  *  Computer Science, University of Waterloo, 1995"
00094  *
00095  * @param rGen
00096  *   Reference to generator
00097  * @param rPowerStates
00098  *   Vector that holds the power states
00099  * @param rDetStates 
00100  *   Vector that holds the corresponding deterministic states
00101  * @param rResGen
00102  *   Reference to resulting deterministic generator
00103  */
00104 void mtcDeterministic(const MtcSystem& rGen, std::vector<StateSet>& rPowerStates,
00105     std::vector<Idx>& rDetStates, MtcSystem& rResGen);
00106 
00107 /**
00108  * Project generator to alphabet rProjectAlphabet
00109  *
00110  * @param rGen
00111  *   Reference to generator
00112  * @param rProjectAlphabet
00113  *   Projection alphabet
00114  *
00115  * @ingroup MultitaskingPlugin
00116  */
00117 void mtcProjectNonDet(MtcSystem& rGen, const EventSet& rProjectAlphabet);
00118 
00119 /**
00120  * Project generator to alphabet rProjectAlphabet
00121  *
00122  * @param rGen
00123  *   Reference to generator
00124  * @param rProjectAlphabet
00125  *   Projection alphabet
00126  * @param rResGen
00127  *   Reference to result
00128  *
00129  * @ingroup MultitaskingPlugin
00130  */
00131  void mtcProjectNonDet(const MtcSystem& rGen, const EventSet& rProjectAlphabet, MtcSystem& rResGen);
00132 
00133 /**
00134  * Minimized Deterministic projection. This function does not modify the MtcSystem. It calls project, determine and statemin.
00135  *
00136  * @param rGen
00137  *   Reference to generator
00138  * @param rProjectAlphabet
00139  *   Projection alphabet
00140  * @param rResGen
00141  *   Reference to resulting deterministic generator
00142  *
00143  * <h4>Example: Projection of an MtcSystem to a specified alphabet </h4>
00144  * <table border=0> <tr> <td>
00145  *   <table width=100%>
00146  *     <tr> <td> <center> Original MtcSystem gen</center> </td> </tr>
00147  *     <tr> <td> @image html tmp_mtc_functions_3a_system.png </td> </tr>
00148  *     <tr> <td> <center> The projection alphabet contains the events {a, b, d}. </center> </td> </tr>
00149  *   </table>
00150  *   </td> </tr>
00151  *   <tr> <td>
00152  *   <table width=100%>
00153  *     <tr> <td> <center> Result of the projection </center> </td> </tr>
00154  *     <tr> <td> @image html tmp_mtc_functions_3b_projected.png </td> </tr>
00155  *     <tr> <td> <center> The resulting MtcSystem contains all events that appear in the oringinal MtcSystem and in the specified alphabet. Moreover, the resulting MtcSystem is deterministic. </center> </td> </tr>
00156  *   </table>
00157  *   </td> </tr>
00158  * </table>
00159  *
00160  * @ingroup MultitaskingPlugin
00161  */
00162 void mtcProject(const MtcSystem& rGen, const EventSet& rProjectAlphabet, MtcSystem& rResGen);
00163 
00164 /**
00165  * Minimized Deterministic projection. Does not modify generator.
00166  * Calls project, determine and statemin. See functions for details.
00167  *
00168  * @param rGen
00169  *   Reference to generator
00170  * @param rProjectAlphabet
00171  *   Projection alphabet
00172  * @param rEntryStatesMap
00173  *   Reference to entry states map, see Deterministic(..) (result)
00174  * @param rResGen
00175  *   Reference to resulting deterministic generator (result)
00176  */
00177 void mtcProject(const MtcSystem& rGen, const EventSet& rProjectAlphabet,
00178     std::map<Idx,StateSet>& rEntryStatesMap, MtcSystem& rResGen);
00179 
00180 /**
00181  * Inverse projection. This adds selfloop transition at every state for
00182  * all missing events.
00183  *
00184  * @param rGen
00185  *   Reference to generator
00186  * @param rProjectAlphabet
00187  *   Alphabet for inverse projection
00188  *
00189  * <h4>Example: Inverse projection of an MtcSystem for a specified alphabet which is larger than the MtcSystem's one. </h4>
00190  * <table border=0> <tr> <td>
00191  *   <table width=100%>
00192  *     <tr> <td> <center> Original MtcSystem </center> </td> </tr>
00193  *     <tr> <td> @image html tmp_mtc_functions_5_spec.png </td> </tr>
00194  *     <tr> <td> <center> The projection alphabet contains the events {a, b, c}. </center> </td> </tr>
00195  *   </table>
00196  *   </td> </tr>
00197  *   <tr> <td>
00198  *   <table width=100%>
00199  *     <tr> <td> <center> Result of the projection </center> </td> </tr>
00200  *     <tr> <td> @image html tmp_mtc_functions_5_spec_invpro.png </td> </tr>
00201  *     <tr> <td> <center> Events, that are not part of the MtcSystem's alphabet are inserted as self-loops into every state. </center> </td> </tr>
00202  *   </table>
00203  *   </td> </tr>
00204  * </table>
00205  *
00206  * @ingroup MultitaskingPlugin
00207  */
00208 void mtcInvProject(MtcSystem& rGen, const EventSet& rProjectAlphabet);
00209 
00210 /**
00211  * RTI wrapper. See mtcInvProject(MtcSystem&, const EventSet&).
00212  */
00213 void mtcInvProject(const MtcSystem& rGen, const EventSet& rProjectAlphabet, MtcSystem& rResGen);
00214 
00215 } // namespace faudes
00216 
00217 #endif

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