op_obserververification.hGo to the documentation of this file.00001 /** @file op_obserververification.h 00002 00003 Methods to verify the obsrver condition for natural projections. 00004 The observer condition is, e.g., defined in 00005 K. C. Wong and W. M. Wonham, “Hierarchical control of discrete-event 00006 systems,” Discrete Event Dynamic Systems: Theory and Applications, 1996. 00007 In addition, methods to verify output control consistency (OCC) and 00008 local control consistency (LCC) are provided. See for example 00009 K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory 00010 Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008. 00011 */ 00012 00013 /* FAU Discrete Event Systems Library (libfaudes) 00014 00015 Copyright (C) 2006 Bernd Opitz 00016 Exclusive copyright is granted to Klaus Schmidt 00017 00018 This library is free software; you can redistribute it and/or 00019 modify it under the terms of the GNU Lesser General Public 00020 License as published by the Free Software Foundation; either 00021 version 2.1 of the License, or (at your option) any later version. 00022 00023 This library is distributed in the hope that it will be useful, 00024 but WITHOUT ANY WARRANTY; without even the implied warranty of 00025 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00026 Lesser General Public License for more details. 00027 00028 You should have received a copy of the GNU Lesser General Public 00029 License along with this library; if not, write to the Free Software 00030 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00031 00032 #include "corefaudes.h" 00033 #include "op_debug.h" 00034 #include "op_observercomputation.h" 00035 #include <map> 00036 #include <vector> 00037 #include <stack> 00038 00039 00040 #ifndef FAUDES_OP_OBSERVERVERIFICATION_H 00041 #define FAUDES_OP_OBSERVERVERIFICATION_H 00042 00043 namespace faudes { 00044 00045 00046 /** 00047 * Verification of the natural observer property. 00048 * For verifying if a natural projection has the observer property, one step in the observer 00049 * algorithm is evaluated. If the resulting generator equals the input generator, then the 00050 * natural projection on the abstraction alphabet is an observer. 00051 * 00052 * @param rLowGen 00053 * Input generator 00054 * @param rHighAlph 00055 * High level alphabet 00056 * 00057 * @return 00058 * true if the observer property holds 00059 * 00060 * @ingroup ObserverPlugin 00061 * 00062 */ 00063 bool IsObs(const Generator& rLowGen, const EventSet& rHighAlph); 00064 00065 00066 /** 00067 * Verification of the MSA observer property. 00068 * For verifying if a natural projection has the marked string accepting 00069 * observer property, one step in the MSA observer 00070 * algorithm is evaluated. If the resulting generator equals the input generator, then the 00071 * natural projection on the abstraction alphabet is an MSA observer. 00072 * 00073 * @param rLowGen 00074 * Input generator 00075 * @param rHighAlph 00076 * High level alphabet 00077 * 00078 * @return 00079 * true if the MSA observer property holds 00080 * 00081 * @ingroup ObserverPlugin 00082 * 00083 */ 00084 bool IsMSA(const Generator& rLowGen, const EventSet& rHighAlph); 00085 00086 00087 /** 00088 * Verification of output control consistency (OCC). 00089 * For verifying if a natural projection fulfills the output control consistency condition, 00090 * a backward reachability is conducted. If starting from a state, where an uncontrollable 00091 * high-level event is feasible, a controllable event can be reached on a local backward path, 00092 * OCC is violated. 00093 * 00094 * @param rLowGen 00095 * Input System 00096 * @param rHighAlph 00097 * High level alphabet 00098 * 00099 * @return 00100 * true if OCC holds 00101 * 00102 * @ingroup ObserverPlugin 00103 * 00104 */ 00105 bool IsOCC(const System& rLowGen, const EventSet& rHighAlph); 00106 00107 /** 00108 * Verification of output control consistency (OCC). 00109 * For verifying if a natural projection fulfills the output control consistency condition, 00110 * a backward reachability is conducted. If starting from a state, where an uncontrollable 00111 * high-level event is feasible, a controllable event can be reached on a local backward path, 00112 * OCC is violated. 00113 * 00114 * @param rLowGen 00115 * Input generator 00116 * @param rControllableEvents 00117 * set of controllable events 00118 * @param rHighAlph 00119 * High level alphabet 00120 * 00121 * @return 00122 * true if OCC holds 00123 * 00124 */ 00125 bool IsOCC(const Generator& rLowGen, const EventSet& rControllableEvents, const EventSet& rHighAlph); 00126 00127 /** 00128 * Function that supports the verification of output control consistency (OCC). 00129 * This function performs a backward reachability to find if an uncontrollable 00130 * high-level event is preemted by an uncontrollable low-level event. If this is 00131 * the case, OCC is violated. 00132 * 00133 * @param rLowGen 00134 * Input generator 00135 * @param rControllableEvents 00136 * set of controllable events 00137 * @param rHighAlph 00138 * High level alphabet 00139 * @param currentState 00140 * start state for backward reachability 00141 * 00142 * @return 00143 * true if no controllable low-level event has been found 00144 * 00145 */ 00146 bool backwardVerificationOCC(const Generator& rLowGen, const EventSet& rControllableEvents, const EventSet& rHighAlph, Idx currentState); 00147 00148 /** 00149 * Verification of local control consistency (LCC). 00150 * For verifying if a natural projection fulfills the local control consistency condition, 00151 * a backward reachability is conducted. If starting from a state, where an uncontrollable 00152 * high-level event is feasible, at least one local state cannot be reached by an uncontrollable path, LCC is violated. 00153 * 00154 * @param rLowGen 00155 * Input System 00156 * @param rHighAlph 00157 * High level alphabet 00158 * 00159 * @return 00160 * true if LCC holds 00161 * 00162 * @ingroup ObserverPlugin 00163 * 00164 */ 00165 bool IsLCC(const System& rLowGen, const EventSet& rHighAlph); 00166 00167 /** 00168 * Verification of local control consistency (LCC). 00169 * For verifying if a natural projection fulfills the local control consistency condition, 00170 * a backward reachability is conducted. If starting from a state, where an uncontrollable 00171 * high-level event is feasible, at least one local state cannot be reached by an uncontrollable path, LCC is violated. 00172 * 00173 * @param rLowGen 00174 * Input generator 00175 * @param rControllableEvents 00176 * set of controllable events 00177 * @param rHighAlph 00178 * High level alphabet 00179 * 00180 * @return 00181 * true if LCC holds 00182 * 00183 */ 00184 bool IsLCC(const Generator& rLowGen, const EventSet& rControllableEvents, const EventSet& rHighAlph); 00185 00186 /** 00187 * Function that supports the verification of local control consistency (LCC). 00188 * This function performs a recursive backward reachability to find if from a state where 00189 * an uncontrollable high-level event is possible, another state is only reachable 00190 * by local strings that contaion at least one controllable event. If this is 00191 * the case, LCC is violated. 00192 * 00193 * @param rTransSetX2EvX1 00194 * reverse transition relation of the input generator 00195 * @param rControllableEvents 00196 * set of controllable events 00197 * @param rHighAlph 00198 * High level alphabet 00199 * @param exitState 00200 * start state for backward reachability 00201 * @param currentState 00202 * current state for backward reachability 00203 * @param controllablePath 00204 * false if at least one uncontrollable path to the currentState exists 00205 * @param rLocalStatesMap 00206 * map for states and their controllability property 00207 * @param rDoneStates 00208 * states that have already been visited 00209 * 00210 */ 00211 void backwardVerificationLCC(const TransSetX2EvX1& rTransSetX2EvX1, const EventSet& rControllableEvents, const EventSet& rHighAlph, Idx exitState, Idx currentState, bool controllablePath, std::map<Idx, bool>& rLocalStatesMap, StateSet& rDoneStates); 00212 00213 00214 00215 00216 00217 } // namespace faudes 00218 00219 00220 00221 #endif 00222 libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen |