op_ex_synthesis.cpp

Go to the documentation of this file.
00001 
00017 #include <stdio.h>
00018 #include <iostream>
00019 #include <libfaudes.h>
00020 #include <op_observer.h>
00021 
00022 
00023 int main(int argc, char* argv[])
00024 {
00026     //Synthesis of an Lm-observer
00028   
00029   // construct original Generator from file
00030   cGenerator genOrig = Generator("data/ex_synthesis/ex_observer_all.gen");
00031   // construct initial abstraction alphabet from file
00032   EventSet highAlph = EventSet("data/ex_synthesis/ex_observer_all.alph", "Alphabet");
00033   // compute an abstraction that is an Lm-observer while keeping the events in the original abstraction alphabet
00034   EventSet newHighAlph;
00035   cGenerator genObs(genOrig);
00036   map< Idx, set< Idx > > mapRelabeledEvents;
00037   calcAbstAlphObs(genObs, highAlph, newHighAlph, mapRelabeledEvents);
00038   // Write the resulting generator and the new high-level alphabet to a file
00039   genObs.Write("results/ex_synthesis/ex_synthesis_observer_result.gen");
00040   newHighAlph.Write("results/ex_synthesis/ex_synthesis_observer_result.alph");  
00041   // evaluate the natural projection for the resulting generator and high-level alphabet
00042   cGenerator genHigh;
00043   cProject(genObs, newHighAlph, genHigh);
00044   // Write the high-level generator to a file
00045   genHigh.Write("results/ex_synthesis/ex_synthesis_observer_high.gen");
00046   std::cout << "##########################################################################\n";
00047   std::cout << "# Lm-observer computed; the result can be found in the folder./results/ex_synthesis\n";
00048   std::cout << "##########################################################################\n";
00049 
00051   // Synthesis of a natural projection that fulfills local control consistency (LCC)
00053   
00054   // read the oritinal generator and high-level alphabetd from file input
00055   genOrig.Read("data/ex_synthesis/ex_observer_all.gen");
00056   highAlph.Read("data/ex_synthesis/ex_observer_all.alph", "Alphabet");
00057   // compute an abstraction that is an Lm-observer and LCC whilc keeping the events in the original abstraction alphabet
00058   newHighAlph.Clear();
00059   mapRelabeledEvents.clear();
00060   genObs = genOrig;
00061   calcAbstAlphObsLCC(genObs, highAlph, newHighAlph, mapRelabeledEvents);
00062   genObs.Write("results/ex_synthesis/ex_synthesis_lcc_result.gen");
00063   newHighAlph.Write("results/ex_synthesis/ex_synthesis_lcc_result.alph");
00064   // evaluate the natural projection for the resulting generator and high-level alphabet
00065   cProject(genObs, newHighAlph, genHigh);
00066   // Write the high-level generator to a file
00067   genHigh.Write("results/ex_synthesis/ex_synthesis_lcc_high.gen");
00068   std::cout << "################################################################################\n";
00069   std::cout << "# Lm-observer with LCC computed; the result can be found in the folder./results/ex_synthesis\n";
00070   std::cout << "################################################################################\n";
00071   
00073   // Synthesis of a natural projection that fulfills output control consistency (OCC)
00075   
00076   // read the original generator and high-level alphabet from file input
00077   genOrig.Read("data/ex_synthesis/ex_observer_all.gen");
00078   highAlph.Read("data/ex_synthesis/ex_observer_all.alph", "Alphabet");
00079   // compute an abstraction that is an Lm-observer and OCC whilc keeping the events in the original abstraction alphabet
00080   newHighAlph.Clear();
00081   mapRelabeledEvents.clear();
00082   genObs = genOrig;
00083   calcAbstAlphObsOCC(genObs, highAlph, newHighAlph, mapRelabeledEvents);
00084   genObs.Write("results/ex_synthesis/ex_synthesis_occ_result.gen");
00085   newHighAlph.Write("results/ex_synthesis/ex_synthesis_occ_result.alph");
00086   // evaluate the natural projection for the resulting generator and high-level alphabet
00087   cProject(genObs, newHighAlph, genHigh);
00088   // Write the high-level generator to a file
00089   genHigh.Write("results/ex_synthesis/ex_synthesis_occ_high.gen");
00090   std::cout << "################################################################################\n";
00091   std::cout << "# Lm-observer with OCC computed; the result can be found in the folder./results/ex_synthesis\n";
00092   std::cout << "################################################################################\n";
00093 
00094 
00095   
00096 
00097 return 0;
00098 }

Generated on Fri May 9 11:26:47 2008 for libFAUDES 2.09b by  doxygen 1.4.4