syn_functions.cpp
Go to the documentation of this file.
1 /** @file syn_functions.cpp 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 //#define FAUDES_DEBUG_FUNCTION
23 
24 #include "syn_functions.h"
25 
26 
27 namespace faudes {
28 
29 
30 
31 
32 /*
33 ***************************************************************************************
34 ***************************************************************************************
35  Implementation
36 ***************************************************************************************
37 ***************************************************************************************
38 */
39 
40 
41 
42 //IsRelativelyMarked(rGenPlant,rGenCand)
43 bool IsRelativelyMarked(const Generator& rGenPlant, const Generator& rGenCand) {
44 
45  // alphabets must match
46  if ( rGenPlant.Alphabet() != rGenCand.Alphabet()) {
47  std::stringstream errstr;
48  errstr << "Alphabets of generators do not match.";
49  throw Exception("IsRelativelyMarked", errstr.str(), 100);
50  }
51 
52 #ifdef FAUDES_CHECKED
53  // generators are meant to be nonblocking
54  if ( !IsNonblocking(rGenCand) || !IsNonblocking(rGenPlant)) {
55  std::stringstream errstr;
56  errstr << "Arguments are expected to be nonblocking.";
57  throw Exception("IsRelativelyMarked", errstr.str(), 201);
58  }
59 #endif
60 
61 #ifdef FAUDES_CHECKED
62  // generators are meant to be deterministic
63  if ( !IsDeterministic(rGenCand) || !IsDeterministic(rGenPlant)) {
64  std::stringstream errstr;
65  errstr << "Arguments are expected to be deterministic.";
66  throw Exception("IsRelativelyMarked", errstr.str(), 202);
67  }
68 #endif
69 
70  // perform composition
71  std::map< std::pair<Idx,Idx> , Idx> revmap;
72  Generator product;
73  product.StateNamesEnabled(false);
74  Product(rGenPlant,rGenCand,revmap,product);
75 
76  // test all reachable states
77  std::map< std::pair<Idx,Idx> , Idx>::iterator rit;
78  for(rit=revmap.begin(); rit!=revmap.end(); ++rit) {
79  // ok: not GPlant-marked state is not considered
80  if(!rGenPlant.ExistsMarkedState(rit->first.first))
81  continue;
82  // ok: GPlant-marked state also has GCand-mark
83  if(rGenCand.ExistsMarkedState(rit->first.second))
84  continue;
85  // failure: GPlant-marked state has no GCand-mark
86  break;
87  }
88 
89  // ok if loop passed
90  return rit==revmap.end();
91 
92 }
93 
94 
95 
96 //IsRelativelyPrefixClosed(rGenPlant,rGenCand)
97 bool IsRelativelyPrefixClosed(const Generator& rGenPlant, const Generator& rGenCand) {
98 
99  FD_DF("IsRelativelyPrefixClosed(\"" << rGenPlant.Name() << "\", \"" << rGenCand.Name() << "\")");
100 
101  // alphabets must match
102  if ( rGenPlant.Alphabet() != rGenCand.Alphabet()) {
103  std::stringstream errstr;
104  errstr << "Alphabets of generators do not match.";
105  throw Exception("IsRelativelyPrefixClosed", errstr.str(), 100);
106  }
107 
108 #ifdef FAUDES_CHECKED
109  // generators are meant to be nonblocking
110  if ( !IsNonblocking(rGenCand) || !IsNonblocking(rGenPlant)) {
111  std::stringstream errstr;
112  errstr << "Arguments are expected to be nonblocking.";
113  throw Exception("IsRelativelyPrefixClosed", errstr.str(), 201);
114  }
115 #endif
116 
117 #ifdef FAUDES_CHECKED
118  // generators are meant to be deterministic
119  if ( !IsDeterministic(rGenCand) || !IsDeterministic(rGenPlant)) {
120  std::stringstream errstr;
121  errstr << "Arguments are expected to be deterministic.";
122  throw Exception("IsRelativelyPrefixClosed", errstr.str(), 202);
123  }
124 #endif
125 
126  // perform composition (variation from cfl_parallel.cpp)
127  FD_DF("IsRelativelyPrefixClosed(..): perform product");
128 
129  // todo stack
130  std::stack< std::pair<Idx,Idx> > todo;
131  // current pair, new pair
132  std::pair<Idx,Idx> currentstates, newstates;
133  // accessible states
134  std::set< std::pair<Idx,Idx> > productstates;
135  // iterators
136  StateSet::Iterator lit1, lit2;
137  TransSet::Iterator tit1, tit1_end, tit2, tit2_end;
138  std::set< std::pair<Idx,Idx> >::iterator rcit;
139  // sense violation of L(GCand) <= L(GPlant)
140  bool inclusion12=true;
141 
142  // push all combinations of initial states on todo stack
143  FD_DF("IsRelativelyPrefixClosed(..): perform product: adding all combinations of initial states to todo");
144  for (lit1 = rGenCand.InitStatesBegin();
145  lit1 != rGenCand.InitStatesEnd(); ++lit1) {
146  for (lit2 = rGenPlant.InitStatesBegin();
147  lit2 != rGenPlant.InitStatesEnd(); ++lit2) {
148  currentstates = std::make_pair(*lit1, *lit2);
149  todo.push(currentstates);
150  productstates.insert(currentstates);
151  FD_DF("IsRelativelyPrefixClosed(..): perform product: (" <<
152  *lit1 << "|" << *lit2 << ")");
153  }
154  }
155 
156  // start algorithm
157  FD_DF("IsRelativelyPrefixClosed(..): perform product: Product: processing reachable states:");
158  while (! todo.empty() && inclusion12) {
159  // allow for user interrupt
160  LoopCallback();
161  // get next reachable state from todo stack
162  currentstates = todo.top();
163  todo.pop();
164  FD_DF("Processing (" << currentstates.first << "|"
165  << currentstates.second << ")");
166  // iterate over all rGenCand transitions
167  tit1 = rGenCand.TransRelBegin(currentstates.first);
168  tit1_end = rGenCand.TransRelEnd(currentstates.first);
169  tit2 = rGenPlant.TransRelBegin(currentstates.second);
170  tit2_end = rGenPlant.TransRelEnd(currentstates.second);
171  Idx curev1=0;
172  bool resolved12=true;
173  while((tit1 != tit1_end) && (tit2 != tit2_end)) {
174  // sense new event
175  if(tit1->Ev != curev1) {
176  if(!resolved12) inclusion12=false;
177  curev1=tit1->Ev;
178  resolved12=false;
179  }
180  // shared event
181  if(tit1->Ev == tit2->Ev) {
182  resolved12=true;
183  newstates = std::make_pair(tit1->X2, tit2->X2);
184  // add to todo list if composition state is new
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 << ")");
191  }
192  ++tit1;
193  ++tit2;
194  }
195  // try resync tit1
196  else if (tit1->Ev < tit2->Ev) {
197  ++tit1;
198  }
199  // try resync tit2
200  else if (tit1->Ev > tit2->Ev) {
201  ++tit2;
202  }
203  }
204  // last event was not resolved in the product
205  if(!resolved12) inclusion12=false;
206  }
207  // report
208 #ifdef FAUDES_DEBUG_FUNCTION
209  FD_DF("IsRelativelyClosed(): Product: done");
210  if(!inclusion12) {
211  FD_DF("IsRelativelyClosed(): Product: inclusion L(G1) <= L(G2) not satisfied");
212  }
213 #endif
214 
215  // bail out when inclusion condition is violated
216  if(!inclusion12) return false;
217 
218  // test all reachable states
219  std::set< std::pair<Idx,Idx> >::iterator rit;
220  for(rit=productstates.begin(); rit!=productstates.end(); ++rit) {
221  // ok: state is GPlant-marked and GCand-marked
222  if(rGenPlant.ExistsMarkedState(rit->second))
223  if(rGenCand.ExistsMarkedState(rit->first))
224  continue;
225  // ok: state is neither GPlant-marked nor GCand-marked
226  if(!rGenPlant.ExistsMarkedState(rit->second))
227  if(!rGenCand.ExistsMarkedState(rit->first))
228  continue;
229  // failure: markin mismatch
230  break;
231  }
232 
233  // ok if loop passed
234  return rit==productstates.end();
235 
236 }
237 
238 
239 // SupRelativelyPrefixClosed(rPlantGen, rCAlph, rSpecGen, rResGen)
241  const Generator& rPlantGen,
242  const Generator& rSpecGen,
243  Generator& rResGen)
244 {
245 
246  // CONSISTENCY CHECK: alphabets must match
247  if ( rPlantGen.Alphabet() != rSpecGen.Alphabet()) {
248  EventSet only_in_plant = rPlantGen.Alphabet() - rSpecGen.Alphabet();
249  EventSet only_in_spec = rSpecGen.Alphabet() - rPlantGen.Alphabet();
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/SupConNB", errstr.str(), 100);
259  }
260 
261  // CONSISTENCY CHECK: plant and spec must be deterministic
262  bool plant_det = rPlantGen.IsDeterministic();
263  bool spec_det = rSpecGen.IsDeterministic();
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);
269  }
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);
275  }
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);
281  }
282 
283  // HELPERS:
284  std::map< std::pair<Idx,Idx>, Idx> rcmap;
285 
286  // ALGORITHM:
287  SupRelativelyPrefixClosedUnchecked(rPlantGen, rSpecGen, rcmap, rResGen);
288 }
289 
290 
291 // SupRelativelyPrefixClosedUnchecked(rPlantGen, rSpecGen, rCompositionMap, rResGen)
293  const Generator& rPlantGen,
294  const Generator& rSpecGen,
295  std::map< std::pair<Idx,Idx>, Idx>& rCompositionMap,
296  Generator& rResGen)
297 {
298  FD_DF("SupRelativelyPrefixClosed(" << &rPlantGen << "," << &rSpecGen << ")");
299 
300  // PREPARE RESULT:
301  Generator* pResGen = &rResGen;
302  if(&rResGen== &rPlantGen || &rResGen== &rSpecGen) {
303  pResGen= rResGen.New();
304  }
305  pResGen->Clear();
306  pResGen->Name(CollapsString("SupRpcNB(("+rPlantGen.Name()+"),("+rSpecGen.Name()+"))"));
307  pResGen->InjectAlphabet(rPlantGen.Alphabet());
308 
309  // ALGORITHM:
310  StateSet pmarked;
311  StateSet smarked;
312  Product(rPlantGen, rSpecGen, rCompositionMap, pmarked, smarked, *pResGen);
313 
314  // make resulting generator relatively prefix closed
315  StateSet::Iterator six=pResGen->StatesBegin();
316  while(six!= pResGen->StatesEnd()) {
317  Idx s=*(six++);
318  if(!pmarked.Exists(s)) continue;
319  if(smarked.Exists(s)) continue;
320  pResGen->DelState(s);
321  }
322  pResGen->Trim();
323 
324  // copy result
325  if(pResGen != &rResGen) {
326  pResGen->Move(rResGen);
327  delete pResGen;
328  }
329 
330 }
331 
332 
333 // IsOmegaRelativelyMarked(rGenPlant,rGenCand)
334 bool IsRelativelyOmegaMarked(const Generator& rGenPlant, const Generator& rGenCand) {
335 
336 
337  FD_DF("IsRelativelyOmegaMarked(\"" << rGenPlant.Name() << "\", \"" << rGenCand.Name() << "\")");
338 
339  // alphabets must match
340  if ( rGenPlant.Alphabet() != rGenCand.Alphabet()) {
341  std::stringstream errstr;
342  errstr << "Alphabets of generators do not match.";
343  throw Exception("RelativelyOmegaMarked", errstr.str(), 100);
344  }
345 
346 #ifdef FAUDES_CHECKED
347  // generators are meant to be nonblocking
348  if ( !IsOmegaTrim(rGenCand) || !IsOmegaTrim(rGenPlant)) {
349  std::stringstream errstr;
350  errstr << "Arguments are expected to be nonblocking.";
351  throw Exception("IsRelativelyOmegaMarked", errstr.str(), 201);
352  }
353 #endif
354 
355 #ifdef FAUDES_CHECKED
356  // generators are meant to be deterministic
357  if ( !IsDeterministic(rGenCand) || !IsDeterministic(rGenPlant)) {
358  std::stringstream errstr;
359  errstr << "Arguments are expected to be deterministic.";
360  throw Exception("IsRelativelyOmegaMarked", errstr.str(), 202);
361  }
362 #endif
363 
364 
365  // perform composition
366  std::map< std::pair<Idx,Idx> , Idx> revmap;
367  Generator product;
368  product.StateNamesEnabled(false);
369  StateSet markCand;
370  StateSet markPlant;
371  Product(rGenPlant,rGenCand,revmap,markPlant,markCand,product);
372 
373  // find all relevant SCCs
375  markCand,markPlant);
376  std::list<StateSet> umsccs;
377  StateSet umroots;
378  ComputeScc(product,umfilter,umsccs,umroots);
379 
380  // report
381  std::list<StateSet>::iterator ssit=umsccs.begin();
382  for(;ssit!=umsccs.end(); ++ssit) {
383  FD_DF("IsRelativelyOmegaMarked(): GPlant-marked scc without GCand-mark: " << ssit->ToString());
384  }
385 
386  // result is true if no problematic SCCs exist
387  return umsccs.size()==0;
388 
389 
390 }
391 
392 
393 
394 
395 // IsOmegaRelativelyClosed(rGenPlant,rGenCand)
396 bool IsRelativelyOmegaClosed(const Generator& rGenPlant, const Generator& rGenCand) {
397 
398 
399  FD_DF("IsRelativelyOmegaClosed(\"" << rGenPlant.Name() << "\", \"" << rGenCand.Name() << "\")");
400 
401  // alphabets must match
402  if ( rGenPlant.Alphabet() != rGenCand.Alphabet()) {
403  std::stringstream errstr;
404  errstr << "Alphabets of generators do not match.";
405  throw Exception("RelativelyOmegaClosed", errstr.str(), 100);
406  }
407 
408 #ifdef FAUDES_CHECKED
409  // generators are meant to be nonblocking
410  if( !IsOmegaTrim(rGenCand) ) {
411  std::stringstream errstr;
412  errstr << "Argument \"" << rGenCand.Name() << "\" is not omegatrim.";
413  throw Exception("IsRelativelyOmegaClosed", errstr.str(), 201);
414  }
415  if( !IsOmegaTrim(rGenPlant) ) {
416  std::stringstream errstr;
417  errstr << "Argument \"" << rGenPlant.Name() << "\" is not omega-trim.";
418  throw Exception("IsRelativelyOmegaClosed", errstr.str(), 201);
419  }
420 #endif
421 
422 
423  // the trivial case: if B1 is empty it is relatively closed
424  // (we must treat this case because empty generators are not regarded deterministic)
425  if(rGenCand.Empty()) {
426  FD_DF("IsRelativelyOmegaClosed(..): empty candidate: pass");
427  return true;
428  }
429 
430  // the trivial case: if B2 is empty but B1 is not empty, the test failed
431  // (we must treat this case because empty generators are not regarded deterministic)
432  if(rGenPlant.Empty()) {
433  FD_DF("IsRelativelyOmegaClosed(..): non-empty candidate. empty plant: fail");
434  return false;
435  }
436 
437 #ifdef FAUDES_CHECKED
438  // generators are meant to be deterministic
439  if ( !IsDeterministic(rGenCand) || !IsDeterministic(rGenPlant)) {
440  std::stringstream errstr;
441  errstr << "Arguments are expected to be deterministic.";
442  throw Exception("IsRelativelyOmegaClosed", errstr.str(), 202);
443  }
444 #endif
445 
446  // doit
447  return IsRelativelyOmegaClosedUnchecked(rGenPlant,rGenCand);
448 }
449 
450 
451 // IsOmegaRelativelyClosed(rGenPlant,rGenCand)
452 bool IsRelativelyOmegaClosedUnchecked(const Generator& rGenPlant, const Generator& rGenCand) {
453 
454  // perform composition (variant of cfl_parallel.cpp)
455  std::map< std::pair<Idx,Idx> , Idx> revmap;
456  Generator product;
457  product.StateNamesEnabled(false);
458  StateSet mark1;
459  StateSet mark2;
460 
461  // shared alphabet
462  product.InjectAlphabet(rGenCand.Alphabet());
463 
464  // todo stack
465  std::stack< std::pair<Idx,Idx> > todo;
466  // current pair, new pair
467  std::pair<Idx,Idx> currentstates, newstates;
468  // state
469  Idx tmpstate;
470  // iterators
471  StateSet::Iterator lit1, lit2;
472  TransSet::Iterator tit1, tit1_end, tit2, tit2_end;
473  std::map< std::pair<Idx,Idx>, Idx>::iterator rcit;
474  // sense violation of L(G1) <= L(G2)
475  bool inclusion12=true;
476 
477  // push all combinations of initial states on todo stack
478  FD_DF("IsRelativelyOmegaClosed(): Product composition A");
479  for (lit1 = rGenCand.InitStatesBegin();
480  lit1 != rGenCand.InitStatesEnd(); ++lit1) {
481  for (lit2 = rGenPlant.InitStatesBegin();
482  lit2 != rGenPlant.InitStatesEnd(); ++lit2) {
483  currentstates = std::make_pair(*lit1, *lit2);
484  todo.push(currentstates);
485  tmpstate = product.InsInitState();
486  revmap[currentstates] = tmpstate;
487  FD_DF("IsRelativelyOmegaClosed(): Product composition A: (" << *lit1 << "|" << *lit2 << ") -> "
488  << revmap[currentstates]);
489  }
490  }
491 
492  // start algorithm
493  while (! todo.empty() && inclusion12) {
494  // allow for user interrupt
495  LoopCallback();
496  // get next reachable state from todo stack
497  currentstates = todo.top();
498  todo.pop();
499  FD_DF("IsRelativelyOmegaClosed(): Product composition B: (" << currentstates.first << "|"
500  << currentstates.second << ") -> " << revmap[currentstates]);
501  // iterate over all rGenCand transitions
502  tit1 = rGenCand.TransRelBegin(currentstates.first);
503  tit1_end = rGenCand.TransRelEnd(currentstates.first);
504  tit2 = rGenPlant.TransRelBegin(currentstates.second);
505  tit2_end = rGenPlant.TransRelEnd(currentstates.second);
506  Idx curev1=0;
507  bool resolved12=true;
508  while((tit1 != tit1_end) && (tit2 != tit2_end)) {
509  // sense new event
510  if(tit1->Ev != curev1) {
511  if(!resolved12) inclusion12=false;
512  curev1=tit1->Ev;
513  resolved12=false;
514  }
515  // shared event
516  if (tit1->Ev == tit2->Ev) {
517  resolved12=true;
518  newstates = std::make_pair(tit1->X2, tit2->X2);
519  // add to todo list if composition state is new
520  rcit = revmap.find(newstates);
521  if (rcit == revmap.end()) {
522  todo.push(newstates);
523  tmpstate = product.InsState();
524  revmap[newstates] = tmpstate;
525  FD_DF("IsRelativelyOmegaClosed(): Product composition C: (" << newstates.first << "|"
526  << newstates.second << ") -> " << revmap[newstates]);
527  }
528  else {
529  tmpstate = rcit->second;
530  }
531  product.SetTransition(revmap[currentstates], tit1->Ev, tmpstate);
532  ++tit1;
533  ++tit2;
534  }
535  // try resync tit1
536  else if (tit1->Ev < tit2->Ev) {
537  ++tit1;
538  }
539  // try resync tit2
540  else if (tit1->Ev > tit2->Ev) {
541  ++tit2;
542  }
543  }
544  // last event was not resolved in the product
545  if(!resolved12) inclusion12=false;
546  }
547  // report
548 #ifdef FAUDES_DEBUG_FUNCTION
549  FD_DF("IsRelativelyOmegaClosed(): Product: done");
550  if(!inclusion12) {
551  FD_DF("IsRelativelyOmegaClosed(): Product: inclusion L(G1) <= L(G2) not satisfied");
552  }
553 #endif
554 
555  // bail out
556  if(!inclusion12) return false;
557 
558  // retrieve marking from reverse composition map
559  std::map< std::pair<Idx,Idx>, Idx>::iterator rit;
560  for(rit=revmap.begin(); rit!=revmap.end(); ++rit){
561  if(rGenCand.ExistsMarkedState(rit->first.first)) mark1.Insert(rit->second);
562  if(rGenPlant.ExistsMarkedState(rit->first.second)) mark2.Insert(rit->second);
563  }
564 
565  // find all relevant SCCs 1
567  mark1,mark2);
568  std::list<StateSet> umsccs12;
569  StateSet umroots12;
570  ComputeScc(product,umfilter12,umsccs12,umroots12);
571 
572  // report
573  std::list<StateSet>::iterator ssit=umsccs12.begin();
574  for(;ssit!=umsccs12.end(); ++ssit) {
575  FD_DF("IsRelativelyOmegaClosed(): G2-marked scc without G1-mark: " << ssit->ToString());
576  }
577 
578  // result is false if we found problematic SCCs to exist
579  if(umsccs12.size()!=0) return false;
580 
581  // find all relevant SCCs 2
583  mark2,mark1);
584  std::list<StateSet> umsccs21;
585  StateSet umroots21;
586  ComputeScc(product,umfilter21,umsccs21,umroots21);
587 
588  // report
589  ssit=umsccs21.begin();
590  for(;ssit!=umsccs21.end(); ++ssit) {
591  FD_DF("IsRelativelyOmegaClosed(): G1-marked scc without G2-mark: " << ssit->ToString());
592  }
593 
594  // result is false if we found problematic SCCs to exist
595  if(umsccs21.size()!=0) return false;
596 
597  // done, all tests passed
598  FD_DF("IsRelativelyOmegaClosed(): pass");
599  return true;
600 }
601 
602 
603 
604 } // name space
#define FD_DF(message)
Debug: optional report on user functions.
Faudes exception class.
Set of indices.
Definition: cfl_indexset.h:78
Idx Insert(void)
Insert new index to set.
Set of indices with symbolic names.
Definition: cfl_nameset.h:69
Filter for strictly connected components (SCC) search/compute routines.
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
Iterator on transition.
Definition: cfl_transset.h:269
std::string ToString(const std::string &rLabel="", const Type *pContext=0) const
Write configuration data to a string.
Definition: cfl_types.cpp:169
Base class of all FAUDES generators.
StateSet::Iterator StatesBegin(void) const
Iterator to Begin() of state set.
StateSet::Iterator InitStatesBegin(void) const
Iterator to Begin() of mInitStates.
bool SetTransition(Idx x1, Idx ev, Idx x2)
Add a transition to generator by indices.
const EventSet & Alphabet(void) const
Return const reference to alphabet.
virtual void Move(vGenerator &rGen)
Destructive copy to other vGenerator.
TransSet::Iterator TransRelBegin(void) const
Iterator to Begin() of transition relation.
bool Trim(void)
Make generator trim.
virtual vGenerator * New(void) const
Construct on heap.
void Name(const std::string &rName)
Set the generator's name.
bool DelState(Idx index)
Delete a state from generator by index.
StateSet::Iterator StatesEnd(void) const
Iterator to End() of state set.
TransSet::Iterator TransRelEnd(void) const
Iterator to End() of transition relation.
bool IsDeterministic(void) const
Check if generator is deterministic.
Idx InsState(void)
Add new anonymous state to generator.
bool Empty(void) const
Check if generator is empty (no states)
Idx InsInitState(void)
Create new anonymous state and set as initial state.
bool StateNamesEnabled(void) const
Whether libFAUEDS functions are requested to generate state names.
StateSet::Iterator InitStatesEnd(void) const
Iterator to End() of mInitStates.
virtual void Clear(void)
Clear generator data.
bool ExistsMarkedState(Idx index) const
Test existence of state in mMarkedStates.
void InjectAlphabet(const EventSet &rNewalphabet)
Set mpAlphabet without consistency check.
bool Empty(void) const
Test whether if the TBaseSet is Empty.
Definition: cfl_baseset.h:1824
bool Exists(const T &rElem) const
Test existence of element.
Definition: cfl_baseset.h:2115
const std::string & Name(void) const
Return name of TBaseSet.
Definition: cfl_baseset.h:1755
bool ComputeScc(const Generator &rGen, const SccFilter &rFilter, std::list< StateSet > &rSccList, StateSet &rRoots)
Compute strongly connected components (SCC)
bool IsOmegaTrim(const vGenerator &rGen)
RTI wrapper function.
void Product(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
Product composition.
bool IsDeterministic(const vGenerator &rGen)
RTI wrapper function.
bool IsRelativelyMarked(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative marking.
bool IsRelativelyOmegaMarked(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative marking, omega langauges.
bool IsRelativelyPrefixClosed(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative prefix-closedness.
bool IsRelativelyOmegaClosed(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative closedness, omega languages.
void SupRelativelyPrefixClosed(const Generator &rPlantGen, const Generator &rSpecGen, Generator &rResGen)
Supremal Relatively Closed Sublanguage.
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
void LoopCallback(bool pBreak(void))
Definition: cfl_helper.cpp:621
void SupRelativelyPrefixClosedUnchecked(const Generator &rPlantGen, const Generator &rSpecGen, std::map< std::pair< Idx, Idx >, Idx > &rCompositionMap, Generator &rResGen)
Supremal Relatively Closed Sublanguage (internal function)
bool IsNonblocking(const GeneratorVector &rGvec)
std::string CollapsString(const std::string &rString, unsigned int len)
Limit length of string, return head and tail of string.
Definition: cfl_helper.cpp:91
bool IsRelativelyOmegaClosedUnchecked(const Generator &rGenPlant, const Generator &rGenCand)
Test for relative closedness, omega languages.
Misc functions related to synthesis.

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen