mtc_obserververification.cpp

Go to the documentation of this file.
00001 /** @file mtc_obserververification.cpp 
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 "mtc_obserververification.h"
00033 #include "mtc_observercomputation.h"
00034 #include "corefaudes.h"
00035 
00036 
00037 namespace faudes {
00038 
00039 bool IsMtcObs(const MtcSystem& rLowGen, const EventSet& rHighAlph){
00040   OP_DF("IsMtcObs(" << rLowGen.Name() << "," << rHighAlph.Name() << ")");
00041   // Initialization of variables
00042   EventSet newHighAlph = rHighAlph;
00043   EventSet controllableEvents;
00044   std::map<Transition,Idx> mapChangedTrans;
00045   Generator genDyn(rLowGen);
00046   std::map<Transition,Transition> mapChangedTransReverse;
00047   std::vector<Idx> newPartitions;
00048   std::map<Idx,Idx> mapStateToPartition;
00049   std::map<Idx, EventSet> mapRelabeledEvents;
00050   bool observer;
00051   // One step of the observer algorithm: A dynamic system is computed that fulfills the one-step observer condition. 
00052   // if the result is equal to the original generator, then the natural projection on the high-level alphabet fulfills the observer property
00053   calculateDynamicSystemObs(rLowGen, newHighAlph, genDyn);
00054   Generator genPart;
00055   // compute coarsest quasi-congruence on the dynamic system
00056   calcBisimulation(genDyn, mapStateToPartition, genPart, newPartitions);
00057   // check if quotient automaton is deterministic and free of unobservable events
00058   // and relabel transitions in rLowGen if necessary. The high-level alphabet is modified accordingly
00059   Generator genObs(rLowGen);
00060   observer=relabel(genObs, controllableEvents, newHighAlph, newPartitions, mapStateToPartition, mapChangedTransReverse,  mapChangedTrans, mapRelabeledEvents);
00061   // return the result of the relabeling 
00062   return observer;
00063 
00064 }
00065 
00066 
00067 }// namespace faudes

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen