ios_2_synthesis.cpp
Go to the documentation of this file.
1 /** @file ios_2_synthesis.cpp
2 
3 Tutorial, I/O system synthesis
4 
5 This tutorial runs the two examples from
6 the techical report Moor/Schmidt/Wittmann, 2010.
7 It thereby demonstrates the use of the provided
8 functions for the synthesis of I/O controllers.
9 
10 @ingroup Tutorials
11 
12 @include ios_2_synthesis.cpp
13 
14 */
15 
16 
17 #include "libfaudes.h"
18 
19 
20 // make the faudes namespace available to our program
21 using namespace faudes;
22 
23 
24 
25 /////////////////
26 // main program
27 /////////////////
28 
29 int main() {
30 
31  // Read plant and speification generators
32  IoSystem planta("data/ios_planta.gen");
33  Generator speca("data/ios_speca.gen");
34 
35  // Adjust specification alphabet
36  InvProject(speca,planta.Alphabet());
37 
38  // Run synthesis algorithm
39  IoSystem supera;
40  supera.StateNamesEnabled(false);
41  IoSynthesis(planta,speca,supera);
42  aStateMin(supera,supera);
43 
44  // Report to console
45  std::cout << "################################\n";
46  std::cout << "# tutorial, supervisor a \n";
47  supera.DWrite();
48  std::cout << "################################\n";
49 
50 
51  // Read plant and speification generators
52  IoSystem plantb("data/ios_plantb.gen");
53  Generator specb("data/ios_specb.gen");
54 
55  // Adjust specification alphabet
56  InvProject(specb,plantb.Alphabet());
57 
58  // Run synthesis algorithm
59  IoSystem superb;
60  superb.StateNamesEnabled(false);
61  IoSynthesisNB(plantb,specb,superb);
62  aStateMin(superb,superb);
63 
64  // Report to console
65  std::cout << "################################\n";
66  std::cout << "# tutorial, supervisor b \n";
67  superb.DWrite();
68  std::cout << "################################\n";
69 
70  // Record testcase
71  FAUDES_TEST_DUMP("supA",supera);
72  FAUDES_TEST_DUMP("supB",superb);
73 
74  // Done
75  return 0;
76 }
77 
78 
79 
#define FAUDES_TEST_DUMP(mes, dat)
Test protocol record macro ("mangle" filename for platform independance)
Definition: cfl_helper.h:483
const TaEventSet< EventAttr > & Alphabet(void) const
Return const reference to alphabet.
Generator with I/O-system attributes.
Definition: ios_system.h:34
void DWrite(const Type *pContext=0) const
Write configuration data to console, debugging format.
Definition: cfl_types.cpp:225
Base class of all FAUDES generators.
bool StateNamesEnabled(void) const
Whether libFAUEDS functions are requested to generate state names.
void aStateMin(const Generator &rGen, Generator &rResGen)
State set minimization.
void InvProject(Generator &rGen, const EventSet &rProjectAlphabet)
Inverse projection.
int main()
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
void IoSynthesisNB(const IoSystem &rPlant, const Generator &rSpec, IoSystem &rSup)
IO system synthesis.
void IoSynthesis(const IoSystem &rPlant, const Generator &rSpec, IoSystem &rSup)
IO system synthesis.

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