DiaDes
0.1
DIAgnosis of Discrete-Event System
|
This file implements the dd-complete command that is used to make convert any kind of automata to a complete automaton. An automaton is complete for a given alphabet if from any state and for every symbol, there is at least one output transition labeled with the symbol. In case of a 'aut' finite state machine we just add a state and add as many transitions as needed to reach it (with self-loops) In case of a 'ddaut' we do the same thing and make the state non-accepting. 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/DdAutFileDescriptor.hh>
#include <diades/automata/experimental/Printer.hh>
#include <diades/automata/experimental/StateMachine.hh>
#include <diades/automata/experimental/StateCreation.hh>
#include <diades/automata/experimental/Complete.hh>
#include "../AutomataInterface.hh"
Go to the source code of this file.
Functions | |
const string | program ("dd-complete") |
void | initialiseOptions (int argc, char *argv[], Poptions::options_description &desc, Poptions::variables_map &vm) |
size_t | completeAut (const std::string &fileName, const std::string &output) |
size_t | completeDdaut (const std::string &fileName, const std::string &output) |
size_t | completeFsm (const std::string &fileName, const std::string &output) |
int | main (int argc, char **argv) |
Variables | |
FileSuffixes | suffixes ({"aut","ddaut"}) |
This file implements the dd-complete command that is used to make convert any kind of automata to a complete automaton. An automaton is complete for a given alphabet if from any state and for every symbol, there is at least one output transition labeled with the symbol. In case of a 'aut' finite state machine we just add a state and add as many transitions as needed to reach it (with self-loops) In case of a 'ddaut' we do the same thing and make the state non-accepting.
Definition in file Complete.cc.
size_t completeAut | ( | const std::string & | fileName, |
const std::string & | output | ||
) |
Load the file (aut file) and make the automaton complete (low-level) and print on the output
fileName | aut file to load |
output | the file to write (if empty, write on the standard output) |
Definition at line 90 of file Complete.cc.
References Diades::Automata::Experimental::complete(), Diades::Automata::Experimental::fromAutFile(), Diades::CmdInterface::printCommandLineError(), suffixes, and Diades::CmdInterface::writeAut().
Referenced by completeFsm().
size_t completeDdaut | ( | const std::string & | fileName, |
const std::string & | output | ||
) |
Load the file (ddaut file) and make the automaton complete 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) |
Definition at line 119 of file Complete.cc.
References Diades::Automata::Experimental::DdAutFileDescriptor::acceptorBegin(), Diades::Automata::Experimental::DdAutFileDescriptor::acceptorEnd(), Diades::Automata::Experimental::complete(), Diades::Automata::Experimental::faFromDescriptor(), Diades::Automata::Experimental::fsmFromDescriptor(), Diades::CmdInterface::printCommandLineError(), Diades::Automata::Experimental::DdAutFileDescriptor::readStream(), suffixes, Diades::CmdInterface::writeFiniteAutomaton(), and Diades::CmdInterface::writeFiniteStateMachine().
Referenced by completeFsm().
size_t completeFsm | ( | const std::string & | fileName, |
const std::string & | output | ||
) |
Load the file (aut file) and make the automaton complete (low-level) and print on the output
fileName | aut file to load |
output | the file to write (if empty, write on the standard output) |
Definition at line 174 of file Complete.cc.
References completeAut(), completeDdaut(), ERROR_UNHANDLED_EXCEPTION, Diades::CmdInterface::FileSuffixes::match(), Diades::CmdInterface::printCommandLineError(), and suffixes.
Referenced by main().
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 58 of file Complete.cc.
References options().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main file of the dd-complete command
argc | |
argv |
Definition at line 204 of file Complete.cc.
References completeFsm(), initialiseOptions(), Diades::CmdInterface::printCommandLineError(), printUsage(), and program().
const string program | ( | "dd-complete" | ) |
Referenced by main().
FileSuffixes suffixes({"aut","ddaut"}) |
Referenced by completeAut(), completeDdaut(), completeFsm(), and main().