cfl_statemin.h
Go to the documentation of this file.
1 /** @file cfl_statemin.h state space minimization */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2006 Bernd Opitz
6  Exclusive copyright is granted to Klaus Schmidt
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
21 
22 
23 #ifndef FAUDES_STATEMIN_H
24 
25 #include "cfl_definitions.h"
26 #include "cfl_agenerator.h"
27 #include <vector>
28 #include <string>
29 #include <sstream>
30 
31 namespace faudes {
32 
33 /**
34  * State set minimization.
35  * Constructs a generator with minimal stateset while preserving the generated und marked languages.
36  * This function implements the (n*log n) set partitioning algorithm by
37  * John E. Hopcroft. The algorithm expects an accessible input generator. To have a const
38  * interface, the argument is copied. See also StateMin(Generator&,Generator&).
39  *
40  * @param rGen
41  * Generator
42  * @param rResGen
43  * Minimized generator (result)
44  *
45  * @exception Exception
46  * Input automaton nondeterministic (id 101)
47  *
48  * <h4>Example:</h4>
49  * <table>
50  * <tr> <td> Generator G </td> <td> StateMin(G,Result) </td> </tr>
51  * <tr>
52  * <td> @image html tmp_minimal_nonmin.png </td>
53  * <td> @image html tmp_minimal_min.png </td>
54  * </tr>
55  * </table>
56  *
57  * @ingroup GeneratorFunctions
58  */
59 void StateMin(const Generator& rGen, Generator& rResGen);
60 
61 /**
62  * State set minimization.
63  *
64  * See also StateMin(const Generator&, Generator&).
65  * This version maintains event attributes provided
66  * they can be casted to the result type.
67  *
68  * @param rGen
69  * Generator
70  * @param rResGen
71  * Minimized generator (result)
72  *
73  * @exception Exception
74  * Input automaton nondeterministic (id 101)
75  *
76  * @ingroup GeneratorFunctions
77  */
78 void aStateMin(const Generator& rGen, Generator& rResGen);
79 
80 /**
81  * State set minimization.
82  *
83  * See also StateMin(const Generator&, Generator&).
84  * This version maintains event attributes provided
85  * they can be casted to the result type.
86  *
87  * @param rGen
88  * Generator
89  *
90  * @exception Exception
91  * Input automaton nondeterministic (id 101)
92  *
93  * @ingroup GeneratorFunctions
94  */
95 void aStateMin(Generator& rGen);
96 
97 /**
98  * State set minimization.
99  * This function implements the (n*log n) set partitioning algorithm by
100  * John E. Hopcroft. Given generator will be made accessible before computing
101  * minimized generator.
102  * See also StateMin(Generator&,Generator&).
103  *
104  * @param rGen
105  * Generator
106  * @param rResGen
107  * Minimized generator (result)
108  * @param rSubsets
109  * Vector of subsets that will be constructed during running the algorithm
110  * (optional parameter)
111  * @param rNewIndices
112  * Vector of new state indices corresponding to the subsets
113  * (optional parameter)
114  *
115  * @exception Exception
116  * Input automaton nondeterministic (id 101)
117  */
118 void StateMin(const Generator& rGen, Generator& rResGen,
119  std::vector< StateSet >& rSubsets, std::vector<Idx>& rNewIndices);
120 
121 } // namespace faudes
122 
123 #define FAUDES_STATEMIN_H
124 #endif

libFAUDES 2.26g --- 2015.08.17 --- c++ api documentaion by doxygen