mtc_supcon.h

Go to the documentation of this file.
00001 /** @file mtc_supcon.h
00002 
00003 Supremal controllable sublanguage and controllablity
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 MTC_SUPCON_H
00029 
00030 #include "corefaudes.h"
00031 #include "mtc_generator.h"
00032 #include "mtc_project.h"
00033 #include "mtc_parallel.h"
00034 #include <stack>
00035 
00036 
00037 namespace faudes {
00038 
00039 /**
00040  * Nonblocking Supremal Controllable Sublanguage (wrapper function)
00041  *
00042  * Computes symbolic state names in resulting supervisor automaton
00043  * if symbolic state names are enabled in rPlantGen and rSpecGen
00044  *
00045  * @param rPlantGen
00046  *   Plant MtcSystem
00047  * @param rSpecGen
00048  *   Specification MtcSystem
00049  * @param rResGen
00050  *   Reference to resulting MtcSystem, the
00051  *   minimal restrictive nonblocking supervisor
00052  *
00053  * @exception Exception
00054  *   - Alphabets of generators don't match (id 500)
00055  *   - plant nondeterministic (id 501)
00056  *   - spec nondeterministic (id 503)
00057  *   - plant and spec nondeterministic (id 504)
00058  *
00059  * <h4>Example: Synthesis of a strongly nonblocking supervisor for a model and a corresponding specification </h4>
00060  * <table border=0> <tr> <td>
00061  *   <table width=100%>
00062  *     <tr> <td> <center> Model MtcSystem </center> </td> </tr>
00063  *     <tr> <td> @image html tmp_mtc_functions_5_plant.png </td> </tr>
00064  *     <tr> <td> <center> The model contains one state that results in a blocking behavior. </center> </td> </tr>
00065  *   </table>
00066  *   </td> </tr>
00067  *   <table width=100%>
00068  *     <tr> <td> <center> Specification MtcSystem </center> </td> </tr>
00069  *     <tr> <td> @image html tmp_mtc_functions_5_spec.png </td> </tr>
00070  *     <tr> <td> <center> The specification expresses, that after an event b an event c has to occur before b can happen again. Furthermore, it forbids that event c occurs before event b has taken place.
00071  *
00072  * Before being able to compute a supervisor, an inverse projection step has to be applied on the specification. It inserts self-loops for event a in both states, as the alphabets of model and specification must be identical. </center> </td> </tr>
00073  *   </table>
00074  *   </td> </tr>
00075  *   <tr> <td>
00076  *   <table width=100%>
00077  *     <tr> <td> <center> Strongly nonblocking supervisor </center> </td> </tr>
00078  *     <tr> <td> @image html tmp_mtc_functions_5_supernb.png </td> </tr>
00079  *     <tr> <td> <center> The synthesized supervisor ensures that the specification condition is fulfilled. That is why state 5 of the model and the corresponding transitions are erased. Observe that the operation does not make a generator nonblocking, as is shown in the example where state 3 is still existing. </center> </td> </tr>
00080  *   </table>
00081  *   </td> </tr>
00082  * </table>
00083  *
00084  * @ingroup MultitaskingPlugin
00085  */
00086 void mtcSupConNB(const MtcSystem& rPlantGen, const MtcSystem& rSpecGen, 
00087     MtcSystem& rResGen);
00088 
00089 
00090 /** 
00091  * Nonblocking Supremal Controllable Sublanguage.
00092  * 
00093  * Only for deterministic plant + spec. Throws exception if plant or
00094  * spec is nondeterministic.
00095  *
00096  * Real mtcSupConNB function
00097  *
00098  * Finds the "largest" sublanguage of h for that language of g is
00099  * controllable with respect to h. Differing from theory the marked
00100  * language of h may not be a sublanguage of g but both must share the
00101  * same alphabet.
00102  *
00103  * See "C.G CASSANDRAS AND S. LAFORTUNE. Introduction to Discrete Event 
00104  * Systems. Kluwer, 1999." for base algorithm.
00105  *
00106  * This version creates a "reverse composition map" given as reference
00107  * parameter.
00108  * 
00109  * @param rPlantGen
00110  *   Plant MtcSystem 
00111  * @param rSpecGen
00112  *   Specification MtcSystem 
00113  * @param rReverseCompositionMap
00114  *   std::map< std::pair<Idx,Idx>, Idx> as in the parallel composition function
00115  * @param rResGen
00116  *   Reference to resulting MtcSystem, the
00117  *   minimal restrictive nonblocking supervisor
00118  *
00119  * @exception Exception
00120  *   - Alphabets of generators don't match (id 500)
00121  *   - plant nondeterministic (id 501)
00122  *   - spec nondeterministic (id 503)
00123  *   - plant and spec nondeterministic (id 504)
00124  */
00125 void mtcSupConNB(const MtcSystem& rPlantGen, const MtcSystem& rSpecGen, 
00126     std::map< std::pair<Idx,Idx>,Idx >& rReverseCompositionMap, MtcSystem& rResGen);
00127 
00128 
00129 /**
00130  * Supremal Controllable Sublanguage (wrapper function)
00131  *
00132  * @param rPlantGen
00133  *   Plant MtcSystem
00134  * @param rSpecGen
00135  *   Specification MtcSystem
00136  * @param rResGen
00137  *   Reference to resulting MtcSystem, the
00138  *   minimal restrictive supervisor
00139  *
00140  * @exception Exception
00141  *   - Alphabets of generators don't match (id 500)
00142  *   - plant nondeterministic (id 501)
00143  *   - spec nondeterministic (id 503)
00144  *   - plant and spec nondeterministic (id 504)
00145  *
00146  * <h4>Example: Synthesis of a multitasking supervisor for a model and a corresponding specification. Supervisor does not take care of nonblocking behavior. </h4>
00147  * <table border=0> <tr> <td>
00148  *   <table width=100%>
00149  *     <tr> <td> <center> Model MtcSystem </center> </td> </tr>
00150  *     <tr> <td> @image html tmp_mtc_functions_5_plant.png </td> </tr>
00151  *     <tr> <td> <center> The model contains one state that results in a blocking behavior. </center> </td> </tr>
00152  *   </table>
00153  *   </td> </tr>
00154  *   <table width=100%>
00155  *     <tr> <td> <center> Specification MtcSystem </center> </td> </tr>
00156  *     <tr> <td> @image html tmp_mtc_functions_5_spec.png </td> </tr>
00157  *     <tr> <td> <center> The specification expresses, that after an event b an event c has to occur before b can happen again. Furthermore, it forbids that event c occurs before event b has taken place.
00158  *
00159  * Before being able to compute a supervisor, an inverse projection step has to be applied on the specification. It inserts self-loops for event a in both states, as the alphabets of model and specification must be identical. </center> </td> </tr>
00160  *   </table>
00161  *   </td> </tr>
00162  *   <tr> <td>
00163  *   <table width=100%>
00164  *     <tr> <td> <center> Strongly nonblocking supervisor </center> </td> </tr>
00165  *     <tr> <td> @image html tmp_mtc_functions_5_super.png </td> </tr>
00166  *     <tr> <td> <center> The supervisor synthesized by this function is strongly nonblocking. Of course, it ensures that the specification condition is fulfilled. </center> </td> </tr>
00167  *   </table>
00168  *   </td> </tr>
00169  * </table>
00170  *
00171  * @ingroup MultitaskingPlugin
00172  */
00173 void mtcSupConClosed(const MtcSystem& rPlantGen, const MtcSystem& rSpecGen, 
00174     MtcSystem& rResGen);
00175 
00176 
00177 /** 
00178  * Supremal Controllable Sublanguage.
00179  * 
00180  * Only for deterministic plant + spec. Throws exception if plant or
00181  * spec is nondeterministic.
00182  *
00183  * Real mtcSupCon function
00184  *
00185  * Finds the "largest" sublanguage of h for that language of g is
00186  * controllable with respect to h. Differing from theory the marked
00187  * language of h may not be a sublanguage of g but both must share the
00188  * same alphabet.
00189  *
00190  * See "C.G CASSANDRAS AND S. LAFORTUNE. Introduction to Discrete Event 
00191  * Systems. Kluwer, 1999." for base algorithm.
00192  *
00193  * This version creates a "reverse composition map" given as reference
00194  * parameter.
00195  * 
00196  * @param rPlantGen
00197  *   Plant MtcSystem 
00198  * @param rSpecGen
00199  *   Specification MtcSystem 
00200  * @param rReverseCompositionMap
00201  *   std::map< std::pair<Idx,Idx>, Idx> as in the parallel composition function
00202  * @param rResGen
00203  *   Reference to resulting MtcSystem, the
00204  *   minimal restrictive supervisor
00205  *
00206  * @exception Exception
00207  *   - Alphabets of generators don't match (id 500)
00208  *   - plant nondeterministic (id 501)
00209  *   - spec nondeterministic (id 503)
00210  *   - plant and spec nondeterministic (id 504)
00211  */
00212 void mtcSupConClosed(const MtcSystem& rPlantGen, const MtcSystem& rSpecGen, 
00213     std::map< std::pair<Idx,Idx>,Idx >& rReverseCompositionMap, MtcSystem& rResGen);
00214 
00215 /** 
00216  * Fast parallel composition for computation for the mtcSupConNB. 
00217  * Composition stops at transition paths that leave the specification
00218  * by uncontrollable events in plant.
00219  * 
00220  * @param rPlantGen
00221  *   Plant MtcSystem 
00222  * @param rSpecGen
00223  *   Specification MtcSystem 
00224  * @param rUAlph
00225  *   Uncontrollable Events
00226  * @param rReverseCompositionMap
00227  *   std::map< std::pair<Idx,Idx>, Idx> as in the parallel composition function
00228  * @param rResGen
00229  *   Reference to resulting MtcSystem, the
00230  *   less restrictive supervisor
00231  */
00232 void mtcSupConParallel(const MtcSystem& rPlantGen, const MtcSystem& rSpecGen,
00233     const EventSet& rUAlph, std::map< std::pair<Idx,Idx>, Idx>& rReverseCompositionMap, 
00234     MtcSystem& rResGen);
00235 
00236 /*
00237 
00238   obsolete
00239 
00240  * Helper function for supermal controllable sublanguage computation
00241  * the colors of a state in the shared behavior are determined
00242  * 
00243  * @param rPlantGen
00244  *   Plant MtcSystem 
00245  * @param rSpecGen
00246  *   Specification MtcSystem 
00247  * @param SharedColors
00248  *   colors shared between rPlantGen and rSpecGen
00249  * @param currentstates
00250  *   std::pair<Idx,Idx> contains the current states of both generators
00251  * @param ComposedSet
00252  *   Contains the Composed ColorSet
00253  void ComposedColorSet(const ColorSet& SharedColors,const std::pair<Idx,Idx>& currentstates,
00254     const MtcSystem& rPlantGen,const MtcSystem& rSpecGen,ColorSet& ComposedSet);
00255 */
00256 
00257 /**
00258  * Supremal Controllable Sublangauge (Real SupCon function; unchecked)
00259  *
00260  * Both, plant and spec MUST be deterministic and share the same alphabet!!!
00261  *
00262  * Most likely will result in blocking states.
00263  *
00264  * @param rPlantGen
00265  *   Plant generator
00266  * @param rCAlph
00267  *   Controllable events
00268  * @param rSupGen
00269  *   Specification generator
00270  *
00271  *
00272  * @exception Exception
00273  *   - Alphabets of generators don't match (id 500)
00274  *   - Plant generator nondeterministic (id 501)
00275  *   - Specification generator nondeterministic (id 503)
00276  *   - Plant & Spec generator nondeterministic (id 504)
00277  */
00278 void mtcSupConUnchecked(const MtcSystem& rPlantGen, const EventSet& rCAlph, MtcSystem& rSupGen);
00279 
00280 } // namespace faudes
00281 
00282 #define MTC_SUPCON_H
00283 #endif 
00284 

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