omg_rabinctrlrk.h
Go to the documentation of this file.
1 /** @file omg_rabinctrlrk.h Synthesis omega languages accepted by Rabin automata */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5 Copyright (C) 2025 Changming Yang, Thomas Moor
6 
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11 
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
20 
21 
22 /*
23 This is an alternative implementation to compute the controllable set
24 aka the controllability prefix following more closely the literature.
25 This contribution is highly appreciated. However, I can not merge right
26 now, since the comming main branch considers liveness properties of the
27 plant which are not covered in this otherwise very tidy variant. So we
28 keep the both variants until we figured how to resolve best.
29 
30 TM, 2025/07
31 */
32 
33 #ifndef FAUDES_OMG_RABINCTRLRK_H
34 #define FAUDES_OMG_RABINCTRLRK_H
35 
36 #include "corefaudes.h"
37 #include "omg_rabinaut.h"
38 
39 namespace faudes {
40 
41 /**
42  * State feedback mapping for Rabin control synthesis.
43  *
44  * Maps each controllable state to its corresponding control pattern (subset of events).
45  * This implements the state feedback controller from Theorem 6.4 in Thistle/Wonham 1994.
46  */
48 
49 /**
50  * State ranking information for fixpoint computation.
51  *
52  * Records the level at which each state was added during the nested fixpoint iteration.
53  * Used for constructing the state feedback controller according to Theorem 6.4.
54  */
55 class StateRanking : public AttributeVoid {
56 public:
57  int muLevel; // Outer mu-iteration level (i)
58  int nuLevel; // Inner nu-iteration level (j)
59  int branchType; // Which branch of the p-reach operator (0 or 1)
60 
62  StateRanking(int mu, int nu, int branch) : AttributeVoid(), muLevel(mu), nuLevel(nu), branchType(branch) {}
63 
64  // Lexicographic comparison for state ranking
65  bool operator<(const StateRanking& other) const {
66  if (muLevel != other.muLevel) return muLevel < other.muLevel;
67  if (nuLevel != other.nuLevel) return nuLevel < other.nuLevel;
68  return branchType < other.branchType;
69  }
70 
71  // Required by AttributeVoid interface
72  virtual bool IsDefault(void) const {
73  return muLevel == 0 && nuLevel == 0 && branchType == 0;
74  }
75 
76  // Assignment operator
78  if (this != &other) {
79  muLevel = other.muLevel;
80  nuLevel = other.nuLevel;
81  branchType = other.branchType;
82  }
83  return *this;
84  }
85 };
86 
87 /**
88  * State ranking map for control synthesis.
89  *
90  * Maps each state to its ranking information during fixpoint computation.
91  */
93 
94 
95 /**
96  * Controllability prefix with state feedback for Rabin automata.
97  *
98  * Extended version that computes both the controllability prefix and
99  * the corresponding state feedback controller, implementing Theorem 6.4
100  * from Thistle/Wonham 1994.
101  *
102  * @param rRAut
103  * Automaton to control
104  * @param rSigmaCtrl
105  * Set of controllable events
106  * @param rCtrlPfx
107  * State set that marks the controllability prefix
108  * @param rStateFeedback
109  * State feedback mapping: for each controllable state, provides the control pattern
110  *
111  * @ingroup OmgPlugin
112  */
114  const RabinAutomaton& rRAut, const EventSet& rSigmaCtrl,
115  TaIndexSet<EventSet>& rController);
116 
117 
118 
119 
120 } // namespace faudes
121 
122 #endif
123 
#define FAUDES_API
Definition: cfl_platform.h:85
virtual bool IsDefault(void) const
StateRanking & operator=(const StateRanking &other)
StateRanking(int mu, int nu, int branch)
bool operator<(const StateRanking &other) const
void RabinCtrlPfxWithFeedback(const RabinAutomaton &rRAut, const EventSet &rSigmaCtrl, TaIndexSet< EventSet > &rController)
TaIndexSet< StateRanking > StateRankingMap
TaIndexSet< EventSet > StateFeedbackMap

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