mtc_obserververification.cpp
Go to the documentation of this file.
1 /** @file mtc_obserververification.cpp
2 
3 Methods to verify the obsrver condition for natural projections.
4 The observer condition is, e.g., defined in
5 K. C. Wong and W. M. Wonham, “Hierarchical control of discrete-event
6 systems,” Discrete Event Dynamic Systems: Theory and Applications, 1996.
7 In addition, methods to verify output control consistency (OCC) and
8 local control consistency (LCC) are provided. See for example
9 K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
10 Control Approaches for Discrete Event Systems," Workshop on Discrete Event Systems, 2008.
11 */
12 
13 /* FAU Discrete Event Systems Library (libfaudes)
14 
15  Copyright (C) 2006 Bernd Opitz
16  Exclusive copyright is granted to Klaus Schmidt
17 
18  This library is free software; you can redistribute it and/or
19  modify it under the terms of the GNU Lesser General Public
20  License as published by the Free Software Foundation; either
21  version 2.1 of the License, or (at your option) any later version.
22 
23  This library is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26  Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public
29  License along with this library; if not, write to the Free Software
30  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
31 
34 #include "corefaudes.h"
35 
36 
37 namespace faudes {
38 
39 bool IsMtcObs(const MtcSystem& rLowGen, const EventSet& rHighAlph){
40  OP_DF("IsMtcObs(" << rLowGen.Name() << "," << rHighAlph.Name() << ")");
41  // Initialization of variables
42  EventSet newHighAlph = rHighAlph;
43  EventSet controllableEvents;
44  std::map<Transition,Idx> mapChangedTrans;
45  Generator genDyn(rLowGen);
46  std::map<Transition,Transition> mapChangedTransReverse;
47  std::map<Idx,Idx> mapStateToPartition;
48  std::map<Idx, EventSet> mapRelabeledEvents;
49  bool observer;
50  // One step of the observer algorithm: A dynamic system is computed that fulfills the one-step observer condition.
51  // if the result is equal to the original generator, then the natural projection on the high-level alphabet fulfills the observer property
52  calculateDynamicSystemObs(rLowGen, newHighAlph, genDyn);
53  Generator genPart;
54  // compute coarsest quasi-congruence on the dynamic system
55  ComputeBisimulation(genDyn, mapStateToPartition, genPart);
56  // check if quotient automaton is deterministic and free of unobservable events
57  // and relabel transitions in rLowGen if necessary. The high-level alphabet is modified accordingly
58  Generator genObs(rLowGen);
59  observer=relabel(genObs, controllableEvents, newHighAlph, mapStateToPartition, mapChangedTransReverse, mapChangedTrans, mapRelabeledEvents);
60  // return the result of the relabeling
61  return observer;
62 
63 }
64 
65 
66 }// namespace faudes
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
Allows to create colored marking generators (CMGs) as the common five tupel consisting of alphabet,...
Definition: mtc_generator.h:53
Base class of all FAUDES generators.
void Name(const std::string &rName)
Set the generator's name.
Includes all libFAUDES headers, no plugins.
const std::string & Name(void) const
Return name of TBaseSet.
Definition: cfl_baseset.h:1755
void ComputeBisimulation(const Generator &rGenOrig, map< Idx, Idx > &rMapStateToPartition)
Computation of the coarsest bisimulation relation for a specified generator.
Methods to verify the obsrver condition for natural projections.
libFAUDES resides within the namespace faudes.
bool IsMtcObs(const MtcSystem &rLowGen, const EventSet &rHighAlph)
Verification of the observer property.
bool relabel(Generator &rGenRelabel, EventSet &rControllableEvents, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition, map< Transition, Transition > &rMapChangedTransReverse, map< Transition, Idx > &rMapChangedTrans, map< Idx, EventSet > &rMapRelabeledEvents)
Relabeling algorithm for the computation of an Lm-observer.
void calculateDynamicSystemObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
Computation of the dynamic system for Delta_obs (local reachability of a marked state).
#define OP_DF(expr)
Definition: op_debug.h:31

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen