ios_algorithms.h

Go to the documentation of this file.
00001 /** @file ios_algorithms.h Algorithms addressing I/O-systems */
00002 
00003 /* 
00004    IO Systems Plug-In 
00005    for FAU Discrete Event Systems Library (libFAUDES)
00006 
00007    Copyright (C) 2010, Thomas Wittmann, Thomas Moor
00008 
00009 */
00010 
00011 #ifndef FAUDES_IOS_ALGORITHMS
00012 #define FAUDES_IOS_ALGORITHMS
00013 
00014 #include "ios_system.h"
00015 
00016 namespace faudes {
00017 
00018 /**
00019  * Test whether the system satisfies basic I/O conditions.
00020  *
00021  * The I/O conditions tested are
00022  * - Lm(G) is complete (each string can be extended);
00023  * - U and Y are a disjoint decomposition of Sigma;
00024  * - neither U nor Y is empty;
00025  * - U and Y events alternate;
00026  *
00027  * To test the last propertie, the procedure partitions the state 
00028  * set in states QU that enable input events and states QY that enables
00029  * output-put events. The latter two state sets are returned in rQY and rQU. 
00030  * States that either block or enable both input and outputs are
00031  * return in rQErr.
00032  *
00033  * Note: this procedure is not concerned with whether the first event
00034  * should be an input or an output; neither does it require the input
00035  * to be free; see  bool IsInputLocallyFree(IoSystem&).
00036  *
00037  * Note: this procedure does not set the state attributes;
00038  * see also bool IsIoSystem(IoSystem&).
00039  * 
00040  * @param rIoSystem
00041  *   Generator to test.
00042  * @param rQY
00043  *    Output states
00044  * @param rQU
00045  *    Input states
00046  * @param rQErr
00047  *    Undecided states
00048  * @return
00049  *   True <> system is an io system.
00050  *
00051  * @ingroup IoSysPlugin 
00052  */
00053 bool IsIoSystem(const IoSystem& rIoSystem,
00054   StateSet& rQU,
00055   StateSet& rQY,
00056   StateSet& rQErr);
00057 
00058 
00059 /**
00060  * Test whether the system satisfies the IO conditions.
00061  *
00062  * Performs the same tests as 
00063  * bool IsIoSystem(const IoSystem&,StateSet&,StateSet&,StateSet&), but
00064  * does set the state attributes accordingly.
00065  *
00066  * @param rIoSystem
00067  *   Generator to test.
00068  * @return
00069  *   True <> system is an io system.
00070  *
00071  * @ingroup IoSysPlugin 
00072  */
00073 bool IsIoSystem(IoSystem& rIoSystem);
00074 
00075 
00076 /**
00077  * Construct io state partition.
00078  *
00079  * This is an rti wrapper for  bool IsIoSystem(IoSystem&).
00080  *
00081  *
00082  * @param rIoSystem
00083  *   Generator to test.
00084  *
00085  */
00086 void IoStatePartition(IoSystem& rIoSystem);
00087 
00088 
00089 /**
00090  * Test whether the system has a locally free input.
00091  *
00092  * The procedure returns True, if every state that enables some
00093  * input event enables all input events. If the system in addition
00094  * satisfies the basic I/O properties, a locally free input implies
00095  * that the behaviour induced by the generated closed language 
00096  * exhibits a free input in the behavioural sense. This implication
00097  * does not hold for the behaviour induced by the marked language. 
00098  *
00099  * If the test fails, any critical states are returned in rQErr.
00100  *
00101  * @param rIoSystem
00102  *   Generator to test.
00103  * @param rQErr
00104  *   Error states.
00105  * @return
00106  *   True <> system has an omega-free input
00107  *
00108  * @ingroup IoSysPlugin 
00109  */
00110  bool IsInputLocallyFree(const IoSystem& rIoSystem, StateSet& rQErr);
00111 
00112 
00113 /**
00114  * Test whether the system has a locally free input.
00115  *
00116  * See also bool IsInputLocallyFree(const IoSystem&,StateSet&).
00117  * This version will set the state error attribute to the set
00118  * of critical states.
00119  *
00120  * @param rIoSystem
00121  *   Generator to test.
00122  * @return
00123  *   True <> system has a locally-free input
00124  *
00125  * @ingroup IoSysPlugin 
00126  */
00127  bool IsInputLocallyFree(IoSystem& rIoSystem);
00128 
00129 
00130 /**
00131  * Enable all input events for each input state.
00132  *
00133  * If this procedure detetecs a state with some but not all 
00134  * input events enabled, an error state is introduced
00135  * and transitions with the missing input events are inserted.
00136  * The error state is setup to allow any alternating sequence 
00137  * of input and output events.
00138  *
00139  * Note that his procedure only ensures a locally free input. It does
00140  * not guarantee a free input in the behavioural sense.
00141  *
00142  * It is considered an error if the specified set of input events
00143  * is not contained in the generator alphabet.
00144  *
00145  * @param rIoSystem
00146  *   Generator argument.
00147  * @param rUAlph
00148  *   Input alphabet
00149  *
00150  * @exception Exception
00151  *   - Alphabets don't match (id 100)
00152  *
00153  * @ingroup IoSysPlugin 
00154  */
00155  void IoFreeInput(Generator& rIoSystem, const EventSet& rUAlph);
00156 
00157 
00158 /**
00159  * Enable all input events for each input state.
00160  *
00161  * Alternative interface to IoFreeInput(Generator&, const EventSet&),
00162  * which extracts the input alphabet from the given IO System.
00163  *
00164  * @param rIoSystem
00165  *   Generator argument.
00166  * @ingroup IoSysPlugin 
00167  */
00168 void IoFreeInput(IoSystem& rIoSystem);
00169 
00170 
00171 /**
00172  * Remove dummy states.
00173  *
00174  *
00175  * @param rIoSystem
00176  *   Generator argument.
00177  * @ingroup IoSysPlugin 
00178  */
00179  void RemoveIoDummyStates(IoSystem& rIoSystem);
00180 
00181 
00182 /**
00183  * Test whether the system behaviour exhibits a free input.
00184  *
00185  * The procedure assumes that the specified system satisfies
00186  * the basic I/O properties. It returns True, if it has a locally
00187  * free input and additionally can allways control its output to
00188  * reach a marked state. Technically, the latter condition can be stated
00189  * as a controllability condition, referring to the notion of omega-controllabilaty
00190  * in the definition of Thistle/Wonham.
00191  * 
00192  * This implementation performs the test in that it iteratively constructs
00193  * a set of "good" states: a state is good, if
00194  *
00195  * - it is marked, or
00196  * - it can be controlled to a good state by disableing output events
00197  *
00198  * If all reachable states are good, the test is passed. Else, all other state
00199  * are reported as error states.
00200  *
00201  * @param rIoSystem
00202  *   Generator to test.
00203  * @param rQErr
00204  *   Error states.
00205  * @return
00206  *   True <> system has an omega-free input
00207  *
00208  * @ingroup IoSysPlugin 
00209  */
00210  bool IsInputOmegaFree(const IoSystem& rIoSystem, StateSet& rQErr);
00211 
00212 
00213 /**
00214  * Test whether the system behaviour has exhibits a free input.
00215  *
00216  * See also bool IsInputOmegaFree(const IoSystem&,StateSet&).
00217  * This version will set the error flag for stytes that conflict with
00218  * a free input.
00219  *
00220  * @param rIoSystem
00221  *   Generator to test.
00222  * @return
00223  *   True <> system has an omega-free input
00224  *
00225  * @ingroup IoSysPlugin 
00226  */
00227  bool IsInputOmegaFree(IoSystem& rIoSystem);
00228 
00229 
00230 
00231 /**
00232  * IO system synthesis. 
00233  * 
00234  * This method esentially is a wrapper for SupConComplete(), which implements
00235  * a synthesis procedure to compute the supremal controllable and complete
00236  * sublanguage for a given plant and specification. Input events are regarded
00237  * controllable. marking is ignored, i.e., synthesis refers to the generated
00238  * langugaes rather than the the marked languages. For a version
00239  * thet refers to Buchi acceptance condition, see 
00240  * IoSynthesisNB(const IoSystem&, const Generator&, IoSystem&).
00241  *
00242  * The resulting supervisor is an IO System with
00243  * the plant input events as outputs and vice versa. 
00244  *
00245  * Note that this routine does not test whether the plant has a locally 
00246  * free input U, nor does it ensure that the resulting supervisor has a
00247  * free input Y.
00248  *
00249  * @param rPlant
00250  *   IO-System - plant model
00251  * @param rSpec
00252  *   Generator - specification
00253  * @param rSup
00254  *   IO-System - supervisor
00255  *
00256  * @exception Exception
00257  *   - Any exceptions passed on from SupConComplete
00258  *
00259  */
00260  void IoSynthesis(const IoSystem& rPlant, const Generator& rSpec, IoSystem& rSup);
00261 
00262 /**
00263  * IO system synthesis. 
00264  * 
00265  * This method esentially is a wrapper for SupConOmegaNB(), which implements
00266  * a synthesis procedure to compute the supremal omega-controllable.
00267  * sublanguage for a given plant and specification. Input events are regarded
00268  * controllable. In contrast to IoSynthesis(const IoSystem&, const Generator&, IoSystem&),
00269  * this procedure refers to the Bucji acceptance condition and ensures
00270  * a omega-nonblocking closed-loop behaviour.
00271  *
00272  * The resulting supervisor is an IO System with
00273  * the plant input events as outputs and vice versa. 
00274  *
00275  * Note that this routine does not test whether the plant has a locally 
00276  * free input U, nor does it ensure that the resulting supervisor has a
00277  * free input Y.
00278  *
00279  * @param rPlant
00280  *   IO-System - plant model
00281  * @param rSpec
00282  *   Generator - specification
00283  * @param rSup
00284  *   IO-System - supervisor
00285  *
00286  * @exception Exception
00287  *   - Any exceptions passed on from SupConOmegaNB
00288  *
00289  */
00290  void IoSynthesisNB(const IoSystem& rPlant, const Generator& rSpec, IoSystem& rSup);
00291 
00292 }
00293 #endif

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