omg_rabinfnct.h
Go to the documentation of this file.
1 /** @file omg_rabinfnct.h
2 
3 Operations regarding omega languages accepted by Rabin automata
4 
5 */
6 
7 /* FAU Discrete Event Systems Library (libfaudes)
8 
9  Copyright (C) 2010, 2025 Thomas Moor
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public
13  License as published by the Free Software Foundation; either
14  version 2.1 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24 
25 
26 #ifndef FAUDES_OMG_RABINFNCT_H
27 #define FAUDES_OMG_RABINFNCT_H
28 
29 #include "corefaudes.h"
30 #include "omg_rabinaut.h"
31 
32 namespace faudes {
33 
34 
35 /**
36  * Life states w.r.t a Rabin pair.
37  *
38  * A state is considered life if it allows for a future path that such
39  * that the acceptance condition is met,
40  *
41  * The implementation is along the following line
42  * - initialise LSet the ISet
43  * - run a nu iteration on LSet to figure the largest existential invariant
44  * - run a mu iteration on LSet*RSet to restrict LSet to states which can reach RSet
45  * - repeat the last to steps until a fix point is attained
46  * - run one more mu iteration on LSet to extend to the bachward reach
47  *
48  * @param rTransRel
49  * Trasition systej to operate on
50  * @param rRevTransRel
51  * Reverse sorted variant
52  * @param rRPair
53  * Rabin pair to consider
54  * @param rLife
55  * Resulting set of life states
56  *
57  * @ingroup OmgPlugin
58  */
59 extern FAUDES_API void RabinLifeStates(
60  const TransSet& rTransRel,
61  const TransSetX2EvX1& rRevTransRel,
62  const RabinPair& rRPair,
63  StateSet& rLife);
64 
65 
66 /**
67  * Life states w.r.t a Rabin pair.
68  *
69  * API wrapper.
70  *
71  * @param rRAut
72  * Trasition system to operate on
73  * @param rRPair
74  * Rabin pair to consider
75  * @param rLife
76  * Resulting set of life states
77  *
78  * @ingroup OmgPlugin
79  */
80 extern FAUDES_API void RabinLifeStates(
81  const vGenerator& rRAut,
82  const RabinPair& rRPair,
83  StateSet& rLife);
84 
85 
86 /**
87  * Life states w.r.t a Rabin acceptance condition.
88  *
89  * Iterates over all Rabin pairs and Returns the
90  * union of all life states.
91  *
92  * @param rRAut
93  * Trasition system to operate on
94  * @param rLife
95  * Resulting set of life states
96  *
97  * @ingroup OmgPlugin
98  */
99 extern FAUDES_API void RabinLifeStates(const RabinAutomaton& rRAut, StateSet& rLife);
100 
101 
102 /**
103  * Test for lifeness w.r.t a Rabin acceptance condition.
104  *
105  * Returns true iff all accessible states are life.
106  *
107  * @param rRAut
108  * Trasition system to operate on
109  * @return
110  * trud iff Rabin automaton is life.
111  *
112  * @ingroup OmgPlugin
113  */
114 extern FAUDES_API bool IsRabinLife(const RabinAutomaton& rRAut);
115 
116 
117 /**
118  * Trim generator w.r.t. Rabin acceptance
119  *
120  * This function computes the set of states that contribute to the accepted
121  * omega language. The current implementation returns the union of all states
122  * that are life w.r.t. a Rabin pair, restricted to reachable states.
123  *
124  * @param rRAut
125  * Automaton to consider
126  * @param rInv
127  * Resulting set of trim statess
128  *
129  * @ingroup OmgPlugin
130  */
131 extern FAUDES_API void RabinTrimSet(const RabinAutomaton& rRAut, StateSet& rTrim);
132 
133 
134 /**
135  * Trim generator w.r.t Rabin acceptance
136  *
137  * Restrict the automaton to the set of trim states; see also RaibLifeStates and RabinTrimSet
138  *
139  * @param rRAut
140  * Automaton to trim
141  * @return
142  * True if resulting generator contains at least one initial state.
143  *
144  * @ingroup OmgPlugin
145  */
146 extern FAUDES_API bool RabinTrim(RabinAutomaton& rRAut);
147 
148 /**
149  * Trim generator w.r.t Rabin acceptance
150  *
151  * Restrict the automaton to the set of trim states; see also RaibLifeStates and RabinTrimSet
152  *
153  * @param rRAut
154  * Automaton to trim
155  * @param rRes
156  * Resulting trimmed automaton
157  * @return
158  * True if resulting generator contains at least one initial state.
159  *
160  * @ingroup OmgPlugin
161  */
162 extern FAUDES_API bool RabinTrim(const RabinAutomaton& rRAut, RabinAutomaton& rRes);
163 
164 /**
165  * Test a Rabinautomaton to be trim.
166  *
167  * Returns true iff all states are accessible and life.
168  *
169  * @param rRAut
170  * Trasition system to operate on
171  * @return
172  * trud iff Rabin automaton is life.
173  *
174  * @ingroup OmgPlugin
175  */
176 extern FAUDES_API bool IsRabinTrim(const RabinAutomaton& rRAut);
177 
178 /**
179  * Simplify Rabin acceptance condition
180  *
181  * Simplify Rabin pairs while maintaining the accepted laguage.
182  *
183  * @param rRAut
184  * Automaton to simplify
185  *
186  * @ingroup OmgPlugin
187  */
188 extern FAUDES_API void RabinSimplify(RabinAutomaton& rRAut);
189 
190 /**
191  * Simplify Rabin acceptance condition
192  *
193  * Simplify Rabin pairs while maintaining the accepted laguage.
194  *
195  * @param rRAut
196  * Automaton to simplify
197  * @param rRes
198  * Resulting automaton
199  *
200  * @ingroup OmgPlugin
201  */
202 extern FAUDES_API void RabinSimplify(const RabinAutomaton& rRAut, RabinAutomaton& rRes);
203 
204 /**
205  * Construct Rabin-Buechi automata.
206  *
207  * Given two automata rRAut and rBAut, this function constructs the accessible product state set
208  * and corresponding syncronizsed transitions. For the generated languages, this is exactly the same
209  * as the common product operation. It then lifts the two individual acceptance conditions to the
210  * product state set. If both rRAut and rBAut are full, so is the result. In that case, the
211  * result accepts by its Rabin acceptance condition runs that are accepted by rRAut and by
212  * its Buechi acceptance condition those path thet are accepted by rBAut.
213  *
214  * The intended use case is when rRAut is a lifeness specification and rBAut is a plant with lifeness
215  * guarantees.
216  *
217  * @param rRAut
218  * Rabin automaton
219  * @param rBAut
220  * Buechi automaton
221  * @param rRes
222  * Resulting product automaton
223  *
224  * @ingroup OmgPlugin
225  */
226 extern FAUDES_API void RabinBuechiAutomaton(const RabinAutomaton& rRAut, const Generator& rBAut, RabinAutomaton& rRes);
227 
228 /**
229  * Product composition for a Rabin automaton with a Buechi automaton
230  *
231  * Referring to each acceptance condition specified by rRAut and rBAut, the resulting
232  * Rabin automaton accepts all those runs, that are accepted by both rRAut and rBAut.
233  * To support supervisory control, this function sets the marking of the result as a lifted
234  * variant of rBAut.
235  *
236  * This implementation extends the usual product state space by a flag to indentify executions
237  * with alternating marking. This restricts the applicability to one Rabin pair only. Future
238  * revisions may drop this restriction.
239  *
240  * @param rRAut
241  * First automaton
242  * @param rBAut
243  * Second automaton
244  * @param rRes
245  * Reference to resulting product composition
246  *
247  *
248  * @ingroup OmgPlugin
249  *
250  */
251 extern FAUDES_API void RabinBuechiProduct(const RabinAutomaton& rRAut, const Generator& rBAut, RabinAutomaton& rRes);
252 
253 
254 
255 } // namespace faudes
256 
257 #endif
258 
#define FAUDES_API
Definition: cfl_platform.h:85
IndexSet StateSet
Definition: cfl_indexset.h:296
TTransSet< TransSort::X1EvX2 > TransSet
TTransSet< TransSort::X2EvX1 > TransSetX2EvX1
vGenerator Generator
void RabinTrimSet(const RabinAutomaton &rRAut, StateSet &rTrim)
void RabinBuechiAutomaton(const RabinAutomaton &rRAut, const Generator &rBAut, RabinAutomaton &rRes)
bool RabinTrim(RabinAutomaton &rRAut)
void RabinLifeStates(const TransSet &rTransRel, const TransSetX2EvX1 &rRevTransRel, const RabinPair &rRPair, StateSet &rLife)
bool IsRabinLife(const RabinAutomaton &rRAut)
void RabinBuechiProduct(const RabinAutomaton &rRAut, const Generator &rBAut, RabinAutomaton &rRes)
bool IsRabinTrim(const RabinAutomaton &rRAut)
void RabinSimplify(RabinAutomaton &rRAut)
TrGenerator< RabinAcceptance, AttributeVoid, AttributeCFlags, AttributeVoid > RabinAutomaton
Definition: omg_rabinaut.h:226

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