cfl_bisimcta.h
Go to the documentation of this file.
1 /** @file cfl_bisimcta.h Bisimulation relations
2 
3  Functions to compute bisimulation relations on dynamic systems (represented
4  by non-deterministic finite automata).
5 
6  More specifically, we we implement algorithms to obtain ordinary/delayed/weak
7  bisimulations partitions based on change-tracking. In large, these implementations
8  are expected to perform better than the classical variants found in cfl_bisimulation.h".
9 
10  This code was originally developed by Yiheng Tang in the context of compositional
11  verification in 2020/21.
12 
13 **/
14 
15 /* FAU Discrete Event Systems Library (libfaudes)
16 
17  Copyright (C) 2020,23, Yiheng Tang
18  Copyright (C) 2021 Thomas Moor
19  Exclusive copyright is granted to Klaus Schmidt
20 
21  This library is free software; you can redistribute it and/or
22  modify it under the terms of the GNU Lesser General Public
23  License as published by the Free Software Foundation; either
24  version 2.1 of the License, or (at your option) any later version.
25 
26  This library is distributed in the hope that it will be useful,
27  but WITHOUT ANY WARRANTY; without even the implied warranty of
28  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29  Lesser General Public License for more details.
30 
31  You should have received a copy of the GNU Lesser General Public
32  License along with this library; if not, write to the Free Software
33  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
34 
35 
36 
37 #ifndef FAUDES_CFL_BISIMCTA_H
38 #define FAUDES_CFL_BISIMCTA_H
39 
40 #include "cfl_definitions.h"
41 #include "cfl_generator.h"
42 #include "cfl_nameset.h"
43 #include "cfl_indexset.h"
44 
45 #include <vector>
46 #include <map>
47 #include <list>
48 
49 
50 namespace faudes {
51 
52 
53 /*!
54  * \brief FactorTauLoops
55  * merge silent loop and then remove silent self loops
56  * \param rGen
57  * input generator
58  * \param rSilent
59  * silent event
60  */
61 extern FAUDES_API void FactorTauLoops(Generator &rGen, const Idx &rSilent);
62 
63 
64 /*!
65  * \brief ExtendTransRel
66  * perform transition saturation w.r.t. silent evs. Two different saturation modes are set depending on flag value
67  * \param rGen
68  * input gen
69  * \param rSilent
70  * silent event set (contains either 0 or 1 event)
71  * \param rFlag
72  * flag for saturation mode -- rFlag == 1: delayed transition (half-saturated); rFlag == 2: observed transition (full-saturated)
73  */
74 extern FAUDES_API void ExtendTransRel(Generator &rGen, const EventSet& rSilent, const Idx& rFlag);
75 
76 
77 /*!
78  * \brief InstallSelfloops
79  * install selfloops on all states of given event set. intended to install silent event selfloops for saturation
80  * \param rGen
81  * input gen
82  * \param rEvs
83  * events which will be installed as selfloops
84  */
85 extern FAUDES_API void InstallSelfloops(Generator &rGen, const EventSet& rEvs);
86 
87 
88 
89 /*!
90  * \brief ComputeBisimulationCTA
91  * basic bisimulation partition algorithm based on change-tracking algorithm
92  * \param rGen
93  * input gen
94  * \param rResult
95  * state partition without trivial classes
96  */
97 extern FAUDES_API void ComputeBisimulationCTA(const Generator& rGen, std::list<StateSet>& rResult);
98 
99 /*!
100  * \brief ComputeBisimulationCTA
101  * bisimulation partition based on change-tracking algorithm and topo sort
102  * \param rGen
103  * input gen
104  * \param rSilent
105  * silent event set (contains either 0 or 1 event)
106  * \param rResult
107  * state partition without trivial classes
108  */
109 extern FAUDES_API void ComputeBisimulationCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult);
110 
111 /*!
112  * \brief ComputeWeakBisimulationCTA
113  * weak bisimulation (aka observation eq) partition based on change-tracking algorithm and topo sort
114  * \param rGen
115  * input gen
116  * \param rSilent
117  * silent event set (contains either 0 or 1 event)
118  * \param rResult
119  * state partition without trivial classes
120  */
121 extern FAUDES_API void ComputeWeakBisimulationCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult);
122 
123 /*!
124  * \brief ComputeBisimulationCTA
125  * basic bisimulation partition algorithm under prepartition based on change-tracking algorithm
126  * \param rGen
127  * input gen
128  * \param rResult
129  * state partition without trivial classes
130  * \param rPrePartition
131  * prepartition (trivial classes MUST be included)
132  */
133 extern FAUDES_API void ComputeBisimulationCTA(const Generator& rGen, std::list<StateSet>& rResult, const std::vector<StateSet>& rPrePartition);
134 
135 /*!
136  * \brief ComputeDelayedBisimulationCTA
137  * delayed bisimulation partition under prepartition based on change-tracking algorithm and topo sort
138  * \param rGen
139  * input gen
140  * \param rSilent
141  * silent event set (contains either 0 or 1 event)
142  * \param rResult
143  * state partition without trivial classes
144  * \param rPrePartition
145  * prepartition (trivial classes MUST be included)
146  */
147 extern FAUDES_API void ComputeDelayedBisimulationCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult, const std::vector<StateSet>& rPrePartition);
148 
149 /*!
150  * \brief ComputeWeakBisimulationCTA
151  * weak bisimulation (aka observation eq) partition under prepartition based on change-tracking algorithm and topo sort
152  * \param rGen
153  * input gen
154  * \param rSilent
155  * silent event set (contains either 0 or 1 event)
156  * \param rResult
157  * state partition without trivial classes
158  * \param rPrePartition
159  * prepartition (trivial classes MUST be included)
160  */
161 extern FAUDES_API void ComputeWeakBisimulationCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult, const std::vector<StateSet>& rPrePartition);
162 
163 
164 
165 
166 /*!
167  * \brief ComputeAbstractBisimulationSatCTA
168  * saturation and change-tracking based partition algorithm for either delayed or weak bisimulation. This function is intended to be
169  * invoked by ComputeDelayedBisimulation_Sat or ComputeWeakBisimulation_Sat, not for direct external usage
170  * \param rGen
171  * input gen
172  * \param rSilent
173  * silent event set (contains either 0 or 1 event)
174  * \param rResult
175  * state partition without trivial classes
176  * \param rFlag
177  * rFlag == 1: dalayed bisimulation; rFlag == 2: weak bisimulation
178  * \param rPrePartition
179  * prepartition (trivial classes MUST be included)
180  */
181 void ComputeAbstractBisimulationSatCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult, const Idx& rFlag, const std::vector<StateSet>& rPrePartition);
182 
183 /*!
184  * \brief ComputeDelayedBisimulationSatCTA
185  * delayed bisimulation partition based on change-tracking algorithm and saturation
186  * \param rGen
187  * input gen
188  * \param rSilent
189  * silent event set (contains either 0 or 1 event)
190  * \param rResult
191  * state partition without trivial classes
192  */
193 extern FAUDES_API void ComputeDelayedBisimulationSatCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult);
194 
195 /*!
196  * \brief ComputeWeakBisimulationSatCTA
197  * weak bisimulation (aka observation eq) partition based on change-tracking algorithm and saturation
198  * \param rGen
199  * input gen
200  * \param rSilent
201  * silent event set (contains either 0 or 1 event)
202  * \param rResult
203  * state partition without trivial classes
204  */
205 extern FAUDES_API void ComputeWeakBisimulationSatCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult);
206 
207 
208 /*!
209  * \brief ComputeDelayedBisimulationCTA
210  * delayed bisimulation partition under prepartition based on change-tracking algorithm and saturation
211  * \param rGen
212  * input gen
213  * \param rSilent
214  * silent event set (contains either 0 or 1 event)
215  * \param rResult
216  * state partition without trivial classes
217  * \param rPrePartition
218  * prepartition (trivial classes MUST be included)
219  */
220 extern FAUDES_API void ComputeDelayedBisimulationCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult, const std::vector<StateSet>& rPrePartition);
221 
222 /*!
223  * \brief ComputeComputeWeakBisimulationSatCTA
224  * weak bisimulation partition under prepartition based on change-tracking algorithm and saturation
225  * \param rGen
226  * input gen
227  * \param rSilent
228  * silent event set (contains either 0 or 1 event)
229  * \param rResult
230  * state partition without trivial classes
231  * \param rPrePartition
232  * prepartition (trivial classes MUST be included)
233  */
234 extern FAUDES_API void ComputeComputeWeakBisimulationSatCTA(const Generator& rGen, const EventSet& rSilent, std::list<StateSet>& rResult, const std::vector<StateSet>& rPrePartition);
235 
236 
237 } // namespace
238 #endif // BISIMCTA_H
Compiletime options.
Class vGenerator.
Classes IndexSet, TaIndexSet.
Classes NameSet, TaNameSet.
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:81
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
Base class of all FAUDES generators.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
FAUDES_API void FactorTauLoops(Generator &rGen, const Idx &rSilent)
FactorTauLoops merge silent loop and then remove silent self loops.
void ExtendTransRel(Generator &rGen, const EventSet &rSilent, const Idx &rFlag)
ExtendTransRel perform transition saturation w.r.t. silent evs. Two different saturation modes are se...
void InstallSelfloops(Generator &rGen, const EventSet &rEvs)
InstallSelfloops install selfloops on all states of given event set. intended to install silent event...
void ComputeAbstractBisimulationSatCTA(const Generator &rGen, const EventSet &rSilent, std::list< StateSet > &rResult, const Idx &rFlag, const std::vector< StateSet > &rPrePartition)
ComputeAbstractBisimulationSatCTA saturation and change-tracking based partition algorithm for either...
void ComputeBisimulationCTA(const Generator &rGen, std::list< StateSet > &rResult)
ComputeBisimulationCTA basic bisimulation partition algorithm based on change-tracking algorithm.
void ComputeWeakBisimulationCTA(const Generator &rGen, const EventSet &rSilent, std::list< StateSet > &rResult)
ComputeWeakBisimulationCTA weak bisimulation (aka observation eq) partition based on change-tracking ...
void ComputeDelayedBisimulationCTA(const Generator &rGen, const EventSet &rSilent, std::list< StateSet > &rResult)
void ComputeWeakBisimulationSatCTA(const Generator &rGen, const EventSet &rSilent, std::list< StateSet > &rResult)
ComputeWeakBisimulationSatCTA weak bisimulation (aka observation eq) partition based on change-tracki...
void ComputeDelayedBisimulationSatCTA(const Generator &rGen, const EventSet &rSilent, std::list< StateSet > &rResult)
ComputeDelayedBisimulationSatCTA delayed bisimulation partition based on change-tracking algorithm an...
FAUDES_API void ComputeComputeWeakBisimulationSatCTA(const Generator &rGen, const EventSet &rSilent, std::list< StateSet > &rResult, const std::vector< StateSet > &rPrePartition)
ComputeComputeWeakBisimulationSatCTA weak bisimulation partition under prepartition based on change-t...

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