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 #define FAUDES_STATEMIN_H
25 
26 #include "cfl_definitions.h"
27 #include "cfl_agenerator.h"
28 #include <vector>
29 #include <string>
30 #include <sstream>
31 
32 namespace faudes {
33 
34 /**
35  * State set minimization.
36  * Constructs a generator with minimal stateset while preserving the generated und marked languages.
37  * This function implements the (n*log n) set partitioning algorithm by
38  * John E. Hopcroft. The algorithm expects an accessible input generator. To have a const
39  * interface, the argument is copied. See also StateMin(Generator&,Generator&).
40  *
41  * @param rGen
42  * Generator
43  * @param rResGen
44  * Minimized generator (result)
45  *
46  * @exception Exception
47  * Input automaton nondeterministic (id 101)
48  *
49  * <h4>Example:</h4>
50  * <table>
51  * <tr> <td> Generator G </td> <td> StateMin(G,Result) </td> </tr>
52  * <tr>
53  * <td> @image html tmp_minimal_nonmin.png </td>
54  * <td> @image html tmp_minimal_min.png </td>
55  * </tr>
56  * </table>
57  *
58  * @ingroup GeneratorFunctions
59  */
60 extern FAUDES_API void StateMin(const Generator& rGen, Generator& rResGen);
61 
62 /**
63  * State set minimization.
64  *
65  * See also StateMin(const Generator&, Generator&).
66  * This version maintains event attributes provided
67  * they can be casted to the result type.
68  *
69  * @param rGen
70  * Generator
71  * @param rResGen
72  * Minimized generator (result)
73  *
74  * @exception Exception
75  * Input automaton nondeterministic (id 101)
76  *
77  * @ingroup GeneratorFunctions
78  */
79 extern FAUDES_API void aStateMin(const Generator& rGen, Generator& rResGen);
80 
81 /**
82  * State set minimization.
83  *
84  * See also StateMin(const Generator&, Generator&).
85  * This version maintains event attributes provided
86  * they can be casted to the result type.
87  *
88  * @param rGen
89  * Generator
90  *
91  * @exception Exception
92  * Input automaton nondeterministic (id 101)
93  *
94  * @ingroup GeneratorFunctions
95  */
96 extern FAUDES_API void aStateMin(Generator& rGen);
97 
98 /**
99  * State set minimization.
100  * This function implements the (n*log n) set partitioning algorithm by
101  * John E. Hopcroft. Given generator will be made accessible before computing
102  * minimized generator.
103  * See also StateMin(Generator&,Generator&).
104  *
105  * @param rGen
106  * Generator
107  * @param rResGen
108  * Minimized generator (result)
109  * @param rSubsets
110  * Vector of subsets that will be constructed during running the algorithm
111  * (optional parameter)
112  * @param rNewIndices
113  * Vector of new state indices corresponding to the subsets
114  * (optional parameter)
115  *
116  * @exception Exception
117  * Input automaton nondeterministic (id 101)
118  */
119 extern FAUDES_API void StateMin(const Generator& rGen, Generator& rResGen,
120  std::vector< StateSet >& rSubsets, std::vector<Idx>& rNewIndices);
121 
122 } // namespace faudes
123 
124 #endif
Attributed generator class TaGenerator.
Compiletime options.
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:80
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
void StateMin(const Generator &rGen, Generator &rResGen)
State set minimization.
void aStateMin(const Generator &rGen, Generator &rResGen)
State set minimization.
libFAUDES resides within the namespace faudes.

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen