Thie tutorial describes the computation of a natural projection that is
#include <stdio.h> #include <iostream> #include <libfaudes.h> #include <op_observer.h> int main(int argc, char* argv[]) { //Synthesis of an Lm-observer // construct original Generator from file cGenerator genOrig = Generator("data/ex_synthesis/ex_observer_all.gen"); // construct initial abstraction alphabet from file EventSet highAlph = EventSet("data/ex_synthesis/ex_observer_all.alph", "Alphabet"); // compute an abstraction that is an Lm-observer while keeping the events in the original abstraction alphabet EventSet newHighAlph; cGenerator genObs(genOrig); map< Idx, set< Idx > > mapRelabeledEvents; calcAbstAlphObs(genObs, highAlph, newHighAlph, mapRelabeledEvents); // Write the resulting generator and the new high-level alphabet to a file genObs.Write("results/ex_synthesis/ex_synthesis_observer_result.gen"); newHighAlph.Write("results/ex_synthesis/ex_synthesis_observer_result.alph"); // evaluate the natural projection for the resulting generator and high-level alphabet cGenerator genHigh; cProject(genObs, newHighAlph, genHigh); // Write the high-level generator to a file genHigh.Write("results/ex_synthesis/ex_synthesis_observer_high.gen"); std::cout << "##########################################################################\n"; std::cout << "# Lm-observer computed; the result can be found in the folder./results/ex_synthesis\n"; std::cout << "##########################################################################\n"; // Synthesis of a natural projection that fulfills local control consistency (LCC) // read the oritinal generator and high-level alphabetd from file input genOrig.Read("data/ex_synthesis/ex_observer_all.gen"); highAlph.Read("data/ex_synthesis/ex_observer_all.alph", "Alphabet"); // compute an abstraction that is an Lm-observer and LCC whilc keeping the events in the original abstraction alphabet newHighAlph.Clear(); mapRelabeledEvents.clear(); genObs = genOrig; calcAbstAlphObsLCC(genObs, highAlph, newHighAlph, mapRelabeledEvents); genObs.Write("results/ex_synthesis/ex_synthesis_lcc_result.gen"); newHighAlph.Write("results/ex_synthesis/ex_synthesis_lcc_result.alph"); // evaluate the natural projection for the resulting generator and high-level alphabet cProject(genObs, newHighAlph, genHigh); // Write the high-level generator to a file genHigh.Write("results/ex_synthesis/ex_synthesis_lcc_high.gen"); std::cout << "################################################################################\n"; std::cout << "# Lm-observer with LCC computed; the result can be found in the folder./results/ex_synthesis\n"; std::cout << "################################################################################\n"; // Synthesis of a natural projection that fulfills output control consistency (OCC) // read the original generator and high-level alphabet from file input genOrig.Read("data/ex_synthesis/ex_observer_all.gen"); highAlph.Read("data/ex_synthesis/ex_observer_all.alph", "Alphabet"); // compute an abstraction that is an Lm-observer and OCC whilc keeping the events in the original abstraction alphabet newHighAlph.Clear(); mapRelabeledEvents.clear(); genObs = genOrig; calcAbstAlphObsOCC(genObs, highAlph, newHighAlph, mapRelabeledEvents); genObs.Write("results/ex_synthesis/ex_synthesis_occ_result.gen"); newHighAlph.Write("results/ex_synthesis/ex_synthesis_occ_result.alph"); // evaluate the natural projection for the resulting generator and high-level alphabet cProject(genObs, newHighAlph, genHigh); // Write the high-level generator to a file genHigh.Write("results/ex_synthesis/ex_synthesis_occ_high.gen"); std::cout << "################################################################################\n"; std::cout << "# Lm-observer with OCC computed; the result can be found in the folder./results/ex_synthesis\n"; std::cout << "################################################################################\n"; return 0; }
Definition in file op_ex_synthesis.cpp.
#include <stdio.h>
#include <iostream>
#include <libfaudes.h>
#include <op_observer.h>
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
|
Definition at line 23 of file op_ex_synthesis.cpp. |