omg_4_rabinctrl.cpp File Reference
#include "libfaudes.h"

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

Supervision of omega-languages w.r.t. Rabin acceptance

/** @file omg_4_rabinctrl.cpp
Supervision of omega-languages w.r.t. Rabin acceptance
@ingroup Tutorials
@include omg_4_rabinctrl.cpp
*/
#include "libfaudes.h"
// we make the faudes namespace available to our program
using namespace faudes;
int main() {
// Early stage of development ... see whether we can recover
// the test cases from Buechi supervisory control.
/////////////////////////////////////////////
// Control w.r.t Rabin specifications
//
// The A-B-Machine is a machine that can run process A (event a) or process B (event b).
// Per operation, the machine may succeed (event c) of fail (event d). However, it is
// guaranteed to eventually suceed when running the same process over and over again.
// We have three variations:
//
// 1: the std case
// 2: process B exhausts the machine: it will succeed in process B once and then
// fail on further processes B until process A was run.
// 3: process B breaks the machine: it will succeed in process B once and
// then fail in any further processes
//
// We synthesise controllers for 3 variant specifications
//
// 1. Alternate in successfully processing A and B
// 2. Keep on eventually succeeding in some process
// 3. Run optionally process A, eventually turn to B until success, repeat
//
/////////////////////////////////////////////
// Read A-B-Machines and specifications
System machineab1("data/omg_machineab1.gen");
System machineab2("data/omg_machineab2.gen");
System machineab3("data/omg_machineab3.gen");
Generator specab1("data/omg_specab1.gen");
Generator specab2("data/omg_specab2.gen");
Generator specab3("data/omg_specab3.gen");
// compute a controllability prefix
const System& plant=machineab1;
const Generator& spec=specab3;
EventSet sigall = plant.Alphabet() + spec.Alphabet();
EventSet sigctrl = plant.ControllableEvents();
RabinAutomaton cand=spec;
cand.RabinAcceptance(cand.MarkedStates());
InvProject(cand,sigall);
Automaton(cand);
RabinBuechiProduct(cand,plant,cand);
//RabinBuechiAutomaton(cand,plant,cand);
cand.Write();
StateSet ctrlpfx;
RabinCtrlPfx(cand,sigctrl,ctrlpfx);
cand.WriteStateSet(ctrlpfx);
cand.RestrictStates(ctrlpfx);
// SupClosed(cand)
cand.RabinAcceptanceWrite();
cand.GraphWrite("tmp_omg_rabinctrl13.png");
Generator test=cand;
test.StateNamesEnabled(false);
test.InjectMarkedStates(cand.RabinAcceptance().Begin()->RSet());
StateMin(test,test);
test.GraphWrite("tmp_omg_rabinctrl13_test.png");
return 0;
}
bool StateNamesEnabled(void) const
int main(int argc, char *argv[])
Definition: fts2ftx.cpp:59
IndexSet StateSet
Definition: cfl_indexset.h:273
NameSet EventSet
Definition: cfl_nameset.h:534
vGenerator Generator
TcGenerator< AttributeVoid, AttributeVoid, AttributeCFlags, AttributeVoid > System
void StateMin(const Generator &rGen, Generator &rResGen)
void Automaton(Generator &rGen, const EventSet &rAlphabet)
void InvProject(Generator &rGen, const EventSet &rProjectAlphabet)
void RabinBuechiProduct(const RabinAutomaton &rRAut, const Generator &rBAut, RabinAutomaton &rRes)
void RabinCtrlPfx(const RabinAutomaton &rRAut, const EventSet &rSigmaCtrl, StateSet &rCtrlPfx)
TrGenerator< RabinAcceptance, AttributeVoid, AttributeCFlags, AttributeVoid > RabinAutomaton
Definition: omg_rabinaut.h:224

Definition in file omg_4_rabinctrl.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 18 of file omg_4_rabinctrl.cpp.

libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen