op_ex_verification.cpp File Reference

Tutorial, verification of properties of natural projections. More...

#include <stdio.h>
#include <iostream>
#include "libfaudes.h"
#include "op_include.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Tutorial, verification of properties of natural projections.

This tutorial explains the routines for verifying if the Lm-observer condition, output control consistency (OCC) or local control consistency (LCC) are fulfilled for a given natural projection. The computations are carried out with a given generator and a given high-level alphabet.

/** @file op_ex_verification.cpp
Tutorial, verification of properties of natural projections.
This tutorial explains the routines for verifying if the Lm-observer condition, output control consistency (OCC)
or local control consistency (LCC) are fulfilled for a given natural projection. The computations are carried out
with a given generator and a given high-level alphabet.
@ingroup Tutorials
@include op_ex_verification.cpp
*/
#include <stdio.h>
#include <iostream>
#include "libfaudes.h"
#include "op_include.h"
// make libFAUDES namespace available
using namespace faudes;
int main(int argc, char* argv[]) {
//////////////////////////////////////////
//Verification of the Lm-observer property
//////////////////////////////////////////
// construct original Generator from file
System genOrig = Generator("data/ex_verification/ex_isnot_observer.gen");
// construct abstraction alphabet from file
EventSet highAlph = EventSet("data/ex_verification/ex_isnot_observer.alph", "Alphabet");
// verify if the natural projection on highAlph is an Lm-observer and output the result.
// In this example, the Lm-observer property is violated.
bool observer = IsObs(genOrig, highAlph);
std::cout << "##################################\n";
std::cout << "# Observer verification result: " << observer << std::endl;
std::cout << "##################################\n";
// read a new generator and a new high-level alphabet
genOrig.Read("data/ex_verification/ex_is_observer.gen");
highAlph.Read("data/ex_verification/ex_is_observer.alph", "Alphabet");
// verify if the natural projection on the current highAlph is an Lm-observer and output the result.
// In this example, the Lm-observer property is fulfilled.
observer = IsObs(genOrig, highAlph);
std::cout << "##################################\n";
std::cout << "Observer verification result: " << observer << std::endl;
std::cout << "##################################\n";
///////////////////////////////////////////////////////////////
//Verification of the output control consistency (OCC) property
///////////////////////////////////////////////////////////////
//verify if the natural projection on highAlph fulfills OCC for the previously read generator and alphabet.
// In this example, OCC is violated.
bool occ = IsOCC(genOrig, highAlph);
std::cout << "###########################\n";
std::cout << "OCC verification result: " << occ << std::endl;
std::cout << "###########################\n";
// read a new generator that fulfills OCC together with the previous highAlph
genOrig.Read("data/ex_verification/ex_is_occ.gen");
//Verification of the output control consistency (OCC) property. In this case, OCC is fulfilled.
occ = IsOCC(genOrig, highAlph);
std::cout << "###########################\n";
std::cout << "OCC verification result: " << occ << std::endl;
std::cout << "###########################\n";
//////////////////////////////////////////////////////////////
//Verification of the local control consistency (LCC) property
//////////////////////////////////////////////////////////////
//verify if the natural projection on highAlph fulfills LCC. In this case, LCC is fulfilled (OCC implies LCC).
bool lcc = IsLCC(genOrig, highAlph);
std::cout << "###########################\n";
std::cout << "lcc verification result: " << lcc << std::endl;
std::cout << "###########################\n";
// read a new generator that does not fulfill LCC with highAlph.
genOrig.Read("data/ex_verification/ex_is_observer.gen");
//verify if the natural projection on highAlph fulfills LCC. In this case, LCC is violated.
lcc = IsLCC(genOrig, highAlph);
std::cout << "###########################\n";
std::cout << "lcc verification result: " << lcc << std::endl;
std::cout << "###########################\n";
// read a new generator that fulfills LCC together with highAlph
genOrig.Read("data/ex_verification/ex_is_lcc.gen");
//Verification of the local control consistency (LCC) property. In this case, LCC is fulfilled.
lcc = IsLCC(genOrig, highAlph);
std::cout << "###########################\n";
std::cout << "lcc verification result: " << lcc << std::endl;
std::cout << "###########################\n";
return 0;
}
int main(int argc, char *argv[])
NameSet EventSet
Convenience typedef for plain event sets.
Definition: cfl_nameset.h:531
vGenerator Generator
Plain generator, api typedef for generator with no attributes.
TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > System
Convenience typedef for std System.
bool IsOCC(const System &rLowGen, const EventSet &rHighAlph)
Verification of output control consistency (OCC).
bool IsLCC(const System &rLowGen, const EventSet &rHighAlph)
Verification of local control consistency (LCC).
bool IsObs(const Generator &rLowGen, const EventSet &rHighAlph)
Verification of the natural observer property.
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
Includes all observer plugin headers.

Definition in file op_ex_verification.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 23 of file op_ex_verification.cpp.

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