|
|
Go to the documentation of this file.
47 std::stringstream errstr;
48 errstr << "Alphabets of generators do not match.";
49 throw Exception( "IsRelativelyMarked", errstr.str(), 100);
55 std::stringstream errstr;
56 errstr << "Arguments are expected to be nonblocking.";
57 throw Exception( "IsRelativelyMarked", errstr.str(), 201);
64 std::stringstream errstr;
65 errstr << "Arguments are expected to be deterministic.";
66 throw Exception( "IsRelativelyMarked", errstr.str(), 202);
71 std::map< std::pair<Idx,Idx> , Idx> revmap;
74 Product(rGenPlant,rGenCand,revmap,product);
77 std::map< std::pair<Idx,Idx> , Idx>::iterator rit;
78 for(rit=revmap.begin(); rit!=revmap.end(); ++rit) {
90 return rit==revmap.end();
99 FD_DF( "IsRelativelyClosed(\"" << rGenPlant. Name() << "\", \"" << rGenCand. Name() << "\")");
103 std::stringstream errstr;
104 errstr << "Alphabets of generators do not match.";
105 throw Exception( "IsRelativelyClosed", errstr.str(), 100);
111 std::stringstream errstr;
112 errstr << "Arguments are expected to be nonblocking.";
113 throw Exception( "IsRelativelyClosed", errstr.str(), 201);
120 std::stringstream errstr;
121 errstr << "Arguments are expected to be deterministic.";
122 throw Exception( "IsRelativelyClosed", errstr.str(), 202);
127 FD_DF( "IsRelativelyClosed(..): perform product");
130 std::stack< std::pair<Idx,Idx> > todo;
132 std::pair<Idx,Idx> currentstates, newstates;
134 std::set< std::pair<Idx,Idx> > productstates;
136 StateSet::Iterator lit1, lit2;
138 std::set< std::pair<Idx,Idx> >::iterator rcit;
140 bool inclusion12= true;
143 FD_DF( "IsRelativelyClosed(..): perform product: adding all combinations of initial states to todo");
148 currentstates = std::make_pair(*lit1, *lit2);
149 todo.push(currentstates);
150 productstates.insert(currentstates);
151 FD_DF( "IsRelativelyClosed(..): perform product: (" <<
152 *lit1 << "|" << *lit2 << ")");
157 FD_DF( "IsRelativelyClosed(..): perform product: Product: processing reachable states:");
158 while (! todo.empty() && inclusion12) {
162 currentstates = todo.top();
164 FD_DF( "Processing (" << currentstates.first << "|"
165 << currentstates.second << ")");
168 tit1_end = rGenCand. TransRelEnd(currentstates.first);
170 tit2_end = rGenPlant. TransRelEnd(currentstates.second);
172 bool resolved12= true;
173 while((tit1 != tit1_end) && (tit2 != tit2_end)) {
175 if(tit1->Ev != curev1) {
176 if(!resolved12) inclusion12= false;
181 if(tit1->Ev == tit2->Ev) {
183 newstates = std::make_pair(tit1->X2, tit2->X2);
185 rcit = productstates.find(newstates);
186 if(rcit == productstates.end()) {
187 todo.push(newstates);
188 productstates.insert(newstates);
189 FD_DF( "Product: todo push: (" << newstates.first << "|"
190 << newstates.second << ")");
196 else if (tit1->Ev < tit2->Ev) {
200 else if (tit1->Ev > tit2->Ev) {
205 if(!resolved12) inclusion12= false;
208#ifdef FAUDES_DEBUG_FUNCTION
209 FD_DF( "IsRelativelyClosed(): Product: done");
211 FD_DF( "IsRelativelyClosed(): Product: inclusion L(G1) <= L(G2) not satisfied");
216 if(!inclusion12) return false;
219 std::set< std::pair<Idx,Idx> >::iterator rit;
220 for(rit=productstates.begin(); rit!=productstates.end(); ++rit) {
234 return rit==productstates.end();
250 only_in_plant. Name( "Only_In_Plant");
251 only_in_spec. Name( "Only_In_Specification");
252 std::stringstream errstr;
253 errstr << "Alphabets of generators do not match.";
254 if(!only_in_plant. Empty())
255 errstr << " " << only_in_plant. ToString() << ".";
256 if(!only_in_spec. Empty())
257 errstr << " " << only_in_spec. ToString() << ".";
258 throw Exception( "SupCon/SupCon", errstr.str(), 100);
264 if ((plant_det == false) && (spec_det == true)) {
265 std::stringstream errstr;
266 errstr << "Plant generator must be deterministic, "
267 << "but is nondeterministic";
268 throw Exception( "ControllableConsistencyCheck", errstr.str(), 201);
270 else if ((plant_det == true) && (spec_det == false)) {
271 std::stringstream errstr;
272 errstr << "Spec generator must be deterministic, "
273 << "but is nondeterministic";
274 throw Exception( "ControllableConsistencyCheck", errstr.str(), 203);
276 else if ((plant_det == false) && (spec_det == false)) {
277 std::stringstream errstr;
278 errstr << "Plant and spec generator must be deterministic, "
279 << "but both are nondeterministic";
280 throw Exception( "ControllableConsistencyCheck", errstr.str(), 204);
284 std::map< std::pair<Idx,Idx>, Idx> rcmap;
295 std::map< std::pair<Idx,Idx>, Idx>& rCompositionMap,
298 FD_DF( "SupRelativelyClosed(" << &rPlantGen << "," << &rSpecGen << ")");
302 if(&rResGen== &rPlantGen || &rResGen== &rSpecGen) {
303 pResGen= rResGen. New();
312 Product(rPlantGen, rSpecGen, rCompositionMap, pmarked, smarked, *pResGen);
318 if(!pmarked. Exists(s)) continue;
319 if(smarked. Exists(s)) continue;
325 if(pResGen != &rResGen) {
326 rResGen. Move(*pResGen);
335 FD_WARN( "SupRelativelyPrefixClosed(): API depreciated; use SupRelativelyClosed()");
340 FD_WARN( "SupRelativelyPrefixClosed(): API depreciated; use SupRelativelyClosed()");
const std::string & Name(void) const
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
std::string ToString(const std::string &rLabel="", const Type *pContext=0) const
StateSet::Iterator StatesBegin(void) const
StateSet::Iterator InitStatesBegin(void) const
const EventSet & Alphabet(void) const
TransSet::Iterator TransRelBegin(void) const
virtual vGenerator & Move(Type &rGen)
virtual vGenerator * New(void) const
StateSet::Iterator StatesEnd(void) const
TransSet::Iterator TransRelEnd(void) const
bool IsDeterministic(void) const
bool StateNamesEnabled(void) const
StateSet::Iterator InitStatesEnd(void) const
bool ExistsMarkedState(Idx index) const
void InjectAlphabet(const EventSet &rNewalphabet)
bool Exists(const T &rElem) const
void Product(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
bool IsDeterministic(const vGenerator &rGen)
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)
void SupRelativelyClosedUnchecked(const Generator &rPlantGen, const Generator &rSpecGen, std::map< std::pair< Idx, Idx >, Idx > &rCompositionMap, Generator &rResGen)
bool IsNonblocking(const GeneratorVector &rGvec)
bool IsRelativelyPrefixClosed(const Generator &rGenPlant, const Generator &rGenCand)
void SupRelativelyPrefixClosed(const Generator &rPlantGen, const Generator &rSpecGen, Generator &rResGen)
std::string CollapsString(const std::string &rString, unsigned int len)
libFAUDES 2.34d
--- 2026.03.11
--- c++ api documentaion by doxygen
|