op_ex_verification.cpp

Go to the documentation of this file.
00001 
00014 #include <stdio.h>
00015 #include <iostream>
00016 #include <libfaudes.h>
00017 #include <op_observer.h>
00018 
00019 
00020 
00021 int main(int argc, char* argv[])
00022 {
00024   //Verification of the Lm-observer property
00026   
00027   // construct original Generator from file
00028   cGenerator genOrig = Generator("data/ex_verification/ex_isnot_observer.gen");
00029   // construct abstraction alphabet from file
00030   EventSet highAlph = EventSet("data/ex_verification/ex_isnot_observer.alph", "Alphabet");
00031   // verify if the natural projection on highAlph is an Lm-observer and output the result. In this case, the Lm-observer property is violated.
00032   bool observer = IsObs(genOrig, highAlph);
00033   std::cout << "##################################\n";
00034   std::cout << "# Observer verification result: " << observer << endl;
00035   std::cout << "##################################\n";
00036 
00037 
00038   // read a new generator and a new high-level alphabet
00039   genOrig.Read("data/ex_verification/ex_is_observer.gen");
00040   highAlph.Read("data/ex_verification/ex_is_observer.alph", "Alphabet");
00041   // verify if the natural projection on the current highAlph is an Lm-observer and output the result. In this case, the Lm-observer property is fulfilled.
00042   observer = IsObs(genOrig, highAlph);
00043   std::cout << "##################################\n";
00044   std::cout << "Observer verification result: " << observer << endl;
00045   std::cout << "##################################\n";
00046   
00048   //Verification of the output control consistency (OCC) property
00050   
00051   //verify if the natural projection on highAlph fulfills OCC for the previously read generator and alphabet. 
00052     // In this case, OCC is violated.
00053   bool occ = IsOCC(genOrig, highAlph);
00054   std::cout << "###########################\n";
00055   std::cout << "OCC verification result: " << occ << endl;
00056   std::cout << "###########################\n";
00057 
00058   // read a new generator that fulfills OCC together with the previous highAlph
00059   genOrig.Read("data/ex_verification/ex_is_occ.gen");
00060   //Verification of the output control consistency (OCC) property. In this case, OCC is fulfilled.
00061   occ = IsOCC(genOrig, highAlph);
00062   std::cout << "###########################\n";
00063   std::cout << "OCC verification result: " << occ << endl;
00064   std::cout << "###########################\n";
00065   
00067   //Verification of the local control consistency (LCC) property
00069   
00070   //verify if the natural projection on highAlph fulfills LCC. In this case, LCC is fulfilled (OCC implies LCC).
00071   bool lcc = IsLCC(genOrig, highAlph);
00072   std::cout << "###########################\n";
00073   std::cout << "lcc verification result: " << lcc << endl;
00074   std::cout << "###########################\n";
00075   // read a new generator that does not fulfill LCC with highAlph.
00076   genOrig.Read("data/ex_verification/ex_is_observer.gen");
00077   //verify if the natural projection on highAlph fulfills LCC. In this case, LCC is violated.
00078   lcc = IsLCC(genOrig, highAlph);
00079   std::cout << "###########################\n";
00080   std::cout << "lcc verification result: " << lcc << endl;
00081   std::cout << "###########################\n";
00082   // read a new generator that fulfills LCC together with highAlph
00083   genOrig.Read("data/ex_verification/ex_is_lcc.gen");
00084   //Verification of the local control consistency (LCC) property. In this case, LCC is fulfilled.
00085   lcc = IsLCC(genOrig, highAlph);
00086   std::cout << "###########################\n";
00087   std::cout << "lcc verification result: " << lcc << endl;
00088   std::cout << "###########################\n";
00089 
00090 return 0;
00091 }

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