1_generator.cpp
Go to the documentation of this file.
1 /** @file 1_generator.cpp
2 
3 Tutorial, Generator methods.
4 
5 The Generator class implements the 5-tuple automaton G, consisting of
6 - Set of States Q,
7 - Alphabet Sigma,
8 - Transition Relation Delta,
9 - Set of Initial States Qo, and
10 - Set of Marked States Qm.
11 
12 This tutorial demonstrates how to insert/erase states, events and transitions.
13 It also demonstrates file IO.
14 
15 @ingroup Tutorials
16 
17 @include 1_generator.cpp
18 */
19 
20 
21 #include "libfaudes.h"
22 
23 // make faudes namespace available
24 using namespace faudes;
25 
26 
27 
28 /////////////////
29 // main program
30 /////////////////
31 
32 int main() {
33 
34  ////////////////////////////////////////////
35  // Constructors (part 1) and filling example
36  ////////////////////////////////////////////
37 
38  // at first we create an empty Generator object
39 
40  Generator g1;
41 
42  // mimique some typical setup procedure for g1
43 
44  g1.InsState("s1");
45  g1.InsState("s2");
46  g1.InsState("s3");
47 
48  g1.InsEvent("a");
49  g1.InsEvent("b");
50  g1.InsEvent("c");
51 
52  g1.SetTransition("s1", "a", "s2");
53  g1.SetTransition("s2", "a", "s3");
54  g1.SetTransition("s3", "b", "s1");
55  g1.SetTransition("s3", "c", "s3");
56 
57  g1.SetInitState("s1");
58  g1.SetMarkedState("s2");
59  g1.SetMarkedState("s3");
60 
61  // inspect result on console
62 
63  std::cout << "################################\n";
64  std::cout << "# tutorial, handcraft generator \n";
65  g1.Write();
66  std::cout << "################################\n";
67 
68  // record test case
69  FAUDES_TEST_DUMP("g1", g1);
70 
71 
72 
73  ///////////////////////////////////////////////////
74  // Constructors (part 2) & Copying and versioning
75  ///////////////////////////////////////////////////
76 
77  // Create a 1:1 copy of the Generator with the copy constructor ...
78 
79  Generator g_copy(g1);
80 
81  // ... with assignment method, or assignement operator
82 
83  Generator g2;
84  g2.Assign(g1);
85  Generator g3=g2;
86 
87  // create a Generator copy with versioned events (for testing algorithms):
88  // versioning by an integer. E.g. for integer 3 events {"a", "b", "c"}
89  // become {"a_3", "b_3", "c_3"}.
90 
91  Generator version1;
92  g3.Version(3, version1);
93 
94  // versioning by a string. "a" -> "a_versionstring"
95 
96  Generator version2;
97  g3.Version("str", version2);
98 
99  // versioning by replacing a pattern "_str" -> "_machine_3"
100 
101  Generator version3;
102  version2.Version("_str", "_machine_3",version3);
103 
104  // editing by renaming an individual event
105 
106  version3.EventRename("a_machine_3","synch");
107 
108  // inspect result on console
109 
110  std::cout << "################################\n";
111  std::cout << "# tutorial, version of generator \n";
112  version3.Write();
113  std::cout << "################################\n";
114 
115  // editing by general relabelimng scheme
116  RelabelMap rlmap;
117  rlmap.Insert("a","x"); // a becomes x
118  rlmap.Insert("b","y"); // b becomes ...
119  rlmap.Insert("b","z"); // ... y and z
120  rlmap.Insert("c"); // c gets deleted
121  Generator g2alt;
122  ApplyRelabelMap(rlmap,g2,g2alt);
123 
124  std::cout << "################################\n";
125  std::cout << "# tutorial, relabeled generator \n";
126  g2alt.Write();
127  std::cout << "################################\n";
128 
129 
130  // record test case
131  FAUDES_TEST_DUMP("generator", version1);
132  FAUDES_TEST_DUMP("relabel", g2alt);
133 
134 
135  ///////////////////////////////////////////////
136  // Methods for Input/Output
137  ///////////////////////////////////////////////
138 
139  // read a Generator from file
140 
141  g3.Read("data/simplemachine.gen");
142 
143  // create a Generator by reading a Generator file
144 
145  Generator g4("data/simplemachine.gen");
146 
147 
148  // write a Generator to file
149 
150  g4.Write("tmp_simplemachine.gen");
151  g2.Write("tmp_toberelabeled.gen");
152  g2alt.Write("tmp_relabeled.gen");
153 
154  // write a Generator to file with re-indexed states
155 
156  g4.ReindexOnWrite(true);
157  g4.Write("tmp_simplemachine_ridx.gen");
158 
159  // read back files (testing token io)
160  g4.Read("tmp_simplemachine.gen");
161  g4.Read("tmp_simplemachine_ridx.gen");
162 
163  // debug output of Generator to console
164 
165  std::cout << "################################\n";
166  std::cout << "# tutorial, debug dump \n";
167  g4.DWrite();
168  std::cout << "################################\n";
169 
170  // create dotfile for further processing by graphviz
171  // (map state indices to begin with 1)
172 
173  g4.DotWrite("tmp_simplemachine.dot");
174  g4.DDotWrite("tmp_simplemachine_debug.dot");
175 
176  // there also is a convenience method, that runs graphviz to
177  // generate graphical output; requires "dot" binary in $PATH
178  try {
179  g4.GraphWrite("tmp_simplemachinie.png");
180  } catch(faudes::Exception& exception) {
181  std::cout << "1_generator: cannot execute graphviz' dot. " << std::endl;
182  }
183 
184 
185  // create a debug string for an event with symbolic name + index
186 
187  std::string str_singleevent = g1.EStr(2);
188 
189  // create a debug string for a state with symbolic name + index.
190  // If there is no symblic name, a symbolic name of the index is constructed.
191 
192  std::string str_singlestate = g1.SStr(3);
193 
194  // build string of events in the Generator's alphabet
195 
196  std::string str_alph = g1.AlphabetToString();
197 
198  // build string of states in the Generator's set of states
199  std::string str_states = g1.StatesToString();
200 
201  // there also are TransRelToString(), InitStatesToString() and MarkedStatesToString()
202 
203 
204  //////////////////////////////////////
205  // Accessing the Generator's Members
206  //////////////////////////////////////
207 
208  // get the Generator's name
209 
210  std::string str_name = g1.Name();
211 
212  // set new name for Generator
213 
214  g1.Name("NewName");
215 
216 
217 
218  // the core members alphabet, stateset and transitionrelation may be retrieved
219  // as const references; ie. they can be inspected freely, but write access is
220  // exclusively via the provided Generator methods.
221 
222  // retrieve a const reference to and copy of the Generator's alphabet
223 
224  const EventSet& eset_ref_alph = g1.Alphabet();
225  EventSet eset_copy_alph = g1.Alphabet();
226 
227  // you cannot alter the alphabet of a generator via an alphabet method
228  // eset_ref_alph.Insert("new_event"); // compile time error!
229 
230  // however, the copy can be altered, but with no effect on the original generator
231 
232  eset_copy_alph.Insert("new_event");
233  if(g1.ExistsEvent("new_event")) std::cout << "### THIS CANNOT HAPPEN ###";
234 
235  // retrieve a const reference to and copy of the Generator's set of states "mStates"
236 
237  const StateSet& sset_ref_states = g1.States();
238  StateSet sset_copy_states = g1.States();
239 
240  // retrieve a const reference to and a copy of the Generator's transition relation "mTransRel"
241 
242  const TransSet& tset_ref_trel = g1.TransRel();
243  TransSet tset_copy_trel = g1.TransRel();
244 
245  // same with initial states and marked states
246 
247  const StateSet& sset_ref_istates = g1.InitStates();
248  StateSet sset_copy_istates = g1.InitStates();
249 
250  const StateSet& sset_ref_mstates = g1.MarkedStates();
251  StateSet sset_copy_mstates = g1.MarkedStates();
252 
253 
254 
255  //////////////////////////////////////////////////////////////////////////////
256  // Modifying the 5-tuple Generator (X, Sigma, Delta, X0 and Xm)
257  //////////////////////////////////////////////////////////////////////////////
258 
259  // insert an event by it's symbolic name in the alphabet
260  // (if the event is not known so far, a new index for the symbolic name is generated)
261  g1.InsEvent("newevent");
262 
263 
264  // insert an existing event into the Generator's alphabet (mAlphabet)
265  // (by "existing event" we refer to an event that has been previously inserted to some Generator)
266 
267  g1.InsEvent(1); // of course index 1 is already in the alphabet here...
268 
269  // insert a bunch of events (EventSet) and get the integer index if requested
270 
271  EventSet eset1;
272  eset1.Insert("newevent1");
273  Idx idx_tmp = eset1.Insert("newevent2");
274  g1.InsEvents(eset1);
275 
276  // delete an event from Generator ie delete from alphabet and transition relation
277 
278  g1.DelEvent("newevent1"); // by symbolic name
279  g1.DelEvent(idx_tmp); // by index
280 
281  // delete a bunch of events
282  // g1.DelEvents(eset1); // .. of course we have already deleted them before...
283 
284  // insert a new state. The state gets a integer index that is unique within
285  // the Generator
286 
287  idx_tmp = g1.InsState(); // anonymous state
288  idx_tmp = g1.InsState("newstate2"); // named state
289  idx_tmp = g1.InsState("77"); // named state
290 
291  // insert a new state as initial state
292 
293  idx_tmp = g1.InsInitState();
294  idx_tmp = g1.InsInitState("newinitstate");
295 
296  // ... same for marked states
297 
298  idx_tmp = g1.InsMarkedState();
299  idx_tmp = g1.InsMarkedState("newmarkedstate");
300 
301 
302  // delete single states from Generator ie stateset and transitionrelation
303 
304  g1.DelState(idx_tmp); // by index (relatively fast, for algorithms)
305  g1.DelState("newinitstate"); // by symbolic name, if name assigned
306 
307  // delete a bunch of states
308  // (this should be more efficient than deleting states individually)
309 
310  StateSet stateset1;
311  stateset1.Insert(1);
312  stateset1.Insert(2);
313  stateset1.Insert(3);
314  g1.DelStates(stateset1);
315 
316  // for further proceeding we insert some new states and events...
317 
318  Idx idx_s10 = g1.InsState("s10");
319  Idx idx_s11 = g1.InsState("s11");
320  Idx idx_s12 = g1.InsState("s12");
321  Idx idx_e10 = g1.InsEvent("e10");
322  Idx idx_e11 = g1.InsEvent("e11");
323 
324  // set a state that already exists in Generator as initial state
325 
326  g1.SetInitState(idx_s10);
327 
328  // set a state that already exists in Generator as marked state
329 
330  g1.SetMarkedState(idx_s11);
331 
332  // unset an existing state as initial state (does not remove from mStates)
333 
334  g1.ClrInitState(idx_s10);
335 
336  // unset an existing state as marked state (does not remove from stateset)
337 
338  g1.ClrMarkedState(idx_s10);
339 
340  // clear all initial states (does not remove from stateset)
341 
342  // g1.ClrInitStates(); // we do not really do it here, so it's commented
343 
344  // clear all marked states (mStates stays untouched)
345 
346  // g1.ClrMarkedStates(); // we do not really do it here, so it's commented
347 
348  // set a transition for existing states and events
349 
350  g1.SetTransition(idx_s10, idx_e10, idx_s11); // by indices
351  g1.SetTransition("s10", "e11", "s10"); // by symbolic names (slow)
352 
353 
354  // report back to console
355 
356  std::cout << "################################\n";
357  std::cout << "# tutorial, on the way ... \n";
358  g1.Write();
359  std::cout << "################################\n";
360 
361 
362  // clear a transition (does not touch mStates, mInitStates and mMarkedStates)
363 
364  g1.ClrTransition(idx_s10, idx_e10, idx_s11); // by index
365 
366  // transitions can also be cleared by names (slower) or by an assigned
367  // TransSet::Iterator (faster); use ClearTransRel() to remove all transitions
368 
369 
370  // clear the symbolic name for a state in the StateSymbolTable
371 
372  g1.ClrStateName(idx_s10);
373 
374  // exists event index/name in mAlphabet?
375 
376  bool bool_eventexists1 = g1.ExistsEvent("e11");
377  bool bool_eventexists2 = g1.ExistsEvent(2);
378 
379 
380  // exists state in mStates?
381 
382  bool bool_stateexists1 = g1.ExistsState(4);
383 
384 
385  // check if a state is an initial state
386 
387  bool bool_initstateexists = g1.ExistsInitState(4);
388 
389  // check if a state is a marked state
390 
391  bool bool_ismarkedstate = g1.ExistsMarkedState(4);
392 
393  // look up event name for index in the EventSymbolTable of the event domain
394 
395  std::string str_eventname1 = g1.EventName(1);
396 
397  // look up event index for name in the EventSymbolTable of the event domain
398 
399  Idx idx_eventindex = g1.EventIndex("e11");
400 
401  // get symbolic name assigned to state (returns "" if no name assigned).
402 
403  std::string str_tmp = g1.StateName(idx_s10);
404 
405  // get index for symbolic state name. only possible for state names of states in
406  // the Generator
407 
408  idx_tmp = g1.StateIndex("s12");
409 
410  // clear Generator (including alphabet)
411 
412  g4.Clear();
413 
414  // get the number of events in the Generator's alphabet
415 
416  Idx idx_eventnum = g1.AlphabetSize();
417 
418  // get the number of states
419 
420  Idx idx_statenum = g1.Size();
421 
422  // get the number of transitions
423 
424  Idx idx_transnum = g1.TransRelSize();
425 
426  // there also are InitStatesSize(), MarkedStatesSize()
427 
428  // is the alphabet of the Generator empty?
429 
430  bool bool_alphempty = g1.AlphabetEmpty();
431 
432  // is the Generator empty (number of states == 0) ?
433 
434  bool bool_isempty = g1.Empty();
435 
436  // see also TransRelEmpty, InitStatesEmpty, MarkedStatesEmpty
437 
438 
439  // insert a small loop
440 
441  Idx initstate = g1.InsInitState("in");
442  Idx markedstate = g1.InsMarkedState("out");
443  g1.SetTransition("in","a","out");
444  g1.SetTransition("out","a","in");
445 
446 
447  // show effect on console
448 
449  std::cout << "################################\n";
450  std::cout << "# tutorial, after ins and del \n";
451  g1.DWrite();
452  std::cout << "################################\n";
453 
454  // record test case
455  FAUDES_TEST_DUMP("g1, edited", g1);
456 
457  ///////////////////////
458  // Iterators
459  ///////////////////////
460 
461  // since the core members are all implemented as sets, iterators
462  // effectively are const_iterators, i.e. you cannot change the
463  // current value of an iterator. instead you may remove the value
464  // and insert the new value.
465 
466  // iteration over alphabet indices (member "mAlphabet")
467 
468  std::cout << "################################\n";
469  std::cout << "# tutorial, iterators 1 \n";
470  EventSet::Iterator eit;
471  for (eit = g1.AlphabetBegin(); eit != g1.AlphabetEnd(); ++eit) {
472  std::cout << "event \"" << g1.EventName(*eit) << "\" with index "<< *eit << std::endl;
473  }
474  std::cout << "################################\n";
475 
476  // iteration over state indices (member "mStates")
477 
478  std::cout << "################################\n";
479  std::cout << "# tutorial, iterators 2 \n";
480  StateSet::Iterator sit;
481  for (sit = g1.StatesBegin(); sit != g1.StatesEnd(); ++sit) {
482  std::cout << *sit << std::endl;
483  }
484  std::cout << "################################\n";
485 
486  // iteration over complete transition relation (member "mTransRel")
487 
488  std::cout << "################################\n";
489  std::cout << "# tutorial, iterators 3 \n";
490  TransSet::Iterator tit;
491  for (tit = g1.TransRelBegin(); tit != g1.TransRelEnd(); ++tit) {
492  std::cout << g1.TStr(*tit) << std::endl;
493  }
494  std::cout << "################################\n";
495 
496  // iteration over transitions from a given state; note that we avoid
497  // computation of the end of the iteration in every step
498 
499  std::cout << "################################\n";
500  std::cout << "# tutorial, iterators 4 \n";
501  idx_tmp = g1.StateIndex("s1");
502  TransSet::Iterator tit_end;
503  tit = g1.TransRelBegin(idx_tmp);
504  tit_end = g1.TransRelEnd(idx_tmp);
505  for (; tit != tit_end; ++tit) {
506  std::cout << g1.TStr(*tit) << std::endl;
507  }
508  std::cout << "################################\n";
509 
510  // variations: transitions of given state index + given event index:
511  // TransRelBegin(x1, ev) - TransRelEnd(x1, ev)
512 
513  // iteration over initial and marked states:
514  // InitStatesBegin() - InitStatesEnd() (member "mInitStates")
515  // MarkedStatesBegin() - MarkedStatesEnd() (member "mMarkedStates")
516 
517 
518  ////////////////////////////////////////////////////////////
519  // retrieve copies of the Generator's transition releation
520  // in different sorting orders than X1 -> Ev -> X2
521  ////////////////////////////////////////////////////////////
522 
523  // note: the availabity of iterator ranges depends on the sorting order;
524  // eg iteration with specified x2 requires X2->Ev->X1 or X2->X1->Ev sorting.
525 
526  // retrieve a copy that is sorted by X2 -> Ev -> X1 by the binary
527  // predicate TransSort::X2EvX1.
528 
529  TransSetX2EvX1 tset_x2evx1;
530  g1.TransRel(tset_x2evx1);
531 
532  // report to console
533 
534  std::cout << "################################\n";
535  std::cout << "# tutorial, x2-ev-x1 sorting\n";
537  for (tit2 = tset_x2evx1.Begin(); tit2 != tset_x2evx1.End(); ++tit2) {
538  std::cout << g1.TStr(*tit2) << std::endl;
539  }
540  std::cout << "################################\n";
541 
542 
543 
544  ////////////////////////
545  // Convenience Methods
546  ////////////////////////
547 
548  // remove all events from mAlphabet, that do not have a transition in
549  // mTransRel: g1.MinimizeAlphabet()
550 
551  // get an EventSet containing all the events that drive some transition
552 
553  EventSet eset_usedevents = g1.UsedEvents();
554 
555  // get an EventSet containing all the events that do not drive any transition
556 
557  EventSet eset_unusedevents = g1.UnusedEvents();
558 
559  // return the active event set at a given state
560 
561  EventSet eset_activeeventset = g1.ActiveEventSet(idx_s12);
562 
563  // return a StateSet containing all the states that are connected by
564  // some transition
565 
566  StateSet sset_trel_sspace = g1.TransRelStates();
567 
568  // return a StateSet containing all the successor states of a given predecessor
569  // state.
570 
571  StateSet sset_successors = g1.SuccessorStates(idx_s12);
572 
573  // note: if you need predecessor states, use a resorted transition relation
574 
575  /////////////////////////////////
576  // Symbolic state name handling
577  /////////////////////////////////
578 
579  // are symbolic state names enabled? depending on this boolean value
580  // library functions like Determine or StateMin may create symbolic
581  // state names automatically
582 
583  bool bool_statenamesenabled = g1.StateNamesEnabled();
584 
585  // disable state name creation in resulting generators for functions in
586  // the faudes library, that support this feature (nearly all) with
587  // "false"; enable state name creation with "true".
588 
589  g1.StateNamesEnabled(true); // anyway .. true is the default value
590 
591  // clear existing symbolic statenames for states in the Generator
592 
593  // g1.ClearStateNames();
594 
595  // set symbolic names for all states in the generator. the symbolic name becomes
596  // the equivalent string representation of the state's integer index. This is
597  // only usefull for debugging purposes.
598 
600 
601 
602  // show effect on console
603 
604  std::cout << "################################\n";
605  std::cout << "# tutorial, default names \n";
606  g1.Write();
607  std::cout << "################################\n";
608 
609 
610  ///////////////////////////////////
611  // Accessible, Coaccessible, Complete, Trim
612  ///////////////////////////////////
613 
614  // read example generator for reachability analysis
615  Generator greach("data/trimness_nottrim.gen");
616 
617  std::cout << "################################\n";
618  std::cout << "# tutorial, reachability test case \n";
619  greach.Write();
620  std::cout << "# tutorial, reachability relevant sets \n";
621  StateSet astates = greach.AccessibleSet();
622  StateSet cstates = greach.CoaccessibleSet();
623  StateSet tstates = greach.TerminalStates();
624  astates.Write();
625  cstates.Write();
626  tstates.Write();
627  std::cout << "# tutorial, reachability analysis \n";
628  bool isacc = greach.IsAccessible();
629  if(isacc)
630  std::cout << "accesibility: ok [error]\n";
631  else
632  std::cout << "accesibility: failed [expected]\n";
633  bool iscoacc = greach.IsCoaccessible();
634  if(iscoacc)
635  std::cout << "coaccesibility: ok [error]\n";
636  else
637  std::cout << "coaccesibility: failed [expected]\n";
638  bool iscompl = greach.IsComplete();
639  if(iscompl)
640  std::cout << "completeness: ok [error]\n";
641  else
642  std::cout << "completeness: failed [expected]\n";
643  bool istrim = greach.IsTrim();
644  if(istrim)
645  std::cout << "trimness: ok [error]\n";
646  else
647  std::cout << "trimness: failed [expected]\n";
648  bool isotrim = IsBuechiTrim(greach);
649  if(isotrim)
650  std::cout << "w-trimness: ok [error]\n";
651  else
652  std::cout << "w-trimness: failed [expected]\n";
653  std::cout << "################################\n";
654 
655  // record test case
656  FAUDES_TEST_DUMP("acc",astates);
657  FAUDES_TEST_DUMP("coacc",cstates);
658  FAUDES_TEST_DUMP("term",tstates);
659 
660  // Make the Generator accessible by removing transitions and states.
661  // The routine returns true if the generator has an initial state.
662  Generator gaccess(greach);
663  gaccess.Name("GAccessible");
664  bool bool_hasinit = gaccess.Accessible();
665 
666  // Make the Generator coaccessible by removing transitions and states.
667  // The routine returns true if the generator has a marked state.
668  Generator gcoaccess(greach);
669  gcoaccess.Name("GCoccessible");
670  bool bool_hasmarked = gcoaccess.Coaccessible();
671 
672  // Make the Generator complete by removing transitions and states.
673  // The routine returns true if the generator has an initial state.
674  Generator gcompl(greach);
675  gcompl.Name("GComplete");
676  gcompl.Complete();
677 
678  // Make the Generator trim by removing transitions and states.
679  // The routine returns true if the generator has an initial state
680  // and a marked state.
681  Generator gtrim(greach);
682  gtrim.Name("GTrim");
683  bool bool_isnontrivial = gtrim.Trim();
684 
685  // Make the Generator omega-trim by removing transitions and states.
686  // The routine returns true if the generator has an initial state
687  // and a marked state.
688  Generator gotrim(greach);
689  gotrim.Name("GOmegaTrim");
690  BuechiTrim(gotrim);
691 
692  // show effect on console
693  std::cout << "################################\n";
694  std::cout << "# tutorial, reachability results \n";
695  gaccess.Write();
696  gcoaccess.Write();
697  gcompl.Write();
698  gtrim.Write();
699  gotrim.Write();
700  std::cout << "################################\n";
701 
702  // contribute to html docu
703  greach.Write("tmp_greach.gen");
704  gaccess.Write("tmp_gaccess.gen");
705  gcoaccess.Write("tmp_gcoaccess.gen");
706  gcompl.Write("tmp_gcompl.gen");
707  gtrim.Write("tmp_gtrim.gen");
708  gotrim.Write("tmp_gotrim.gen");
709 
710  // Test protocol
711  FAUDES_TEST_DUMP("accessible",gaccess);
712  FAUDES_TEST_DUMP("coaccessible",gcoaccess);
713  FAUDES_TEST_DUMP("complete",gcompl);
714  FAUDES_TEST_DUMP("trim",gtrim);
715  FAUDES_TEST_DUMP("omega trim",gotrim);
716 
717 
718  ///////////////////////////////////
719  // Generalized Completeness
720  ///////////////////////////////////
721 
722  // read example generator for generalized completeness
723  Generator gsigcomplB("data/trimness_nottrim.gen");
724  Generator gsigcomplC("data/trimness_nottrim.gen");
725  EventSet sigoB;
726  sigoB.FromString("<A> b </A>");
727  EventSet sigoC;
728  sigoC.FromString("<A> c </A>");
729 
730  std::cout << "################################\n";
731  std::cout << "# tutorial, sigma_o-completeness test case \n";
732  greach.Write();
733  bool issigcompl = gsigcomplB.IsComplete(sigoB);
734  if(iscompl)
735  std::cout << "completeness: ok [error]\n";
736  else
737  std::cout << "completeness: failed [expected]\n";
738 
739 
740  // Make the Generator complete by removing transitions and states.
741  // The routine returns true if the generator has an initial state.
742  gsigcomplB.Name("GSigoCompleteB");
743  gsigcomplB.Complete(sigoB);
744  gsigcomplC.Name("GSigoCompleteC");
745  gsigcomplC.Complete(sigoC);
746 
747  // record test case
748  FAUDES_TEST_DUMP("iscmpl",issigcompl);
749  FAUDES_TEST_DUMP("gsigcomplB",gsigcomplB);
750  FAUDES_TEST_DUMP("gsigcomplC",gsigcomplC);
751 
752  // contribute to html docu
753  gsigcomplB.Write("tmp_gsigcomplb.gen");
754  gsigcomplC.Write("tmp_gsigcomplc.gen");
755 
756 
757  ///////////////////////////////////
758  // Test case evaluation
759  ///////////////////////////////////
761 
762  return 0;
763 }
764 
765 
766 
int main()
Definition: 1_generator.cpp:32
#define FAUDES_TEST_DIFF()
Definition: cfl_utils.h:515
#define FAUDES_TEST_DUMP(mes, dat)
Definition: cfl_utils.h:505
const std::string & Name(void) const
Definition: cfl_types.cpp:422
bool Insert(const Idx &rIndex)
virtual bool Insert(const Idx &rSrc, const Idx &rDst)
Iterator Begin(void) const
Iterator End(void) const
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator
Definition: cfl_transset.h:273
void DWrite(const Type *pContext=0) const
Definition: cfl_types.cpp:231
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
Definition: cfl_types.cpp:267
void FromString(const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
Definition: cfl_types.cpp:281
void Write(const Type *pContext=0) const
Definition: cfl_types.cpp:145
StateSet::Iterator StatesBegin(void) const
const TransSet & TransRel(void) const
bool SetTransition(Idx x1, Idx ev, Idx x2)
const StateSet & MarkedStates(void) const
const EventSet & Alphabet(void) const
virtual void DDotWrite(const std::string &rFileName) const
virtual vGenerator & Assign(const Type &rSrc)
std::string StatesToString(void) const
EventSet ActiveEventSet(Idx x1) const
const StateSet & InitStates(void) const
TransSet::Iterator TransRelBegin(void) const
void ClrTransition(Idx x1, Idx ev, Idx x2)
Idx StateIndex(const std::string &rName) const
bool DelEvent(Idx index)
bool IsAccessible(void) const
void InsEvents(const EventSet &events)
void ClrMarkedState(Idx index)
bool EventRename(Idx event, const std::string &rNewName)
EventSet::Iterator AlphabetBegin(void) const
StateSet TransRelStates(void) const
bool IsComplete(void) const
void ClrStateName(Idx index)
void SetInitState(Idx index)
StateSet AccessibleSet(void) const
Idx EventIndex(const std::string &rName) const
bool ExistsState(Idx index) const
bool IsCoaccessible(void) const
std::string TStr(const Transition &rTrans) const
std::string StateName(Idx index) const
virtual void DotWrite(const std::string &rFileName) const
bool DelState(Idx index)
StateSet::Iterator StatesEnd(void) const
void ClrInitState(Idx index)
void DelStates(const StateSet &rDelStates)
TransSet::Iterator TransRelEnd(void) const
bool ExistsEvent(Idx index) const
std::string EStr(Idx index) const
StateSet TerminalStates(void) const
void SetMarkedState(Idx index)
bool Empty(void) const
bool ReindexOnWrite(void) const
bool StateNamesEnabled(void) const
bool InsEvent(Idx index)
void SetDefaultStateNames(void)
void GraphWrite(const std::string &rFileName, const std::string &rOutFormat="", const std::string &rDotExec="dot") const
Idx TransRelSize(void) const
virtual void Version(const std::string &rVersion, vGenerator &rResGen) const
EventSet UsedEvents(void) const
EventSet UnusedEvents(void) const
std::string EventName(Idx index) const
EventSet::Iterator AlphabetEnd(void) const
bool IsTrim(void) const
StateSet CoaccessibleSet(void) const
Idx Size(void) const
Idx AlphabetSize(void) const
bool ExistsInitState(Idx index) const
std::string SStr(Idx index) const
virtual void Clear(void)
bool ExistsMarkedState(Idx index) const
std::string AlphabetToString(void) const
const StateSet & States(void) const
StateSet SuccessorStates(Idx x1) const
bool AlphabetEmpty(void) const
bool BuechiTrim(vGenerator &rGen)
uint32_t Idx
void ApplyRelabelMap(const RelabelMap &rMap, const vGenerator &rGen, vGenerator &rRes)
bool IsBuechiTrim(const vGenerator &rGen)

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