mtc_obserververification.cpp
Go to the documentation of this file.
1/** @file mtc_obserververification.cpp
2
3Methods to verify the obsrver condition for natural projections.
4The observer condition is, e.g., defined in
5K. C. Wong and W. M. Wonham, “Hierarchical control of discrete-event
6systems,” Discrete Event Dynamic Systems: Theory and Applications, 1996.
7In addition, methods to verify output control consistency (OCC) and
8local control consistency (LCC) are provided. See for example
9K. Schmidt and C. Breindl, "On Maximal Permissiveness of Hierarchical and Modular Supervisory
10Control 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
37namespace faudes {
38
39bool 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
const std::string & Name(void) const
void ComputeBisimulation(const Generator &rGenOrig, map< Idx, Idx > &rMapStateToPartition)
bool IsMtcObs(const MtcSystem &rLowGen, const EventSet &rHighAlph)
bool relabel(Generator &rGenRelabel, EventSet &rControllableEvents, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition, map< Transition, Transition > &rMapChangedTransReverse, map< Transition, Idx > &rMapChangedTrans, map< Idx, EventSet > &rMapRelabeledEvents)
void calculateDynamicSystemObs(const Generator &rGen, EventSet &rHighAlph, Generator &rGenDyn)
#define OP_DF(expr)
Definition op_debug.h:31

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen