About
User Reference
C++ API
luafaudes
Developer
Links
libFAUDES online
libFAUDES

Sections

Index

syn_supnorm.h

Go to the documentation of this file.
00001 /** @file syn_supnorm.h Supremal normal sublanguage */
00002 
00003 /* FAU Discrete Event Systems Library (libfaudes)
00004 
00005    Copyright (C) 2009  Sebastian Perk, Thomas Moor
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Lesser General Public
00009    License as published by the Free Software Foundation; either
00010    version 2.1 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Lesser General Public License for more details.
00016 
00017    You should have received a copy of the GNU Lesser General Public
00018    License along with this library; if not, write to the Free Software
00019    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00020 
00021  
00022 #ifndef FAUDES_SUPNORM_H
00023 #define FAUDES_SUPNORM_H
00024 
00025 #include "corefaudes.h"
00026 #include <stack>
00027 
00028 namespace faudes {
00029 
00030 /**
00031  * ConcatenateFullLanguage: concatenate Sigma* to language
00032  * marked by rGen. Less expensive than using
00033  * LanguageConcatenate() to concatenate Sigma*, as no
00034  * additional nondeterminism is caused.
00035  * Used in SupNorm().
00036  * Method:
00037  * Transitions starting from marked states are erased.
00038  * Remaining accessible marked states are provided with
00039  * Sigma-selfloops.
00040  * Determinism:
00041  * Result can only become nondeterministic when a parameter is
00042  * nondeterministic.
00043  *
00044  * @param rGen
00045  *   generator marking the language to be concatenated with Sigma*
00046  * 
00047  *
00048  */
00049 void ConcatenateFullLanguage(Generator& rGen);
00050 
00051 /**
00052  * NormalityConsistencyCheck: Consistency
00053  * check for normality input data. Used e.g. in IsNormal(),
00054  * and SupNorm(). See exceptions.
00055  *
00056  * @param rL
00057  *   generator of language L
00058  * @param rOAlph
00059  *   observable alphabet
00060  * @param rK
00061  *   generator of language K
00062  *
00063  * @exception Exception
00064  *   - nondeterministic parameter(s) (id: 101)
00065  *   - rOAlph not subset of rL.Alphabet() (id: 100)
00066  *   - Alphabets of generators don't match (id: 100)
00067  *   - K is not subset of L (id 0)
00068  * 
00069  *
00070  */
00071 void NormalityConsistencyCheck(
00072   const Generator& rL,
00073   const EventSet& rOAlph,
00074   const Generator& rK);
00075 
00076 /**
00077  * IsNormal: checks normality of a language K generated by
00078  * rK wrt a language L generated by rL and the subset of
00079  * observable events rOAlph. This is done by checking if the
00080  * following equality holds:
00081  *
00082  * pinv(p(K)) intersect L \subseteq K
00083  * 
00084  * Thus, we assume K \subseteq L for a sufficient and necessary test.
00085  *
00086  * Todos: 
00087  * check for efficient algorithm replacing above
00088  * formula that returns false immediately after having
00089  * found a non-normal string -> IsNormalFast();
00090  * implement test routines, verify correctness;
00091  * compare performance with IsNormalAlt
00092  *
00093  * @param rL
00094  *   generator of language L
00095  * @param rOAlph
00096  *   observable alphabet
00097  * @param rK
00098  *   generator of language K
00099  * 
00100  * @return
00101  *   true if K is normal w.r.t. L and OAlph
00102  *
00103  * @exception Exception
00104  *   - thrown by NormalityConsistencyCheck()
00105  * 
00106  * @ingroup SynthesisPlugIn
00107  *
00108  */
00109 bool IsNormal(
00110   const Generator& rL,
00111   const EventSet& rOAlph,
00112   const Generator& rK);
00113 
00114 /** 
00115  * IsNormal wrapper.  
00116  * Wrapper for convenient access via the run-time interface.
00117  */
00118 bool IsNormal(const System& rPlantGen, const Generator& rSupCandGen);
00119 
00120 
00121 /**
00122  * SupNorm: compute supremal normal sublanguage.
00123  *
00124  * SupNorm calculates the supremal sublanguage
00125  * of the closed language K (generated by rK)
00126  * that is normal w.r.t. the closed language L
00127  * (generated by rL) and the set
00128  * of observable events.
00129  *
00130  * Method: The supremal normal sublanguage is computed
00131  * according to the Lin-Brandt-Formula:
00132  * supnorm(K)wrt(L)=K-Pinv[P(L-K)]
00133  *
00134  * SupNorm returns false on empty result.
00135  *
00136  * Parameters have to be deterministic, result is deterministic.
00137  *
00138  *
00139  * @param rL
00140  *   generates the closed language L=L(rL)
00141  * @param rOAlph
00142  *   observable alphabet
00143  * @param rK
00144  *   generates the closed language K=L(rK)
00145  * @param rResult
00146  *   marks the supremal normal
00147  *   sublanguage (not necessaryly prefix closed)
00148  * 
00149  * @return
00150  *   true for nonempty result
00151  *
00152  * @exception Exception
00153  *   - Alphabets of generators don't match (id 500)
00154  *   - rOAlph not subset of rL.Alphabet() (id 506)
00155  *   - K is not subset of L. (id 0)
00156  *
00157  * @ingroup SynthesisPlugIn
00158  * 
00159  *
00160  */
00161 bool SupNorm(
00162   const Generator& rL,
00163   const EventSet& rOAlph,
00164   const Generator& rK, 
00165   Generator& rResult);
00166 
00167 
00168 /**
00169  * SupNormClosed - compute supremal normal and closed
00170  * sublanguage. 
00171  *
00172  * SupNormClosed calculates the supremal sublanguage
00173  * of the closed language K (generated by rK)
00174  * that is closed  and normal w.r.t. the closed language
00175  * L (generated by rL) and the set
00176  * of observable events.
00177  *
00178  * Method: The supremal normal sublanguage is computed
00179  * according to the Lin-Brandt-Formula:
00180  * supnormclosed(K)wrt(L)=K-Pinv[P(L-K)]Sigma*
00181  *
00182  * Parameters have to be deterministic, result is deterministic.
00183  *
00184  *
00185  * @param rL
00186  *   generates the closed language L=L(rL)
00187  * @param rOAlph
00188  *   observable alphabet
00189  * @param rK
00190  *   generates the closed language K=L(rK)
00191  * @param rResult
00192  *   marks and generates the supremal normal and closed
00193  *   sublanguage
00194  * 
00195  * @return
00196  *   true for nonempty result
00197  *
00198  * @exception Exception
00199  *   - Alphabets of generators don't match (id 500)
00200  *   - rOAlph not subset of rL.Alphabet() (id 506)
00201  *   - K is not subset of L. (id 0)
00202  *
00203  * @ingroup SynthesisPlugIn
00204  * 
00205  *
00206  */
00207 bool SupNormClosed(
00208   const Generator& rL,
00209   const EventSet& rOAlph,
00210   const Generator& rK, 
00211   Generator& rResult);
00212 
00213 
00214 /**
00215  * SupConNormClosed: compute supremal controllable, normal and closed
00216  * sublanguage.
00217  *
00218  * SupConNormClosed computes the supremal sublanguage
00219  * of language K (generated by rK) that is
00220  * - controllable w.r.t. the language L (generated by rL);
00221  * - normal w.r.t. the language L; and 
00222  * - prefix closed.
00223  *
00224  * The implementation is based on results by Brandt et al 
00225  * "Formulas for calculation supremal and normal sublanguages", 
00226  * Thm 4, System and Control Letters, 1990.
00227  *
00228  * Parameters have to be deterministic, result is deterministic.
00229  *
00230  *
00231  * @param rL
00232  *   generates the closed language L=L(rL)
00233  * @param rCAlph
00234  *   controllable alphabet
00235  * @param rOAlph
00236  *   observable alphabet
00237  * @param rK
00238  *   generates the closed language K=L(rK)
00239  * @param rResult
00240  *   marks and generates the supremal contr, normal and closed
00241  *   sublanguage 
00242  * 
00243  *
00244  * @exception Exception
00245  *   - Alphabets of generators don't match (id 500)
00246  *   - rCAlph not subset of rL.Alphabet() (id 506)
00247  *   - rOAlph not subset of rL.Alphabet() (id 506)
00248  *   - K is not subset of L. (id 0)
00249  *
00250  * @ingroup SynthesisPlugIn
00251  * 
00252  *
00253  */
00254 void SupConNorm(
00255   const Generator& rL,
00256   const EventSet& rCAlph,
00257   const EventSet& rOAlph,
00258   const Generator& rK, 
00259   Generator& rResult);
00260 
00261 
00262 /**
00263  * SupConNormNB: compute supremal controllable and normal sublanguage
00264  *
00265  * SupConNormNB computes the supremal sublanguage
00266  * of language K (marked by rK) that 
00267  * - is controllable w.r.t. the language L (marked by rL);
00268  * - has a prefix closure that is normal w.r.t. the closure of L
00269  *
00270  * The implementation is based on results by Yoo, Lafortune and Lin 
00271  * "A uniform approach for computing supremal sublanguages arising 
00272  * in supervisory control theory", 2002.
00273  *
00274  * Parameters have to be deterministic, result is deterministic.
00275  *
00276  *
00277  * @param rL
00278  *   generates the closed language L=L(rL)
00279  * @param rCAlph
00280  *   controllable alphabet
00281  * @param rOAlph
00282  *   observable alphabet
00283  * @param rK
00284  *   generates the closed language K=L(rK)
00285  * @param rResult
00286  *   marks the supremal normal and controllable
00287  *   sublanguage
00288  * 
00289  *
00290  * @exception Exception
00291  *   - Alphabets of generators don't match (id 500)
00292  *   - rCAlph not subset of rL.Alphabet() (id 506)
00293  *   - rOAlph not subset of rL.Alphabet() (id 506)
00294  *   - K is not subset of L. (id 0)
00295  *
00296  * @ingroup SynthesisPlugIn
00297  * 
00298  *
00299  */
00300 void SupConNormNB(
00301   const Generator& rL,
00302   const EventSet& rCAlph,
00303   const EventSet& rOAlph,
00304   const Generator& rK, 
00305   Generator& rResult);
00306 
00307 
00308 /**
00309  * SupPrefixClosed: supremal closed sublanguage of K by cancelling
00310  * all tranistions leading to a non-marked state.
00311  * Returns false on empty result.
00312  * todo: implement test routines, verify correctness
00313  *
00314  * @param rK
00315  *   marks the (not necessarily closed) language K=Lm(rK)
00316  * @param rResult
00317  *   generates and marks the supremal closed sublanguage,
00318  *   where L(rResult)=Lm(rResult)
00319  * 
00320  * @return
00321  *   true for nonempty result
00322  *
00323  * @exception Exception
00324  *   - todo: check determinism of rK
00325  * 
00326  *
00327  */
00328 bool SupPrefixClosed(
00329   const Generator& rK,
00330   Generator& rResult);
00331 
00332 
00333 /** rti wrapper */
00334 void SupNorm(
00335   const System& rPlantGen, 
00336   const Generator& rSpecGen, 
00337   Generator& rResGen);
00338 
00339 
00340 /** rti wrapper */
00341 void SupNormClosed(
00342   const System& rPlantGen, 
00343   const Generator& rSpecGen, 
00344   Generator& rResGen);
00345 
00346 /** rti wrapper */
00347 void SupConNorm(
00348   const System& rPlantGen, 
00349   const Generator& rSpecGen, 
00350   Generator& rResGen);
00351 
00352 /** rti wrapper */
00353 void SupConNormNB(
00354   const System& rPlantGen, 
00355   const Generator& rSpecGen, 
00356   Generator& rResGen);
00357 
00358 
00359 } // end namespace
00360 #endif

libFAUDES 2.20s --- 2011.10.12 --- c++ source docu by doxygen