DiaDes  0.1
DIAgnosis of Discrete-Event System
Functions | Variables
Synchronize.cc File Reference

This file implements the dd-synchronize command that is used to perform any kind of automata synchronization. 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/Synchronize.hh>
#include "../AutomataInterface.hh"
#include "diades/automata/experimental/DdAutFileDescriptor.hh"
#include <diades/automata/experimental/DdSyncDescriptor.hh>

Go to the source code of this file.

Functions

const string program ("dd-synchronize")
 
void initialiseOptions (int argc, char *argv[], Poptions::options_description &desc, Poptions::variables_map &vm)
 
size_t synchroniseDdAut (const std::vector< std::string > &fileNames, const std::string &rulesName, const std::string &output)
 
size_t synchroniseFsm (const std::vector< std::string > &fileNames, const std::string &rulesName, const std::string &output)
 
int main (int argc, char **argv)
 

Variables

FileSuffixes suffixes ({"ddaut", "ddsync"})
 

Detailed Description

This file implements the dd-synchronize command that is used to perform any kind of automata synchronization.

Author
Yannick Pencolé <yannick.pencole at laas.fr>
Date
12 August 2019, 21:59

Definition in file Synchronize.cc.

Function Documentation

◆ initialiseOptions()

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

Parameters
argc
argv
desc
vm

Definition at line 55 of file Synchronize.cc.

References options().

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Main file of the dd-determine command

Parameters
argc
argv
Returns
success code (SUCCESS or ERROR_COMMAND_LINE)

Definition at line 242 of file Synchronize.cc.

References initialiseOptions(), Diades::CmdInterface::printCommandLineError(), printUsage(), program(), and synchroniseFsm().

◆ program()

const string program ( "dd-synchronize"  )

Referenced by main().

◆ synchroniseDdAut()

size_t synchroniseDdAut ( const std::vector< std::string > &  fileNames,
const std::string &  rulesName,
const std::string &  output 
)

Load the files (ddaut files) and performs the synchronisation based on the rules in the rulesFile

Parameters
fileNamesthe aut files to load
rulesNamethe file containing the synchronisation rules
outputthe file to write (if empty, write on the standard output)
Returns
success code (SUCCESS or ERROR_COMMAND_LINE) especially check the consistency between the automata and the synchronisation rules

Definition at line 87 of file Synchronize.cc.

References Diades::Automata::Experimental::descriptorToRules(), Diades::Automata::Experimental::faFromDdAutFile(), Diades::Automata::Experimental::generateSynchronisedDdAutEventLabels(), Diades::CmdInterface::printCommandLineError(), Diades::Automata::Experimental::DdSyncDescriptor::readStream(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::setName(), suffixes, Diades::Automata::Experimental::synchronize(), and Diades::CmdInterface::writeFiniteAutomaton().

Referenced by synchroniseFsm().

◆ synchroniseFsm()

size_t synchroniseFsm ( const std::vector< std::string > &  fileNames,
const std::string &  rulesName,
const std::string &  output 
)

Load the files (aut/ddaut files) and performs the synchronisation based on the rules in the rulesFile

Parameters
fileNamesthe aut/ddaut files to load
rulesNamethe file containing the synchronisation rules
outputthe file to write (if empty, write on the standard output)
Returns
success code (SUCCESS or ERROR_COMMAND_LINE) especially check the consistency between the automata and the synchronisation rules

Definition at line 194 of file Synchronize.cc.

References ERROR_UNHANDLED_EXCEPTION, Diades::CmdInterface::FileSuffixes::match(), Diades::CmdInterface::printCommandLineError(), suffixes, synchroniseDdAut(), and toStream().

Referenced by main().

Variable Documentation

◆ suffixes

FileSuffixes suffixes({"ddaut", "ddsync"})

Referenced by synchroniseDdAut(), and synchroniseFsm().