cfl_omega.cpp
Go to the documentation of this file.
1 /** @file cfl_omega.cpp
2 
3 Operations regarding omega languages.
4 
5 */
6 
7 /* FAU Discrete Event Systems Library (libfaudes)
8 
9 Copyright (C) 2010 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 
27 #include "cfl_omega.h"
28 
29 #include "cfl_parallel.h"
30 #include "cfl_project.h"
31 #include "cfl_graphfncts.h"
32 
33 
34 namespace faudes {
35 
36 
37 // helper class for omega compositions
38 class OPState {
39 public:
40  // minimal interface
41  OPState() {};
42  OPState(const Idx& rq1, const Idx& rq2, const bool& rf) :
43  q1(rq1), q2(rq2), m1required(rf), mresolved(false) {};
44  std::string Str(void) { return ToStringInteger(q1)+"|"+
46  // order
47  bool operator < (const OPState& other) const {
48  if (q1 < other.q1) return(true);
49  if (q1 > other.q1) return(false);
50  if (q2 < other.q2) return(true);
51  if (q2 > other.q2) return(false);
52  if (!m1required && other.m1required) return(true);
53  if (m1required && !other.m1required) return(false);
54  if (!mresolved && other.mresolved) return(true);
55  return(false);
56  }
57  // member variables
60  bool m1required;
61  bool mresolved;
62 };
63 
64 
65 
66 // OmegaProduct for Generators, transparent for event attributes.
68  const Generator& rGen1,
69  const Generator& rGen2,
70  Generator& rResGen)
71 {
72 
73  // inputs have to agree on attributes of shared events:
74  bool careattr=rGen1.Alphabet().EqualAttributes(rGen2.Alphabet());
75 
76  // prepare result
77  Generator* pResGen = &rResGen;
78  if(&rResGen== &rGen1 || &rResGen== &rGen2) {
79  pResGen= rResGen.New();
80  }
81 
82  // make product composition of inputs
83  OmegaProduct(rGen1,rGen2,*pResGen);
84 
85  // copy all attributes of input alphabets
86  if(careattr) {
87  pResGen->EventAttributes(rGen1.Alphabet());
88  pResGen->EventAttributes(rGen2.Alphabet());
89  }
90 
91  // copy result
92  if(pResGen != &rResGen) {
93  pResGen->Move(rResGen);
94  delete pResGen;
95  }
96 
97 }
98 
99 
100 
101 // OmegaProduct(rGen1, rGen2, res)
103  const Generator& rGen1, const Generator& rGen2,
104  Generator& rResGen)
105 {
106  FD_DF("OmegaProduct(" << &rGen1 << "," << &rGen2 << ")");
107 
108  // prepare result
109  Generator* pResGen = &rResGen;
110  if(&rResGen== &rGen1 || &rResGen== &rGen2) {
111  pResGen= rResGen.New();
112  }
113  pResGen->Clear();
114  pResGen->Name(CollapsString(rGen1.Name()+".x."+rGen2.Name()));
115 
116  // create res alphabet
117  pResGen->InsEvents(rGen1.Alphabet());
118  pResGen->InsEvents(rGen2.Alphabet());
119 
120  // reverse composition map
121  std::map< OPState, Idx> reverseCompositionMap;
122  // todo stack
123  std::stack< OPState > todo;
124  // current pair, new pair
125  OPState currentstates, newstates;
126  // state
127  Idx tmpstate;
128  StateSet::Iterator lit1, lit2;
129  TransSet::Iterator tit1, tit1_end, tit2, tit2_end;
130  std::map< OPState, Idx>::iterator rcit;
131  // push all combinations of initial states on todo stack
132  FD_DF("OmegaProduct: adding all combinations of initial states to todo:");
133  for (lit1 = rGen1.InitStatesBegin(); lit1 != rGen1.InitStatesEnd(); ++lit1) {
134  for (lit2 = rGen2.InitStatesBegin(); lit2 != rGen2.InitStatesEnd(); ++lit2) {
135  currentstates = OPState(*lit1, *lit2, true);
136  todo.push(currentstates);
137  reverseCompositionMap[currentstates] = pResGen->InsInitState();
138  FD_DF("OmegaProduct: " << currentstates.Str() << " -> " << reverseCompositionMap[currentstates]);
139  }
140  }
141 
142  // start algorithm
143  FD_DF("OmegaProduct: processing reachable states:");
144  while (! todo.empty()) {
145  // allow for user interrupt
146  LoopCallback();
147  // get next reachable state from todo stack
148  currentstates = todo.top();
149  todo.pop();
150  FD_DF("OmegaProduct: processing (" << currentstates.Str() << " -> " << reverseCompositionMap[currentstates]);
151  // iterate over all rGen1 transitions
152  tit1 = rGen1.TransRelBegin(currentstates.q1);
153  tit1_end = rGen1.TransRelEnd(currentstates.q1);
154  for(; tit1 != tit1_end; ++tit1) {
155  // find transition in rGen2
156  tit2 = rGen2.TransRelBegin(currentstates.q2, tit1->Ev);
157  tit2_end = rGen2.TransRelEnd(currentstates.q2, tit1->Ev);
158  for (; tit2 != tit2_end; ++tit2) {
159  newstates = OPState(tit1->X2, tit2->X2,currentstates.m1required);
160  // figure whether marking was resolved
161  if(currentstates.m1required) {
162  if(rGen1.ExistsMarkedState(currentstates.q1))
163  newstates.m1required=false;
164  } else {
165  if(rGen2.ExistsMarkedState(currentstates.q2))
166  newstates.m1required=true;
167  }
168  // add to todo list if composition state is new
169  rcit = reverseCompositionMap.find(newstates);
170  if(rcit == reverseCompositionMap.end()) {
171  todo.push(newstates);
172  tmpstate = pResGen->InsState();
173  if(!newstates.m1required)
174  if(rGen2.ExistsMarkedState(newstates.q2))
175  pResGen->SetMarkedState(tmpstate);
176  reverseCompositionMap[newstates] = tmpstate;
177  FD_DF("OmegaProduct: todo push: (" << newstates.Str() << ") -> " << reverseCompositionMap[newstates]);
178  }
179  else {
180  tmpstate = rcit->second;
181  }
182  pResGen->SetTransition(reverseCompositionMap[currentstates],
183  tit1->Ev, tmpstate);
184  FD_DF("OmegaProduct: add transition to new generator: " <<
185  pResGen->TStr(Transition(reverseCompositionMap[currentstates], tit1->Ev, tmpstate)));
186  }
187  }
188  }
189 
190  FD_DF("OmegaProduct: marked states: " << pResGen->MarkedStatesToString());
191 
192 
193  // fix statenames ...
194  if(rGen1.StateNamesEnabled() && rGen2.StateNamesEnabled() && rResGen.StateNamesEnabled())
195  for(rcit=reverseCompositionMap.begin(); rcit!=reverseCompositionMap.end(); rcit++) {
196  Idx x1=rcit->first.q1;
197  Idx x2=rcit->first.q2;
198  bool m1requ=rcit->first.m1required;
199  Idx x12=rcit->second;
200  if(!pResGen->ExistsState(x12)) continue;
201  std::string name1= rGen1.StateName(x1);
202  if(name1=="") name1=ToStringInteger(x1);
203  std::string name2= rGen2.StateName(x2);
204  if(name2=="") name1=ToStringInteger(x2);
205  std::string name12 = name1 + "|" + name2;
206  if(m1requ) name12 += "|r1m";
207  else name12 +="|r2m";
208  name12=pResGen->UniqueStateName(name12);
209  pResGen->StateName(x12,name12);
210  }
211 
212  // .. or clear them (?)
213  if(!(rGen1.StateNamesEnabled() && rGen2.StateNamesEnabled() && rResGen.StateNamesEnabled()))
214  pResGen->StateNamesEnabled(false);
215 
216  // copy result
217  if(pResGen != &rResGen) {
218  pResGen->Move(rResGen);
219  delete pResGen;
220  }
221 }
222 
223 
224 
225 // OmegaParallel for Generators, transparent for event attributes.
227  const Generator& rGen1,
228  const Generator& rGen2,
229  Generator& rResGen)
230 {
231 
232  // inputs have to agree on attributes of shared events:
233  bool careattr=rGen1.Alphabet().EqualAttributes(rGen2.Alphabet());
234 
235  // prepare result
236  Generator* pResGen = &rResGen;
237  if(&rResGen== &rGen1 || &rResGen== &rGen2) {
238  pResGen= rResGen.New();
239  }
240 
241  // make product composition of inputs
242  OmegaParallel(rGen1,rGen2,*pResGen);
243 
244  // copy all attributes of input alphabets
245  if(careattr) {
246  pResGen->EventAttributes(rGen1.Alphabet());
247  pResGen->EventAttributes(rGen2.Alphabet());
248  }
249 
250  // copy result
251  if(pResGen != &rResGen) {
252  pResGen->Move(rResGen);
253  delete pResGen;
254  }
255 
256 }
257 
258 
259 
260 // OmegaParallel(rGen1, rGen2, res)
262  const Generator& rGen1, const Generator& rGen2,
263  Generator& rResGen)
264 {
265  FD_DF("OmegaParallel(" << &rGen1 << "," << &rGen2 << ")");
266  // prepare result
267  Generator* pResGen = &rResGen;
268  if(&rResGen== &rGen1 || &rResGen== &rGen2) {
269  pResGen= rResGen.New();
270  }
271  pResGen->Clear();
272  pResGen->Name(CollapsString(rGen1.Name()+"|||"+rGen2.Name()));
273  // create res alphabet
274  pResGen->InsEvents(rGen1.Alphabet());
275  pResGen->InsEvents(rGen2.Alphabet());
276  // shared events
277  EventSet sharedalphabet = rGen1.Alphabet() * rGen2.Alphabet();
278  FD_DF("OmegaParallel: g1 events: " << rGen1.Alphabet().ToString());
279  FD_DF("OmegaParallel: g2 events: " << rGen2.Alphabet().ToString());
280  FD_DF("OmegaParallel: shared events: " << sharedalphabet.ToString());
281 
282  // reverse composition map
283  std::map< OPState, Idx> reverseCompositionMap;
284  // todo stack
285  std::stack< OPState > todo;
286  // current pair, new pair
287  OPState currentstates, newstates;
288  // state
289  Idx tmpstate;
290  StateSet::Iterator lit1, lit2;
291  TransSet::Iterator tit1, tit1_end, tit2, tit2_end;
292  std::map< OPState, Idx>::iterator rcit;
293  // push all combinations of initial states on todo stack
294  FD_DF("OmegaParallel: adding all combinations of initial states to todo:");
295  for (lit1 = rGen1.InitStatesBegin(); lit1 != rGen1.InitStatesEnd(); ++lit1) {
296  for (lit2 = rGen2.InitStatesBegin(); lit2 != rGen2.InitStatesEnd(); ++lit2) {
297  currentstates = OPState(*lit1, *lit2, true);
298  tmpstate=pResGen->InsInitState();
299  if(rGen2.ExistsMarkedState(*lit2)) {
300  currentstates.mresolved=true;
301  pResGen->SetMarkedState(tmpstate);
302  }
303  todo.push(currentstates);
304  reverseCompositionMap[currentstates] = tmpstate;
305  FD_DF("OmegaParallel: " << currentstates.Str() << " -> " << tmpstate);
306  }
307  }
308 
309  // start algorithm
310  FD_DF("OmegaParallel: processing reachable states:");
311  while (! todo.empty()) {
312  // allow for user interrupt
313  LoopCallback();
314  // get next reachable state from todo stack
315  currentstates = todo.top();
316  todo.pop();
317  FD_DF("OmegaParallel: processing (" << currentstates.Str() << " -> "
318  << reverseCompositionMap[currentstates]);
319  // iterate over all rGen1 transitions
320  // (includes execution of shared events)
321  tit1 = rGen1.TransRelBegin(currentstates.q1);
322  tit1_end = rGen1.TransRelEnd(currentstates.q1);
323  for(; tit1 != tit1_end; ++tit1) {
324  // if event not shared
325  if(! sharedalphabet.Exists(tit1->Ev)) {
326  FD_DF("OmegaParallel: exists only in rGen1");
327  newstates = OPState(tit1->X2, currentstates.q2, currentstates.m1required);
328  // figure whether marking is resolved
329  // (tmoor 201208: only m1required can be resolved, since only G1 proceeds)
330  if(currentstates.m1required) {
331  if(rGen1.ExistsMarkedState(newstates.q1)) {
332  newstates.m1required=false;
333  //newstates.mresolved=true; // optional
334  }
335  }
336  // add to todo list if composition state is new
337  rcit = reverseCompositionMap.find(newstates);
338  if (rcit == reverseCompositionMap.end()) {
339  todo.push(newstates);
340  tmpstate = pResGen->InsState();
341  if(newstates.mresolved) pResGen->SetMarkedState(tmpstate);
342  reverseCompositionMap[newstates] = tmpstate;
343  FD_DF("OmegaParallel: todo push: " << newstates.Str() << "|"
344  << reverseCompositionMap[newstates]);
345  }
346  else {
347  tmpstate = rcit->second;
348  }
349  // insert transition to result
350  pResGen->SetTransition(reverseCompositionMap[currentstates], tit1->Ev,
351  tmpstate);
352  FD_DF("OmegaParallel: add transition to new generator: " <<
353  pResGen->TStr(Transition(reverseCompositionMap[currentstates], tit1->Ev, tmpstate)));
354  }
355  // if shared event
356  else {
357  FD_DF("OmegaParallel: common event");
358  // find shared transitions
359  tit2 = rGen2.TransRelBegin(currentstates.q2, tit1->Ev);
360  tit2_end = rGen2.TransRelEnd(currentstates.q2, tit1->Ev);
361  for (; tit2 != tit2_end; ++tit2) {
362  newstates = OPState(tit1->X2,tit2->X2,currentstates.m1required);
363  // figure whether marking was resolved
364  // (tmoor 201208: both markings can be resolved, since both G1 and G2 proceed)
365  if(currentstates.m1required) {
366  if(rGen1.ExistsMarkedState(newstates.q1)) {
367  newstates.m1required=false;
368  //newstates.mresolved=true; // optional
369  }
370  } else {
371  if(rGen2.ExistsMarkedState(newstates.q2)) {
372  newstates.m1required=true;
373  newstates.mresolved=true;
374  }
375  }
376  // add to todo list if composition state is new
377  rcit = reverseCompositionMap.find(newstates);
378  if (rcit == reverseCompositionMap.end()) {
379  todo.push(newstates);
380  tmpstate = pResGen->InsState();
381  if(newstates.mresolved) pResGen->SetMarkedState(tmpstate);
382  reverseCompositionMap[newstates] = tmpstate;
383  FD_DF("OmegaParallel: todo push: (" << newstates.Str() << ") -> "
384  << reverseCompositionMap[newstates]);
385  }
386  else {
387  tmpstate = rcit->second;
388  }
389  pResGen->SetTransition(reverseCompositionMap[currentstates],
390  tit1->Ev, tmpstate);
391  FD_DF("OmegaParallel: add transition to new generator: " <<
392  pResGen->TStr(Transition(reverseCompositionMap[currentstates], tit1->Ev, tmpstate)));
393  }
394  }
395  }
396  // iterate over all remaining rGen2 transitions
397  // (without execution of shared events)
398  tit2 = rGen2.TransRelBegin(currentstates.q2);
399  tit2_end = rGen2.TransRelEnd(currentstates.q2);
400  for (; tit2 != tit2_end; ++tit2) {
401  if (! sharedalphabet.Exists(tit2->Ev)) {
402  FD_DF("OmegaParallel: exists only in rGen2: " << sharedalphabet.Str(tit2->Ev));
403  newstates = OPState(currentstates.q1, tit2->X2, currentstates.m1required);
404  // figure whether marking was resolved
405  // (tmoor 201208: only m2required=!m1required can be resolved, since only G2 proceeds)
406  if(!currentstates.m1required) {
407  if(rGen2.ExistsMarkedState(newstates.q2)) {
408  newstates.m1required=true;
409  newstates.mresolved=true;
410  }
411  }
412  FD_DF("OmegaParallel: set trans: " << currentstates.Str() << " " << newstates.Str());
413  // add to todo list if composition state is new
414  rcit = reverseCompositionMap.find(newstates);
415  if (rcit == reverseCompositionMap.end()) {
416  todo.push(newstates);
417  tmpstate = pResGen->InsState();
418  if(newstates.mresolved) pResGen->SetMarkedState(tmpstate);
419  reverseCompositionMap[newstates] = tmpstate;
420  FD_DF("OmegaParallel: todo push: " << newstates.Str() << " -> "
421  << reverseCompositionMap[newstates]);
422  }
423  else {
424  tmpstate = rcit->second;
425  }
426  pResGen->SetTransition(reverseCompositionMap[currentstates],
427  tit2->Ev, tmpstate);
428  FD_DF("OmegaParallel: add transition to new generator: " <<
429  pResGen->TStr(Transition(reverseCompositionMap[currentstates], tit2->Ev, tmpstate)));
430  }
431  }
432  }
433 
434  FD_DF("OmegaParallel: marked states: " << pResGen->MarkedStatesToString());
435 
436  // fix statenames ...
437  if(rGen1.StateNamesEnabled() && rGen2.StateNamesEnabled() && rResGen.StateNamesEnabled())
438  for(rcit=reverseCompositionMap.begin(); rcit!=reverseCompositionMap.end(); rcit++) {
439  Idx x1=rcit->first.q1;
440  Idx x2=rcit->first.q2;
441  bool m1requ=rcit->first.m1required;
442  bool mres=rcit->first.mresolved;
443  Idx x12=rcit->second;
444  if(!pResGen->ExistsState(x12)) continue;
445  std::string name1= rGen1.StateName(x1);
446  if(name1=="") name1=ToStringInteger(x1);
447  std::string name2= rGen2.StateName(x2);
448  if(name2=="") name1=ToStringInteger(x2);
449  std::string name12 = name1 + "|" + name2 ;
450  if(m1requ) name12 += "|r1m";
451  else name12 +="|r2m";
452  if(mres) name12 += "*";
453  name12=pResGen->UniqueStateName(name12);
454  pResGen->StateName(x12,name12);
455  }
456 
457  // .. or clear them (?)
458  if(!(rGen1.StateNamesEnabled() && rGen2.StateNamesEnabled() && rResGen.StateNamesEnabled()))
459  pResGen->StateNamesEnabled(false);
460 
461  // copy result
462  if(pResGen != &rResGen) {
463  pResGen->Move(rResGen);
464  delete pResGen;
465  }
466 }
467 
468 
469 // OmegaClosure(rGen)
470 void OmegaClosure(Generator& rGen) {
471  FD_DF("OmegaClosure("<< rGen.Name() << ")");
472 
473  // fix name
474  std::string name=CollapsString("OmegaClosure("+ rGen.Name() + ")");
475 
476  // remove all states that do net represent prefixes of marked strings
477  rGen.OmegaTrim();
478 
479  // mark all remaining states
480  rGen.InjectMarkedStates(rGen.States());
481 
482  // set name
483  rGen.Name(name);
484 }
485 
486 
487 // IsOmegaClosed
488 bool IsOmegaClosed(const Generator& rGen) {
489 
490  FD_DF("IsOmegaClosed("<< rGen.Name() << ")");
491 
492  // figure irrelevant states: not coaccessible / accessible
493  StateSet irrelevant = rGen.States();
494  irrelevant.EraseSet(rGen.AccessibleSet()* rGen.CoaccessibleSet());
495 
496  // figure irrelevant states: terminal
497  irrelevant.InsertSet(rGen.TerminalStates());
498 
499  // iterative search on indirect terminal states ...
500  bool done;
501  do {
502  // ... over all states
503  StateSet::Iterator sit = rGen.States().Begin();
504  StateSet::Iterator sit_end = rGen.States().End();
505  done=true;
506  for(; sit!=sit_end; ++sit) {
507  if(irrelevant.Exists(*sit)) continue;
508  TransSet::Iterator tit = rGen.TransRelBegin(*sit);
509  TransSet::Iterator tit_end = rGen.TransRelEnd(*sit);
510  for (; tit != tit_end; ++tit) {
511  if(!irrelevant.Exists(tit->X2)) break;
512  }
513  if(tit==tit_end) {
514  irrelevant.Insert(*sit);
515  done=false;
516  }
517  }
518  } while(!done);
519 
520  // marked states are irrelevant here
521  irrelevant.InsertSet(rGen.MarkedStates());
522 
523  // report
524 #ifdef FAUDES_DEBUG_FUNCTION
525  FD_DF("IsOmegaClosed(..): irrelevant states "<< irrelevant.ToString());
526 #endif
527 
528  // locate unmarked SCCs
529  // find all relevant SCCs
531  std::list<StateSet> umsccs;
532  StateSet umroots;
533  ComputeScc(rGen,umfilter,umsccs,umroots);
534 
535  // report
536 #ifdef FAUDES_DEBUG_FUNCTION
537  std::list<StateSet>::iterator ssit=umsccs.begin();
538  for(;ssit!=umsccs.end(); ++ssit) {
539  FD_DF("IsOmegaClosed(): GPlant-marked scc without GCand-mark: " << ssit->ToString());
540  }
541 #endif
542 
543  // done
544  return umsccs.empty();
545 
546 }
547 
548 
549 
550 } // namespace faudes
551 
#define FD_DF(message)
Debug: optional report on user functions.
Operations on (directed) graphs.
Operations on omega languages.
parallel composition
language projection
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
bool Exists(const Idx &rIndex) const
Test existence of index.
std::string Str(const Idx &rIndex) const
Return pretty printable symbolic name for index.
bool operator<(const OPState &other) const
Definition: cfl_omega.cpp:47
OPState(const Idx &rq1, const Idx &rq2, const bool &rf)
Definition: cfl_omega.cpp:42
std::string Str(void)
Definition: cfl_omega.cpp:44
Filter for strictly connected components (SCC) search/compute routines.
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
Iterator on transition.
Definition: cfl_transset.h:269
Triple (X1,Ev,X2) to represent current state, event and next state.
Definition: cfl_transset.h:57
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 InitStatesBegin(void) const
Iterator to Begin() of mInitStates.
bool SetTransition(Idx x1, Idx ev, Idx x2)
Add a transition to generator by indices.
const StateSet & MarkedStates(void) const
Return const ref of marked states.
const EventSet & Alphabet(void) const
Return const reference to alphabet.
virtual void Move(vGenerator &rGen)
Destructive copy to other vGenerator.
std::string MarkedStatesToString(void) const
Write set of marked states to a string (no re-indexing)
TransSet::Iterator TransRelBegin(void) const
Iterator to Begin() of transition relation.
void InsEvents(const EventSet &events)
Add new named events to generator.
virtual vGenerator * New(void) const
Construct on heap.
void InjectMarkedStates(const StateSet &rNewMarkedStates)
Replace mMarkedStates with StateSet given as parameter without consistency checks.
StateSet AccessibleSet(void) const
Compute set of accessible states.
bool ExistsState(Idx index) const
Test existence of state in state set.
std::string TStr(const Transition &rTrans) const
Return pretty printable transition (eg for debugging)
std::string StateName(Idx index) const
State name lookup.
void Name(const std::string &rName)
Set the generator's name.
TransSet::Iterator TransRelEnd(void) const
Iterator to End() of transition relation.
StateSet TerminalStates(void) const
Compute set of terminal states.
Idx InsState(void)
Add new anonymous state to generator.
void SetMarkedState(Idx index)
Set an existing state as marked state by index.
Idx InsInitState(void)
Create new anonymous state and set as initial state.
virtual void EventAttributes(const EventSet &rEventSet)
Set attributes for existing events.
bool StateNamesEnabled(void) const
Whether libFAUEDS functions are requested to generate state names.
StateSet::Iterator InitStatesEnd(void) const
Iterator to End() of mInitStates.
StateSet CoaccessibleSet(void) const
Compute set of Coaccessible states.
bool OmegaTrim(void)
Make generator omega-trim.
virtual void Clear(void)
Clear generator data.
bool ExistsMarkedState(Idx index) const
Test existence of state in mMarkedStates.
std::string UniqueStateName(const std::string &rName) const
Create a new unique symbolic state name.
const StateSet & States(void) const
Return reference to state set.
bool Exists(const T &rElem) const
Test existence of element.
Definition: cfl_baseset.h:2115
Iterator End(void) const
Iterator to the end of set.
Definition: cfl_baseset.h:1896
virtual void InsertSet(const TBaseSet &rOtherSet)
Insert elements given by rOtherSet.
Definition: cfl_baseset.h:1987
bool EqualAttributes(const TBaseSet &rOtherSet) const
Attribute access.
Definition: cfl_baseset.h:2196
Iterator Begin(void) const
Iterator to the begin of set.
Definition: cfl_baseset.h:1891
virtual void EraseSet(const TBaseSet &rOtherSet)
Erase elements given by other set.
Definition: cfl_baseset.h:2042
void aOmegaProduct(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
Product composition for Buechi automata.
Definition: cfl_omega.cpp:67
bool ComputeScc(const Generator &rGen, const SccFilter &rFilter, std::list< StateSet > &rSccList, StateSet &rRoots)
Compute strongly connected components (SCC)
bool IsOmegaClosed(const Generator &rGen)
Test for topologically closed omega language.
Definition: cfl_omega.cpp:488
void OmegaParallel(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
Parallel composition with relaxed acceptance condition.
Definition: cfl_omega.cpp:261
void OmegaClosure(Generator &rGen)
Topological closure.
Definition: cfl_omega.cpp:470
void OmegaProduct(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
Product composition for Buechi automata.
Definition: cfl_omega.cpp:102
void aOmegaParallel(const Generator &rGen1, const Generator &rGen2, Generator &rResGen)
Parallel composition with relaxed acceptance condition.
Definition: cfl_omega.cpp:226
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
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
std::string ToStringInteger(Int number)
integer to string
Definition: cfl_helper.cpp:43

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