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 be nondeterministic only if parameter is
00042  * nondeterministic.
00043  *
00044  * @param rGen
00045  *   generator marking the language to be concatenated with Sigma*
00046  * 
00047  *
00048  */
00049 void ConcatenateFullLanguage(vGenerator& rGen);
00050 
00051 /**
00052  * NormalityConsistencyCheck: Consistency
00053  * check for normality input data. Used e.g. in IsNormal(),
00054  * IsNormalAlt() 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  * pinv(p(K)) intersect L = K
00082  * todo(?): check for efficient algorithm replacing above
00083  * formula that returns false immediately after having
00084  * found a non-normal string -> IsNormalFast()
00085  * todo: implement test routines, verify correctness
00086  * todo: compare speed with IsNormalAlt
00087  *
00088  * @param rL
00089  *   generator of language L
00090  * @param rOAlph
00091  *   observable alphabet
00092  * @param rK
00093  *   generator of language K
00094  * 
00095  * @return
00096  *   true if K is normal w.r.t. L and OAlph
00097  *
00098  * @exception Exception
00099  *   - thrown by NormalityConsistencyCheck()
00100  * 
00101  * @ingroup SynthesisPlugIn
00102  *
00103  */
00104 bool IsNormal(
00105   const Generator& rL,
00106   const EventSet& rOAlph,
00107   const Generator& rK);
00108 
00109 /**
00110  * IsNormalAlt: Alternative implementation of IsNormal().
00111  * using parallel composition instead of invProject and set
00112  * intersection. Checks normality of a language K generated by
00113  * rK w.r.t. a language L generated by rL and the subset of
00114  * observable events rOAlph. This is done by checking if the
00115  * following equality holds:
00116  * p(K) || L = K
00117  * todo(?): check for efficient algorithm replacing above
00118  * formula that returns false immediately after having
00119  * found a non-normal string -> IsNormalFast()
00120  * todo: implement test routines, verify correctness
00121  * todo: compare speed with IsNormal
00122  * 
00123  * @param rL
00124  *   generator of language L
00125  * @param rOAlph
00126  *   observable alphabet
00127  * @param rK
00128  *   generator of language K
00129  * 
00130  * @return
00131  *   true if K is normal w.r.t. L and the observable
00132  *   alphabet
00133  *
00134  * @exception Exception
00135  *   - thrown by NormalityConsistencyCheck()
00136  * 
00137  *
00138  */
00139 bool IsNormalAlt(
00140   const Generator& rL,
00141   const EventSet& rOAlph,
00142   const Generator& rK);
00143 
00144 
00145 /** 
00146  * IsNormal wrapper.  
00147  * Wrapper for convenient access via the run-time interface.
00148  */
00149 bool IsNormal(const cGenerator& rPlantGen, const vGenerator& rSupCandGen);
00150 
00151 
00152 /**
00153  * SupNorm: compute supremal normal sublanguage.
00154  *
00155  * SupNorm calculates the supremal sublanguage
00156  * of the closed language K (prefix closure of the language
00157  * marked by rK) that is normal w.r.t. the closed language L
00158  * (prefix closure of the language marked by rL) and the set
00159  * of observable events.
00160  *
00161  * Method: The supremal normal sublanguage is computed
00162  * according to the Lin-Brandt-Formula:
00163  * supnorm(K)wrt(L)=K-Pinv[P(L-K)]
00164  *
00165  * SupNorm returns false on empty result.
00166  *
00167  * Parameters have to be deterministic, result is deterministic.
00168  *
00169  * Note: rL is not const, as the prefix closure is taken during
00170  * computation. However, its original marked language is restored
00171  * before return.
00172  * See also SupNormClosed and supnorm_tutorial.cpp
00173  *
00174  * @param rL
00175  *   generates the closed language L=L(rL)
00176  * @param rOAlph
00177  *   observable alphabet
00178  * @param rK
00179  *   generates the closed language K=L(rK)
00180  * @param rResult
00181  *   generates the supremal normal
00182  *   sublanguage, where Lm(rResult) is intersection of L(rResult) and Lm(rL)
00183  *   (marking consistent to rL)
00184  * 
00185  * @return
00186  *   true for nonempty result
00187  *
00188  * @exception Exception
00189  *   - Alphabets of generators don't match (id 500)
00190  *   - rOAlph not subset of rL.Alphabet() (id 506)
00191  *   - K is not subset of L. (id 0)
00192  *
00193  * @ingroup SynthesisPlugIn
00194  * 
00195  *
00196  */
00197 bool SupNorm(
00198   Generator& rL,
00199   const EventSet& rOAlph,
00200   const Generator& rK, 
00201   Generator& rResult);
00202 
00203 
00204 /**
00205  * SupNormClosed - compute supremal normal and closed
00206  * sublanguage. 
00207  *
00208  * SupNormClosed calculates the supremal sublanguage
00209  * of the closed language K (prefix closure of the language
00210  * marked by rK) that is closed  and normal w.r.t. the closed language
00211  * L (prefix closure of the language marked by rL) and the set
00212  * of observable events.
00213  *
00214  * Method: The supremal normal sublanguage is computed
00215  * according to the Lin-Brandt-Formula:
00216  * supnormclosed(K)wrt(L)=K-Pinv[P(L-K)]Sigma*
00217  * The difference to supnorm lies in the concatenation of Sigma*.
00218  * SupNormClosed returns false on empty result.
00219  *
00220  * Parameters have to be deterministic, result is deterministic.
00221  *
00222  * Note: rL is not const, as the prefix closure is taken during
00223  * computation. However, its original marked language is restored
00224  * before return.
00225  * See also supnorm_tutorial.cpp
00226  * todo: check for efficient algorithm replacing above formula
00227  *
00228  * @param rL
00229  *   generates the closed language L=L(rL)
00230  * @param rOAlph
00231  *   observable alphabet
00232  * @param rK
00233  *   generates the closed language K=L(rK)
00234  * @param rResult
00235  *   generates the supremal normal and closed
00236  *   sublanguage, where Lm(rResult) is intersection of L(rResult) and Lm(rL)
00237  *   (marking consistent to rL)
00238  * 
00239  * @return
00240  *   true for nonempty result
00241  *
00242  * @exception Exception
00243  *   - Alphabets of generators don't match (id 500)
00244  *   - rOAlph not subset of rL.Alphabet() (id 506)
00245  *   - K is not subset of L. (id 0)
00246  *
00247  * @ingroup SynthesisPlugIn
00248  * 
00249  *
00250  */
00251 bool SupNormClosed(
00252   Generator& rL,
00253   const EventSet& rOAlph,
00254   const Generator& rK, 
00255   Generator& rResult);
00256 
00257 
00258 /**
00259  * SupPrefixClosed: supremal closed sublanguage of K by cancelling
00260  * all tranistions leading to a non-marked state.
00261  * Returns false on empty result.
00262  * todo: implement test routines, verify correctness
00263  *
00264  * @param rK
00265  *   marks the (not necessarily closed) language K=Lm(rK)
00266  * @param rResult
00267  *   generates and marks the supremal closed sublanguage,
00268  *   where L(rResult)=Lm(rResult)
00269  * 
00270  * @return
00271  *   true for nonempty result
00272  *
00273  * @exception Exception
00274  *   - todo: check determinism of rK
00275  * 
00276  *
00277  */
00278 bool SupPrefixClosed(
00279   const Generator& rK,
00280   Generator& rResult);
00281 
00282 /**
00283  * SupNormAlt: Alternative implementation of SupNorm().
00284  * using SupPrefixClosed() instead of concatenating Sigma*.
00285  * SupNormAlt calculates the supremal sublanguage
00286  * of the closed language K (language generated by rK) that
00287  * is normal w.r.t. the closed language L (language generated 
00288  * by rL) and the set of observable events:
00289  * SupNormClosedAlt(K)wrt(L)=SupClosed(K-Pinv[P(L-K)])
00290  * 
00291  * SupNormAlt returns false on empty result.
00292  * todo: implement test routines, verify correctness
00293  * todo: check for efficient algorithm replacing above formula
00294  *
00295  * @param rL
00296  *   generates the closed language L=L(rL)
00297  * @param rOAlph
00298  *   observable alphabet
00299  * @param rK
00300  *   generates the closed language K=L(rK)
00301  * @param rResult
00302  *   generates the supremal normal and closed
00303  *   sublanguage, where Lm(rResult) is intersection of L(rResult) and Lm(rL)
00304  *   (marking consistent to rL)
00305  * 
00306  * @return
00307  *   true for nonempty result
00308  *
00309  * @exception Exception
00310  *   - Alphabets of generators don't match (id 500)
00311  *   - rOAlph not subset of rL.Alphabet() (id 506)
00312  *   - K is not subset of L. (id 0)
00313  * 
00314  *
00315  */
00316 bool SupNormAlt(
00317   Generator& rL,
00318   const EventSet& rOAlph,
00319   const Generator& rK, 
00320   Generator& rResult);
00321 
00322 /** rti wrapper (caution: args swap) */
00323 void SupNorm(
00324   const vGenerator& rPlantGen, 
00325   const EventSet&  rOAlph,
00326   const vGenerator& rSpecGen, 
00327   vGenerator& rResGen);
00328 
00329 /** rti wrapper (caution: args swap) */
00330 void SupNorm(
00331   const cGenerator& rPlantGen, 
00332   const vGenerator& rSpecGen, 
00333   vGenerator& rResGen);
00334 
00335 /** rti wrapper (caution: args swap) */
00336 void SupNormClosed(
00337   const vGenerator& rPlantGen, 
00338   const EventSet&  rOAlph,
00339   const vGenerator& rSpecGen, 
00340   vGenerator& rResGen);
00341 
00342 /** rti wrapper (caution: args swap) */
00343 void SupNormClosed(
00344   const cGenerator& rPlantGen, 
00345   const vGenerator& rSpecGen, 
00346   vGenerator& rResGen);
00347 
00348 
00349 } // end namespace
00350 #endif

libFAUDES 2.16b --- 2010-9-8 --- c++ source docu by doxygen 1.6.3