| |
libFAUDES
Sections
Index
|
syn_supnorm.hGo 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 void IsNormal( 00150 const vGenerator& rPlantGen, 00151 const EventSet& rOAlph, 00152 const vGenerator& rSupCandGen, 00153 bool& rRes); 00154 00155 /** 00156 * IsNormal wrapper. 00157 * Wrapper for convenient access via the run-time interface. 00158 */ 00159 void IsNormal( 00160 const cGenerator& rPlantGen, 00161 const vGenerator& rSupCandGen, 00162 bool& rRes); 00163 00164 00165 /** 00166 * SupNorm: compute supremal normal and closed 00167 * sublanguage. SupNorm calculates the supremal sublanguage 00168 * of the closed language K (prefix closure of the language 00169 * marked by rK) that is normal w.r.t. the closed language L 00170 * (prefix closure of the language marked by rL) and the set 00171 * of observable events. 00172 * Method: The supremal normal sublanguage is computed 00173 * according to the Lin-Brandt-Formula: 00174 * supnorm(K)wrt(L)=K-Pinv[P(L-K)]Sigma* 00175 * SupNorm returns false on empty result. 00176 * Parameters have to be deterministic, result is deterministic. 00177 * Note: rL is not const, as the prefix closure is taken during 00178 * computation. However, its original marked language is restored 00179 * before return. 00180 * See also supnorm_turorial.cpp 00181 * todo: check for efficient algorithm replacing above formula 00182 * 00183 * @param rL 00184 * generates the closed language L=L(rL) 00185 * @param rOAlph 00186 * observable alphabet 00187 * @param rK 00188 * generates the closed language K=L(rK) 00189 * @param rResult 00190 * generates the supremal normal and closed 00191 * sublanguage, where Lm(rResult) is intersection of L(rResult) and Lm(rL) 00192 * (marking consistent to rL) 00193 * 00194 * @return 00195 * true for nonempty result 00196 * 00197 * @exception Exception 00198 * - Alphabets of generators don't match (id 500) 00199 * - rOAlph not subset of rL.Alphabet() (id 506) 00200 * - K is not subset of L. (id 0) 00201 * 00202 * @ingroup SynthesisPlugIn 00203 * 00204 * 00205 */ 00206 bool SupNorm( 00207 Generator& rL, 00208 const EventSet& rOAlph, 00209 const Generator& rK, 00210 Generator& rResult); 00211 00212 00213 /** 00214 * SupPrefixClosed: supremal closed sublanguage of K by cancelling 00215 * all tranistions leading to a non-marked state. 00216 * Returns false on empty result. 00217 * todo: implement test routines, verify correctness 00218 * 00219 * @param rK 00220 * marks the (not necessarily closed) language K=Lm(rK) 00221 * @param rResult 00222 * generates and marks the supremal closed sublanguage, 00223 * where L(rResult)=Lm(rResult) 00224 * 00225 * @return 00226 * true for nonempty result 00227 * 00228 * @exception Exception 00229 * - todo: check determinism of rK 00230 * 00231 * 00232 */ 00233 bool SupPrefixClosed( 00234 const Generator& rK, 00235 Generator& rResult); 00236 00237 /** 00238 * SupNormAlt: Alternative implementation of SupNorm(). 00239 * using SupPrefixClosed() instead of concatenating Sigma*. 00240 * SupNormAlt calculates the supremal sublanguage 00241 * of the closed language K (language generated by rK) that 00242 * is normal w.r.t. the closed language L (language generated 00243 * by rL) and the set of observable events: 00244 * SupNormClosedAlt(K)wrt(L)=SupClosed(K-Pinv[P(L-K)]) 00245 * 00246 * SupNormAlt returns false on empty result. 00247 * todo: implement test routines, verify correctness 00248 * todo: check for efficient algorithm replacing above formula 00249 * 00250 * @param rL 00251 * generates the closed language L=L(rL) 00252 * @param rOAlph 00253 * observable alphabet 00254 * @param rK 00255 * generates the closed language K=L(rK) 00256 * @param rResult 00257 * generates the supremal normal and closed 00258 * sublanguage, where Lm(rResult) is intersection of L(rResult) and Lm(rL) 00259 * (marking consistent to rL) 00260 * 00261 * @return 00262 * true for nonempty result 00263 * 00264 * @exception Exception 00265 * - Alphabets of generators don't match (id 500) 00266 * - rOAlph not subset of rL.Alphabet() (id 506) 00267 * - K is not subset of L. (id 0) 00268 * 00269 * 00270 */ 00271 bool SupNormAlt( 00272 Generator& rL, 00273 const EventSet& rOAlph, 00274 const Generator& rK, 00275 Generator& rResult); 00276 00277 /** rti wrapper (caution: args swap) */ 00278 void SupNorm( 00279 const vGenerator& rPlantGen, 00280 const EventSet& rOAlph, 00281 const vGenerator& rSpecGen, 00282 vGenerator& rResGen); 00283 00284 /** rti wrapper (caution: args swap) */ 00285 void SupNorm( 00286 const cGenerator& rPlantGen, 00287 const vGenerator& rSpecGen, 00288 vGenerator& rResGen); 00289 00290 00291 } // end namespace 00292 #endif |
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6