DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <fstream>
#include <regex>
#include <boost/program_options.hpp>
#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/Explanation.hh>
#include <diades/automata/experimental/TreeViewHtml.hh>
#include "../AutomataInterface.hh"
Go to the source code of this file.
Functions | |
const string | program ("dd-explain") |
void | initialiseOptions (int argc, char *argv[], Poptions::options_description &desc, Poptions::variables_map &vm) |
bool | explainLog (const DdAutFA &fa, DdAutFA &explanations, DdAutFA &fullExplanations, const DdAutStateManager &sManager, DdAutStateManager &sManagerExplanation, const DdAutEventManager &eManager, std::istream &logfile, std::istream &obsfile, std::unordered_map< DdAutFA::State, unordered_set< DdAutFA::Transition > > &safeAlternatives) |
void | consolidateWithSafeAlternatives (const DdAutFA &fsa, const DdAutStateManager &sManager, DdAutFA &explanations, DdAutStateManager &sManagerExplanation, const SafeAlt< DdAutFA > &safeAlternatives) |
void | writeTreeViewSafeAlternative (std::ostream &html, const DdAutFA &fa, const DdAutStateManager &sManager, const DdAutEventManager &eManager, DdAutFA::Transition t) |
void | writeTreeViewTransition (std::ostream &html, const DdAutFA &fa, const DdAutStateManager &sManager, const DdAutEventManager &eManager, const DdAutFA &explanation, const DdAutStateManager &sManagerExplanation, const SafeAlt< DdAutFA > &safeAlternatives, DdAutFA::Transition transition) |
void | writeTreeView (std::ostream &html, const DdAutFA &fa, const DdAutStateManager &sManager, const DdAutEventManager &eManager, const DdAutFA &explanation, const DdAutStateManager &sManagerExplanation, const SafeAlt< DdAutFA > &safeAlternatives) |
size_t | explainFsm (const std::string &fileName, const std::string &logName, const std::string &observableName, const std::string &output, const std::string &htmlName) |
int | main (int argc, char **argv) |
Variables | |
FileSuffixes | suffixes ({"log", "ddaut", "obs", "html"}) |
void consolidateWithSafeAlternatives | ( | const DdAutFA & | fsa, |
const DdAutStateManager & | sManager, | ||
DdAutFA & | explanations, | ||
DdAutStateManager & | sManagerExplanation, | ||
const SafeAlt< DdAutFA > & | safeAlternatives | ||
) |
Definition at line 111 of file Explain.cc.
References Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getEvent(), Diades::Automata::Experimental::StatePropertyManager< _StateProperty, _StatePropertyId, NullStProperty, NullStPropertyId, Hash >::getStateProperty(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getStatePropertyId(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::newTransition(), and Diades::Automata::Experimental::StatePropertyManager< _StateProperty, _StatePropertyId, NullStProperty, NullStPropertyId, Hash >::statePropertyId().
Referenced by explainFsm().
size_t explainFsm | ( | const std::string & | fileName, |
const std::string & | logName, | ||
const std::string & | observableName, | ||
const std::string & | output, | ||
const std::string & | htmlName | ||
) |
fileName | ddaut file to load (i.e. A||P) |
logName | log file to load (i.e. a file that contains one observation per line) |
output | the file to write (if empty, write on the standard output), it is the explanation of A||P with respect to L |
Definition at line 276 of file Explain.cc.
References Diades::Automata::Experimental::DdAutFileDescriptor::acceptorBegin(), Diades::Automata::Experimental::DdAutFileDescriptor::acceptorEnd(), consolidateWithSafeAlternatives(), explainLog(), Diades::Automata::Experimental::faFromDescriptor(), Diades::CmdInterface::FileSuffixes::match(), Diades::CmdInterface::printCommandLineError(), Diades::CmdInterface::printCommandLineWarning(), Diades::Automata::Experimental::DdAutFileDescriptor::readStream(), suffixes, Diades::CmdInterface::writeFiniteAutomaton(), and writeTreeView().
Referenced by main().
bool explainLog | ( | const DdAutFA & | fa, |
DdAutFA & | explanations, | ||
DdAutFA & | fullExplanations, | ||
const DdAutStateManager & | sManager, | ||
DdAutStateManager & | sManagerExplanation, | ||
const DdAutEventManager & | eManager, | ||
std::istream & | logfile, | ||
std::istream & | obsfile, | ||
std::unordered_map< DdAutFA::State, unordered_set< DdAutFA::Transition > > & | safeAlternatives | ||
) |
Definition at line 77 of file Explain.cc.
References Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::begin(), Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::end(), Diades::Automata::Experimental::explain(), and Diades::Automata::Experimental::EventManager< _Event, _EventId, NullEvent, NullEventId, Hash >::getEvent().
Referenced by explainFsm().
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 Explain.cc.
References options().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main file of the dd-determine command
argc | |
argv |
Definition at line 373 of file Explain.cc.
References explainFsm(), initialiseOptions(), Diades::CmdInterface::printCommandLineError(), printUsage(), and program().
const string program | ( | "dd-explain" | ) |
Referenced by main().
void writeTreeView | ( | std::ostream & | html, |
const DdAutFA & | fa, | ||
const DdAutStateManager & | sManager, | ||
const DdAutEventManager & | eManager, | ||
const DdAutFA & | explanation, | ||
const DdAutStateManager & | sManagerExplanation, | ||
const SafeAlt< DdAutFA > & | safeAlternatives | ||
) |
Definition at line 214 of file Explain.cc.
References Diades::Automata::Experimental::endListCaretItem(), Diades::Automata::Experimental::endNestedTree(), Diades::Automata::Experimental::endTree(), Diades::Automata::Experimental::StatePropertyManager< _StateProperty, _StatePropertyId, NullStProperty, NullStPropertyId, Hash >::getStateProperty(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getStatePropertyId(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::initialStateBegin(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::initialStateEnd(), Diades::Automata::Experimental::listSingleItem(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionBegin(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionEnd(), Diades::Automata::Experimental::startListCaretItem(), Diades::Automata::Experimental::startNestedTree(), Diades::Automata::Experimental::startTree(), Diades::Automata::Experimental::toTreeViewHtmlEnd(), Diades::Automata::Experimental::toTreeViewHtmlStart(), writeTreeViewSafeAlternative(), and writeTreeViewTransition().
Referenced by explainFsm().
void writeTreeViewSafeAlternative | ( | std::ostream & | html, |
const DdAutFA & | fa, | ||
const DdAutStateManager & | sManager, | ||
const DdAutEventManager & | eManager, | ||
DdAutFA::Transition | t | ||
) |
Definition at line 131 of file Explain.cc.
References Diades::Automata::Experimental::EventManager< _Event, _EventId, NullEvent, NullEventId, Hash >::getEvent(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getEvent(), Diades::Automata::Experimental::StatePropertyManager< _StateProperty, _StatePropertyId, NullStProperty, NullStPropertyId, Hash >::getStateProperty(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getStatePropertyId(), and Diades::Automata::Experimental::listSingleItem().
Referenced by writeTreeView(), and writeTreeViewTransition().
void writeTreeViewTransition | ( | std::ostream & | html, |
const DdAutFA & | fa, | ||
const DdAutStateManager & | sManager, | ||
const DdAutEventManager & | eManager, | ||
const DdAutFA & | explanation, | ||
const DdAutStateManager & | sManagerExplanation, | ||
const SafeAlt< DdAutFA > & | safeAlternatives, | ||
DdAutFA::Transition | transition | ||
) |
Definition at line 148 of file Explain.cc.
References Diades::Automata::Experimental::endListCaretItem(), Diades::Automata::Experimental::endNestedTree(), Diades::Automata::Experimental::EventManager< _Event, _EventId, NullEvent, NullEventId, Hash >::getEvent(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getEvent(), Diades::Automata::Experimental::StatePropertyManager< _StateProperty, _StatePropertyId, NullStProperty, NullStPropertyId, Hash >::getStateProperty(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getStatePropertyId(), Diades::Automata::Experimental::FiniteAutomaton< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::isAcceptingState(), Diades::Automata::Experimental::listSingleItem(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionBegin(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionEnd(), Diades::Automata::Experimental::startListCaretItem(), Diades::Automata::Experimental::startNestedTree(), and writeTreeViewSafeAlternative().
Referenced by writeTreeView().
FileSuffixes suffixes({"log", "ddaut", "obs", "html"}) |
Referenced by explainFsm().