syn_supreduce.h

Go to the documentation of this file.
00001 /** @file syn_reduced.h Supervisor Reduction */
00002 
00003 /* FAU Discrete Event Systems Library (libfaudes)
00004 
00005    Copyright (C) 2006  Bernd Opitz
00006    Copyright (C) 2007  Thomas Moor
00007    Exclusive copyright is granted to Klaus Schmidt
00008 
00009    This library is free software; you can redistribute it and/or
00010    modify it under the terms of the GNU Lesser General Public
00011    License as published by the Free Software Foundation; either
00012    version 2.1 of the License, or (at your option) any later version.
00013 
00014    This library is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017    Lesser General Public License for more details.
00018 
00019    You should have received a copy of the GNU Lesser General Public
00020    License along with this library; if not, write to the Free Software
00021    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00022 
00023 #ifndef FAUDES_SUPREDUCE_H
00024 #define FAUDES_SUPREDUCE_H
00025 
00026 #include "corefaudes.h"
00027 
00028 namespace faudes {
00029   
00030  /** 
00031   * Data structure for identifying states in the same coset for supervisor reduction
00032   */
00033 struct ReductionStateInfo{
00034     StateSet mPlantStates;
00035     EventSet mEnabledEvents;
00036     EventSet mDisabledEvents;
00037     bool mMarkedState;
00038     bool mPlantMarked;
00039 };
00040 
00041 /**
00042  * Supervisor Reduction algorithm
00043  *
00044  * Computes a reduced supervisor from a given potentially non-reduced supervisor and the plant. 
00045  * This algorithm implements the results obtained in 
00046  *
00047  * R. Su and W. M. Wonham. Supervisor Reduction for Discrete-Event Systems.
00048  * Discrete Event Dynamic Systems vol. 14, no. 1, January 2004.
00049  *
00050  * Both, plant and supervisor MUST be deterministic and share the same alphabet!!!
00051  *
00052  * @param rPlantGen
00053  *   Plant generator
00054  * @param rSupGen
00055  *   Supervisor generator
00056  * @param rReducedSup
00057  *   Reduced supervisor generator
00058  *
00059  * @return
00060  *   True if a reduction was achieved
00061  *
00062  * @exception Exception
00063  *   - alphabets of generators don't match (id 100)
00064  *   - plant nondeterministic (id 201)
00065  *   - supervisor nondeterministic (id 203)
00066  *   - plant and supervisor nondeterministic (id 204)
00067  *
00068  * @ingroup SynthesisPlugIn
00069  */
00070 bool SupReduce(const System& rPlantGen, const System& rSupGen, System& rReducedSup);
00071 
00072 
00073 /**
00074  * Supervisor Reduction mergibility algorithm
00075  *
00076  * This recursive algorithm determines if two supervisor states can be merged to the same coset. 
00077  * It is called by the main procedure SupReduce. 
00078  *
00079  * @param stateI
00080  *   First state to be checked
00081  * @param stateJ
00082  *   second state to be checked
00083  * @param rWaitList
00084  *   list of waiting state pairs
00085  * @param cNode
00086  *   remembers first state to be checked
00087  * @param rSupGen
00088  *   constant reference to supervisor 
00089  * @param rSupStateInfo
00090  *   constant reference to state info data structure
00091  * @param rState2Class
00092  *   constant reference to data structure that maps states to their coset
00093  * @param rClass2State
00094  *   constant reference to data structure that maps cosets to their states
00095  *
00096  * @return
00097  *   True if the classes of statep and stateq can be merged
00098  *
00099  */
00100 bool CheckMergibility(Idx stateI, Idx stateJ, std::vector<std::set<Idx> >& rWaitList, Idx cNode, const System& rSupGen,
00101        const std::map<Idx,ReductionStateInfo>& rSupStateInfo, const std::map<Idx,Idx>& rState2Class, const std::vector<StateSet>& rClass2States);
00102        
00103 
00104 } // namespace faudes
00105 
00106 #endif 

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