syn_functions.h
Go to the documentation of this file.
1 /** @file syn_functions.h Misc functions related to synthesis */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2010 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 #ifndef FAUDES_SYN_FUNCTIONS_H
23 #define FAUDES_SYN_FUNCTIONS_H
24 
25 #include "corefaudes.h"
26 
27 namespace faudes {
28 
29 
30 
31 /**
32  * Test for relative marking.
33  *
34  * Tests whether the language Lm(GCand) is relatively marked w.r.t.
35  * the language Lm(GPlant). The formal definition of this property
36  * requires
37  *
38  * closure(Lm(GCand)) ^ Lm(GPlant) <= Lm(GCand).
39  *
40  * The implementation tests
41  *
42  * L(GCand) ^ Lm(GPlant) <= Lm(GCand)
43  *
44  * by first performing the product composition and then inspecting
45  * the marking to require
46  *
47  * ( forall accessible (qPlant,qCand) ) [ qPlant in QPlant_m implies qCand in QCand_m ].
48  *
49  * In general, the test is only sufficient.
50  * Provided the arguments are trim and deterministic, the test
51  * is sufficient and necessary.
52  *
53  * @param rGenPlant
54  * Generator GPlant
55  * @param rGenCand
56  * Generator GCand
57  *
58  *
59  * @exception Exception
60  * - alphabets of generators don't match (id 100)
61  * - arguments are not trim (id 201, only if FAUDES_CHECKED is set)
62  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
63  *
64  * @return
65  * true / false
66  *
67  * @ingroup SynthesisPlugIn
68  */
69 extern FAUDES_API bool IsRelativelyMarked(const Generator& rGenPlant, const Generator& rGenCand);
70 
71 
72 /**
73  * Test for relative prefix-closedness.
74  *
75  * Tests whether the language Lm(GCand) is relatively closed w.r.t.
76  * the language Lm(GPant). The formal definition of this property
77  * requires
78  *
79  * closure(Lm(GCand)) ^ Lm(GPlant) = Lm(GCand).
80  *
81  * The implementation tests
82  *
83  * L(GCand) ^ Lm(GPland) = Lm(GCand)
84  *
85  * by performing the product composition and by testing
86  *
87  * - for L(GCand) subseteq L(GPlant), and
88  * - ( forall accessible (qPland,qCand) ) [ qPlant in QPlant_m if and only if qCand in QCand_m ].
89  *
90  * In general, the test is only sufficient.
91  * Provided the arguments are trim and deterministic, the test
92  * is sufficient and necessary.
93  *
94  * @param rGenPlant
95  * Generator GPlant
96  * @param rGenCand
97  * Generator GCand
98  *
99  * @exception Exception
100  * - alphabets of generators don't match (id 100)
101  * - arguments are not trim (id 201, only if FAUDES_CHECKED is set)
102  * - arguments are non-deterministic (id 202, only if FAUDES_CHECKED is set)
103  *
104  * @return
105  * true / false
106  *
107  * @ingroup SynthesisPlugIn
108  */
109 extern FAUDES_API bool IsRelativelyClosed(const Generator& rGenPlant, const Generator& rGenCand);
110 
111 /**
112  * Supremal Relatively Closed Sublanguage
113  *
114  * Computes the supremal sublanguage of the specification E that is relatively closed
115  * w.r.t. the plant G. The result is given as a trim deterministic generator that
116  * may be used as a specification for a subsequent controller design via SupCon.
117  *
118  * The implementation removes states from the product GxE that conflict with
119  * relative closedness. From the known formula supR(E)= (L^E) - (L-E)Sigma*, we know that
120  * the supremal sublanguage can be realized as a subautomaton of GxE. Thus, we conclude
121  * that our implementation indeed returns the supremum.
122  *
123  * Parameter restrictions: both generators must be deterministic and
124  * have the same alphabet.
125  *
126  *
127  * @param rPlantGen
128  * Plant G
129  * @param rSpecGen
130  * Specification Generator E
131  * @param rResGen
132  * Reference to resulting Generator
133  *
134  * @exception Exception
135  * - alphabets of generators don't match (id 100)
136  * - plant nondeterministic (id 201)
137  * - spec nondeterministic (id 203)
138  * - plant and spec nondeterministic (id 204)
139  *
140  * @ingroup SynthesisPlugIn
141  *
142  */
143 extern FAUDES_API void SupRelativelyClosed(
144  const Generator& rPlantGen,
145  const Generator& rSpecGen,
146  Generator& rResGen);
147 
148 
149 /**
150  * Supremal Relatively Closed Sublanguage (internal function)
151  *
152  *
153  * This version of SupRelativelyClosed performs no consistency test of the given parameter.
154  * It set's up a "composition map" as in the parallel composition, however,
155  * the map may still contain states that have been removed from the result
156  * to obtain controllability.
157  *
158  * Parameter restrictions: both generators must be deterministic and
159  * have the same alphabet.
160  *
161  *
162  * @param rPlantGen
163  * Plant G
164  * @param rSpecGen
165  * Specification Generator E
166  * @param rCompositionMap
167  * Record parallel composition state mapping
168  * @param rResGen
169  * Reference to resulting Generator,
170  *
171  */
173  const Generator& rPlantGen,
174  const Generator& rSpecGen,
175  std::map< std::pair<Idx,Idx>,Idx >& rCompositionMap,
176  Generator& rResGen);
177 
178 
179 // legacy wrapper (pre 2.33d)
180 extern FAUDES_API bool IsRelativelyPrefixClosed(const Generator& rGenPlant, const Generator& rGenCand);
181 extern FAUDES_API void SupRelativelyPrefixClosed(const Generator& rPlantGen, const Generator& rSpecGen,
182  Generator& rResGen);
183 
184 
185 
186 } // namespace faudes
187 
188 #endif
189 
190 
#define FAUDES_API
Definition: cfl_platform.h:80
vGenerator Generator
bool IsRelativelyMarked(const Generator &rGenPlant, const Generator &rGenCand)
void SupRelativelyClosed(const Generator &rPlantGen, const Generator &rSpecGen, Generator &rResGen)
bool IsRelativelyClosed(const Generator &rGenPlant, const Generator &rGenCand)
uint32_t Idx
void SupRelativelyClosedUnchecked(const Generator &rPlantGen, const Generator &rSpecGen, std::map< std::pair< Idx, Idx >, Idx > &rCompositionMap, Generator &rResGen)
bool IsRelativelyPrefixClosed(const Generator &rGenPlant, const Generator &rGenCand)
void SupRelativelyPrefixClosed(const Generator &rPlantGen, const Generator &rSpecGen, Generator &rResGen)

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