syn_functions.hGo to the documentation of this file.00001 /** @file syn_functions.h Misc functions related to synthesis */ 00002 00003 /* FAU Discrete Event Systems Library (libfaudes) 00004 00005 Copyright (C) 2010 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_SYN_FUNCTIONS_H 00023 #define FAUDES_SYN_FUNCTIONS_H 00024 00025 #include "corefaudes.h" 00026 00027 namespace faudes { 00028 00029 00030 00031 /** 00032 * Test for relative marking. 00033 * 00034 * Tests whether the language Lm(GCand) is relatively marked w.r.t. 00035 * the language Lm(GPlant). The formal definition of this property 00036 * requires 00037 * 00038 * closure(Lm(GCand)) ^ Lm(GPlant) <= Lm(GCand). 00039 * 00040 * The implementation tests 00041 * 00042 * L(GCand) ^ Lm(GPlant) <= Lm(GCand) 00043 * 00044 * by first performing the product composition and then inspecting 00045 * the marking to require 00046 * 00047 * ( forall accessible (qPlant,qCand) ) [ qPlant in QPlant_m implies qCand in QCand_m ]. 00048 * 00049 * In general, the test is only sufficient. 00050 * Provided the arguments are trim and deterministic, the test 00051 * is sufficient and necessary. 00052 * 00053 * @param rGenPlant 00054 * Generator GPlant 00055 * @param rGenCand 00056 * Generator GCand 00057 * 00058 * 00059 * @exception Exception 00060 * - alphabets of generators don't match (id 100) 00061 * - arguments are not trim (id 201, only if FAUDES_CHECKED is set) 00062 * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set) 00063 * 00064 * @return 00065 * true / false 00066 * 00067 * @ingroup SynthesisPlugIn 00068 */ 00069 bool IsRelativelyMarked(const Generator& rGenPlant, const Generator& rGenCand); 00070 00071 00072 /** 00073 * Test for relative prefix-closedness. 00074 * 00075 * Tests whether the language Lm(GCand) is relatively closed w.r.t. 00076 * the language Lm(GPant). The formal definition of this property 00077 * requires 00078 * 00079 * closure(Lm(GCand)) ^ Lm(GPlant) = Lm(GCand). 00080 * 00081 * The implementation tests 00082 * 00083 * L(GCand) ^ Lm(GPland) = Lm(GCand) 00084 * 00085 * by performing the product composition and by testing 00086 * 00087 * - for L(GCand) subseteq L(GPlant), and 00088 * - ( forall accessible (qPland,qCand) ) [ qPlant in QPlant_m if and only if qCand in QCand_m ]. 00089 * 00090 * In general, the test is only sufficient. 00091 * Provided the arguments are trim and deterministic, the test 00092 * is sufficient and necessary. 00093 * 00094 * @param rGenPlant 00095 * Generator GPlant 00096 * @param rGenCand 00097 * Generator GCand 00098 * 00099 * @exception Exception 00100 * - alphabets of generators don't match (id 100) 00101 * - arguments are not trim (id 201, only if FAUDES_CHECKED is set) 00102 * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set) 00103 * 00104 * @return 00105 * true / false 00106 * 00107 * @ingroup SynthesisPlugIn 00108 */ 00109 bool IsRelativelyPrefixClosed(const Generator& rGenPlant, const Generator& rGenCand); 00110 00111 /** 00112 * Supremal Relatively Closed Sublanguage 00113 * 00114 * Computes the supremal sublanguage of the specification E that is relatively closed 00115 * w.r.t. the plant G. The result is given as a trim deterministic generator that 00116 * may be used as a specification for a subsequent controller design via SupConNB. 00117 * 00118 * The implementation removes states from the product GxE that conflict with 00119 * relative closedness. From the known formula supR(E)= (L^E) - (L-E)Sigma*, we know that 00120 * the supremal sublanguage can be realized as a subautomaton of GxE. Thus, we conclude 00121 * that our implementation indeed returns the supremum. 00122 * 00123 * Parameter restrictions: both generators must be deterministic and 00124 * have the same alphabet. 00125 * 00126 * 00127 * @param rPlantGen 00128 * Plant G 00129 * @param rSpecGen 00130 * Specification Generator E 00131 * @param rResGen 00132 * Reference to resulting Generator 00133 * 00134 * @exception Exception 00135 * - alphabets of generators don't match (id 100) 00136 * - plant nondeterministic (id 201) 00137 * - spec nondeterministic (id 203) 00138 * - plant and spec nondeterministic (id 204) 00139 * 00140 * @ingroup SynthesisPlugIn 00141 * 00142 */ 00143 void SupRelativelyPrefixClosed( 00144 const Generator& rPlantGen, 00145 const Generator& rSpecGen, 00146 Generator& rResGen); 00147 00148 00149 /** 00150 * Supremal Relatively Closed Sublanguage (internal function) 00151 * 00152 * 00153 * This version of SupRelativelyPrefixClosed performs no consistency test of the given parameter. 00154 * It set's up a "composition map" as in the parallel composition, however, 00155 * the map may still contain states that have been removed from the result 00156 * to obtain controllability. 00157 * 00158 * Parameter restrictions: both generators must be deterministic and 00159 * have the same alphabet. 00160 * 00161 * 00162 * @param rPlantGen 00163 * Plant G 00164 * @param rSpecGen 00165 * Specification Generator E 00166 * @param rResGen 00167 * Reference to resulting Generator, 00168 * 00169 */ 00170 void SupRelativelyPrefixClosedUnchecked( 00171 const Generator& rPlantGen, 00172 const Generator& rSpecGen, 00173 std::map< std::pair<Idx,Idx>,Idx >& rCompositionMap, 00174 Generator& rResGen); 00175 00176 00177 /** 00178 * Test for relative marking, omega langauges. 00179 * 00180 * Tests whether the omega language Bm(GCand) 00181 * is relatively marked w.r.t. 00182 * the omega language Bm(GPlant). The formal definition of this property 00183 * requires 00184 * 00185 * closure(Bm(GCand)) ^ Bm(GPlant) <= Bm(GCand). 00186 * 00187 * The implementation first performs the product composition 00188 * of the two generators with product state space QPlant x QCand and 00189 * generated language L(GPlant x GCand) = L(Plant) ^ L(Cand). It then investigates 00190 * all SCCs that do not 00191 * contain a state that corresponds to GCand-marking. If and only if 00192 * none of the considered SCCs has a GPlant marking, the function 00193 * returns true. 00194 * 00195 * The arguments GCand and GPlant are required to be deterministic and omega trim. 00196 * 00197 * @param rGenPlant 00198 * Generator GPlant 00199 * @param rGenCand 00200 * Generator GCand 00201 * 00202 * @exception Exception 00203 * - alphabets of generators don't match (id 100) 00204 * - arguments are not omega-trim (id 201, only if FAUDES_CHECKED is set) 00205 * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set) 00206 * 00207 * 00208 * @return 00209 * true / false 00210 * 00211 * @ingroup SynthesisPlugIn 00212 */ 00213 bool IsRelativelyOmegaMarked(const Generator& rGenPlant, const Generator& rGenCand); 00214 00215 /** 00216 * Test for relative closedness, omega languages. 00217 * 00218 * Tests whether the omega language Bm(GCand) 00219 * is relatively closed w.r.t. 00220 * the omega language Bm(GPlant). The formal definition of this property 00221 * requires 00222 * 00223 * closure(Bm(GCand)) ^ Bm(GPlant) = Bm(GCand). 00224 * 00225 * 00226 * The implementation first performs the product composition 00227 * of the two generators with product state space QPlant x QCand and 00228 * generated language L(GPlant x GCand) = L(GPlant) ^ L(GCand). It uses the composition 00229 * to test the follwing three conditions: 00230 * - L(GCand) subseteq L(GPlant); 00231 * - no SCC of GPlant x GCand without GCand-marking contains a state with GPlant-marking; and 00232 * - no SCC of GPlant x GCand without GPlant-marking contains a state with GCand-marking. 00233 * If and only if all three tests are passed, the function 00234 * returns true. 00235 * 00236 * The arguments GCand and GPlant are required to be deterministic and omega trim. 00237 * 00238 * @param rGenPlant 00239 * Generator GPlant 00240 * @param rGenCand 00241 * Generator GCand 00242 * 00243 * 00244 * @exception Exception 00245 * - alphabets of generators don't match (id 100) 00246 * - arguments are not omega trim (id 201, only if FAUDES_CHECKED is set) 00247 * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set) 00248 * 00249 * 00250 * @return 00251 * true / false 00252 * 00253 * @ingroup SynthesisPlugIn 00254 */ 00255 bool IsRelativelyOmegaClosed(const Generator& rGenPlant, const Generator& rGenCand); 00256 00257 /** 00258 * Test for relative closedness, omega languages. 00259 * 00260 * This variant does not perform consitency tests on the parameters. Neither 00261 * does it handle the special cases on empty arguments. 00262 * See also IsRelativelyOmegaClosed(const Generator&, const Generator& ) 00263 * 00264 * @param rGenPlant 00265 * Generator GPlant 00266 * @param rGenCand 00267 * Generator GCand 00268 * 00269 */ 00270 bool IsRelativelyOmegaClosedUnchecked(const Generator& rGenPlant, const Generator& rGenCand); 00271 00272 00273 00274 00275 00276 } // namespace faudes 00277 00278 #endif 00279 00280 libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen |