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  * Live states w.r.t a Rabin pair.
37  *
38  * A state is considered live 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 rInv
55  * Resulting set of live states
56  *
57  * @ingroup OmgPlugin
58  */
59 extern FAUDES_API void RabinLiveStates(
60  const TransSet& rTransRel,
61  const TransSetX2EvX1& rRevTransRel,
62  const RabinPair& rRPair,
63  StateSet& rInv);
64 
65 
66 /**
67  * Live 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 rInv
76  * Resulting set of live states
77  *
78  * @ingroup OmgPlugin
79  */
80 extern FAUDES_API void RabinLiveStates(
81  const vGenerator& rRAut,
82  const RabinPair& rRPair,
83  StateSet& rInv);
84 
85 /**
86  * Live states w.r.t a Rabin acceptance condition.
87  *
88  * Iterates over all Rabin pairs and Returns the
89  * union of all live states.
90  *
91  * @param rRAut
92  * Trasition system to operate on
93  * @param rInv
94  * Resulting set of live states
95  *
96  * @ingroup OmgPlugin
97  */
98 extern FAUDES_API void RabinLiveStates(const RabinAutomaton& rRAut, StateSet& rInv);
99 
100 
101 /**
102  * Trim generator w.r.t. Rabin acceptance
103  *
104  * This function computes the set of states that contribute to the accepted
105  * omega language. The current implementation returns the union of all states
106  * that are live w.r.t. a Rabin pair, restricted to reachable states.
107  *
108  * @param rRAut
109  * Automaton to consider
110  * @param rInv
111  * Resulting set of trim statess
112  *
113  * @ingroup OmgPlugin
114  */
115 extern FAUDES_API void RabinTrimSet(const RabinAutomaton& rRAut, StateSet& rTrim);
116 
117 
118 /**
119  * Trim generator w.r.t Rabin acceptance
120  *
121  * Restrict the automaton to the set of trim states; see also RaibLiveStates and RabinTrimSet
122  *
123  * @param rRAut
124  * Automaton to trim
125  * @return
126  * True if resulting generator contains at least one initial state.
127  *
128  * @ingroup OmgPlugin
129  */
130 extern FAUDES_API bool RabinTrim(RabinAutomaton& rRAut);
131 
132 /**
133  * Trim generator w.r.t Rabin acceptance
134  *
135  * Restrict the automaton to the set of trim states; see also RaibLiveStates and RabinTrimSet
136  *
137  * @param rRAut
138  * Automaton to trim
139  * @param rRes
140  * Resulting trimmed automaton
141  * @return
142  * True if resulting generator contains at least one initial state.
143  *
144  * @ingroup OmgPlugin
145  */
146 extern FAUDES_API bool RabinTrim(const RabinAutomaton& rRAut, RabinAutomaton& rRes);
147 
148 /**
149  * Construct Rabin-Buechi automata.
150  *
151  * Given two automata rRAut and rBAut, this function constructs the accessible product state set
152  * and corresponding syncronizsed transitions. For the generated languages, this is exactly the same
153  * as the common product operation. It then lifts the two individual acceptance conditions to the
154  * product state set. If both rRAut and rBAut are full, so is the result. In that case, the
155  * result accepts by its Rabin acceptance condition runs that are accepted by rRAut and by
156  * its Buechi acceptance condition those path thet are accepted by rBAut.
157  *
158  * The intended use case is when rRAut is a liveness specification and rBAut is a plant with liveness
159  * guarantees.
160  *
161  * @param rRAut
162  * Rabin automaton
163  * @param rBAut
164  * Buechi automaton
165  * @param rRes
166  * Resulting product automaton
167  *
168  * @ingroup OmgPlugin
169  */
170 extern FAUDES_API void RabinBuechiAutomaton(const RabinAutomaton& rRAut, const Generator& rBAut, RabinAutomaton& rRes);
171 
172 /**
173  * Product composition for a Rabin automaton with a Buechi automaton
174  *
175  * Referring to each acceptance condition specified by rRAut and rBAut, the resulting
176  * Rabin automaton accepts all those runs, that are accepted by both rRAut and rBAut.
177  * To support supervisory control, this function sets the marking of the result as a lifted
178  * variant of rBAut.
179  *
180  * This implementation extends the usual product state space by a flag to indentify executions
181  * with alternating marking. This restricts the applicability to one Rabin pair only. Future
182  * revisions may drop this restriction.
183  *
184  * @param rRAut
185  * First automaton
186  * @param rBAut
187  * Second automaton
188  * @param rRes
189  * Reference to resulting product composition
190  *
191  *
192  * @ingroup OmgPlugin
193  *
194  */
195 extern FAUDES_API void RabinBuechiProduct(const RabinAutomaton& rRAut, const Generator& rBAut, RabinAutomaton& rRes);
196 
197 
198 
199 } // namespace faudes
200 
201 #endif
202 
#define FAUDES_API
Definition: cfl_platform.h:80
IndexSet StateSet
Definition: cfl_indexset.h:273
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 RabinBuechiProduct(const RabinAutomaton &rRAut, const Generator &rBAut, RabinAutomaton &rRes)
void RabinLiveStates(const TransSet &rTransRel, const TransSetX2EvX1 &rRevTransRel, const RabinPair &rRPair, StateSet &rInv)
TrGenerator< RabinAcceptance, AttributeVoid, AttributeCFlags, AttributeVoid > RabinAutomaton
Definition: omg_rabinaut.h:224

libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen