DiaDes
0.1
DIAgnosis of Discrete-Event System
|
This file implements the dd-project command that is used to perform any kind of automata projection. More...
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <regex>
#include <boost/program_options.hpp>
#include <diades/automata/experimental/AutFile.hh>
#include <diades/automata/experimental/DdAutFile.hh>
#include <diades/automata/experimental/Printer.hh>
#include <diades/automata/experimental/StateMachine.hh>
#include <diades/automata/experimental/Project.hh>
#include "../AutomataInterface.hh"
#include "diades/automata/experimental/DdAutFileDescriptor.hh"
Go to the source code of this file.
Functions | |
const string | program ("dd-project") |
void | initialiseOptions (int argc, char *argv[], Poptions::options_description &desc, Poptions::variables_map &vm) |
template<typename FsmType , typename Event > | |
bool | getProjectedEvents (const FsmType &fsm, std::vector< Event > &events, std::vector< Event > &noevents, std::vector< Event > &projectedEvents) |
size_t | projectAut (const std::string &fileName, const std::string &output, std::vector< std::string > &events, std::vector< std::string > &noevents) |
bool | getProjectedEvents (const DdAutFsm &fsm, const std::vector< std::string > &events, const std::vector< std::string > &noevents, DdAutEventManager &eManager, std::vector< DdAutEventId > &projectedEvents) |
size_t | projectDdaut (const std::string &fileName, const std::string &output, std::vector< std::string > &events, std::vector< std::string > &noevents) |
size_t | projectFsm (const std::string &fileName, const std::string &output, std::vector< std::string > &events, std::vector< std::string > &noevents) |
int | main (int argc, char **argv) |
Variables | |
FileSuffixes | suffixes ({"aut", "ddaut"}) |
This file implements the dd-project command that is used to perform any kind of automata projection.
Definition in file Project.cc.
bool getProjectedEvents | ( | const FsmType & | fsm, |
std::vector< Event > & | events, | ||
std::vector< Event > & | noevents, | ||
std::vector< Event > & | projectedEvents | ||
) |
fsm | The loaded Fsm |
events | the set of projected events ids declared in the command line |
noevents | the set of non-projected events ids declared in the command line |
projectedEvents | the effective set of event ids to project in the fsm |
Definition at line 89 of file Project.cc.
Referenced by getProjectedEvents(), projectAut(), and projectDdaut().
bool getProjectedEvents | ( | const DdAutFsm & | fsm, |
const std::vector< std::string > & | events, | ||
const std::vector< std::string > & | noevents, | ||
DdAutEventManager & | eManager, | ||
std::vector< DdAutEventId > & | projectedEvents | ||
) |
fsm | the ddaut finite state machine to project |
events | the set of event labels to project |
noevents | the set of event labels not to project |
eManager | the event manager of the initial fsm |
projectedEvents | the set of event ids from eManager associated to the events to project |
Definition at line 193 of file Project.cc.
References Diades::Automata::Experimental::EventManager< _Event, _EventId, NullEvent, NullEventId, Hash >::eventId(), getProjectedEvents(), and Diades::Automata::Experimental::EventManager< _Event, _EventId, NullEvent, NullEventId, Hash >::hasEvent().
void initialiseOptions | ( | int | argc, |
char * | argv[], | ||
Poptions::options_description & | desc, | ||
Poptions::variables_map & | vm | ||
) |
Initialise the options of the command present in the command line
argc | |
argv | |
desc | |
vm |
Definition at line 52 of file Project.cc.
References options().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main file of the dd-determine command
argc | |
argv |
Definition at line 349 of file Project.cc.
References initialiseOptions(), Diades::CmdInterface::printCommandLineError(), printUsage(), program(), and projectFsm().
const string program | ( | "dd-project" | ) |
Referenced by main().
size_t projectAut | ( | const std::string & | fileName, |
const std::string & | output, | ||
std::vector< std::string > & | events, | ||
std::vector< std::string > & | noevents | ||
) |
Load the file (aut file) and make the automaton deterministic (low-level) and print on the output
fileName | aut file to load |
output | the file to write (if empty, write on the standard output) |
events | the set of events to project |
noevents | the set of events that must not be projected |
Definition at line 144 of file Project.cc.
References Diades::Automata::Experimental::fromAutFile(), getProjectedEvents(), Diades::CmdInterface::printCommandLineError(), Diades::Automata::project(), suffixes, toStream(), and Diades::CmdInterface::writeAut().
Referenced by projectFsm().
size_t projectDdaut | ( | const std::string & | fileName, |
const std::string & | output, | ||
std::vector< std::string > & | events, | ||
std::vector< std::string > & | noevents | ||
) |
Load the file (ddaut file) and make the automaton deterministic and print on the output
fileName | ddaut file to load |
output | the file to write (if empty, write on the standard output, can be aut or ddaut file) |
events | the set of events to project |
noevents | the set of events that must not be projected |
Definition at line 231 of file Project.cc.
References Diades::Automata::Experimental::DdAutFileDescriptor::acceptorBegin(), Diades::Automata::Experimental::DdAutFileDescriptor::acceptorEnd(), Diades::Automata::Experimental::faFromDescriptor(), Diades::Automata::Experimental::fsmFromDescriptor(), getProjectedEvents(), Diades::CmdInterface::printCommandLineError(), Diades::Automata::project(), Diades::Automata::Experimental::DdAutFileDescriptor::readStream(), suffixes, toStream(), Diades::CmdInterface::writeFiniteAutomaton(), and Diades::CmdInterface::writeFiniteStateMachine().
Referenced by projectFsm().
size_t projectFsm | ( | const std::string & | fileName, |
const std::string & | output, | ||
std::vector< std::string > & | events, | ||
std::vector< std::string > & | noevents | ||
) |
Load the file (aut file) and performs the projection based on the couple events/noevents
fileName | aut file to load |
output | the file to write (if empty, write on the standard output) |
events | the set of events to project |
noevents | the set of events that must not be projected |
Definition at line 316 of file Project.cc.
References ERROR_UNHANDLED_EXCEPTION, Diades::CmdInterface::FileSuffixes::match(), Diades::CmdInterface::printCommandLineError(), projectAut(), projectDdaut(), and suffixes.
Referenced by main().
FileSuffixes suffixes({"aut", "ddaut"}) |
Referenced by projectAut(), projectDdaut(), and projectFsm().