DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <Trace.hh>
Public Types | |
typedef Diades::Utils::Exception< Trace > | Exception |
![]() | |
typedef Diades::Utils::Exception< Component > | Exception |
typedef Component * | Pointer |
typedef const Component * | ConstPointer |
typedef Diades::Graph::NodeIterator | StateIterator |
typedef Diades::Graph::EdgeIterator | TransitionIterator |
typedef list< Transition >::const_iterator | EventTransitionIterator |
typedef unordered_set< State >::const_iterator | InitialStateIterator |
typedef Diades::Graph::InEdgeIterator | InputTransitionIterator |
typedef Diades::Graph::OutEdgeIterator | OutputTransitionIterator |
typedef set< Event >::const_iterator | EventIterator |
typedef unordered_set< Transition >::const_iterator | OutputEventTransitionIterator |
typedef unordered_set< Transition >::const_iterator | InputEventTransitionIterator |
typedef unordered_set< State >::const_iterator | LabelledStateIterator |
typedef std::string | StateLabel |
Public Member Functions | |
Trace () | |
bool | extract (const Component &comp, const ObservableMask &mask, const vector< Event > &observations) |
void | extract (const Component &comp, Event event, bool presence) |
void | extract (const Trace &trace, const Trace &projection, const set< Event > &projectedEvents) |
void | extractObservableTrace (const ObservableComponent &comp, Event event, bool presence) |
void | extractAllObservableTraces (const ObservableComponent &comp) |
bool | project (const Trace &trace, const set< Event > &projectedEvents) |
bool | intersection (const Trace &trace1, const Trace &trace2) |
bool | substract (const Trace &trace1, const Trace &trace2) |
bool | complement (const Trace &trace, const set< Event > &events) |
bool | compose (const Trace &trace1, const Trace &trace2, const set< Event > &events) |
State | makeComplete () |
bool | isFinite (list< set< Event > > &combinations) const |
bool | isContinuationFinite () const |
State | initialState () const |
bool | isAcceptor (State state) const |
void | setAcceptor (State state) |
void | setNonAcceptor (State state) |
unordered_set< State >::const_iterator | beginOfAcceptorStates () const |
unordered_set< State >::const_iterator | endOfAcceptorStates () const |
void | makeAllAcceptors () |
void | makeAllNonAcceptors () |
const unordered_set< State > & | acceptors () const |
virtual void | mergeInfoStates (const vector< const Component *> &components, const vector< State > &states, State currentState) |
void | clear () |
void | trace2dot (const string &filename) const |
![]() | |
ConstPointer | getPointer () const |
Pointer | getPointer () |
Component () | |
Component (const Component &component) | |
virtual | ~Component () |
bool | operator== (const Component &component) const |
bool | operator!= (const Component &component) const |
int | id () const |
void | setId (int identifier) |
Graph::Graph & | behaviour () |
const Graph::Graph & | behaviour () const |
bool | isEmpty () const |
bool | isValid () const |
void | setName (const string &name) |
const string & | name () const |
void | insertEvent (const Event &event) |
unsigned | numberOfEvents () const |
void | insertEvent (EventIterator start, EventIterator end) |
const Event & | getEvent (Transition t) const |
const set< Event > & | events () const |
EventIterator | eventBegin () const |
EventIterator | eventEnd () const |
bool | containsEvent (const Event &e) const |
void | setFaulty (const Event &e) |
bool | isFaulty (const Event &e) const |
const set< Event > & | faultyEvents () const |
EventIterator | faultyEventBegin () const |
EventIterator | faultyEventEnd () const |
void | setNormal (const Event &e) |
bool | isNormal (const Event &e) const |
const set< Event > & | normalEvents () const |
EventIterator | normalEventBegin () const |
EventIterator | normalEventEnd () const |
void | replaceEvent (const Event &e1, const Event &e2) |
State | newState () |
State | newState (const StateLabel &label) |
const StateLabel & | getLabel (State state) const |
State | getState (const StateLabel &label) const |
void | deleteState (State state) |
void | deleteState (StateIterator start, StateIterator end) |
unsigned | numberOfStates () const |
StateIterator | stateBegin () const |
StateIterator | stateEnd () const |
void | setInitial (State state) |
void | unsetInitial (State state) |
void | setAllInitialStates () |
void | clearAllInitialStates () |
InitialStateIterator | initialStateBegin () const |
InitialStateIterator | initialStateEnd () const |
unsigned | numberOfInitialStates () const |
bool | isInitial (State state) const |
Transition | newTransition (State source, State target, Event event) |
Transition | newTransition (const StateLabel &source, const StateLabel &target, Event event) |
void | deleteTransition (Transition t) |
void | deleteTransition (TransitionIterator start, TransitionIterator end) |
void | deleteTransition (EventTransitionIterator start, EventTransitionIterator end) |
LabelledStateIterator | beginOfSourceStateOfEvent (const Event &e) const |
LabelledStateIterator | endOfSourceStateOfEvent (const Event &e) const |
LabelledStateIterator | beginOfTargetStateOfEvent (const Event &e) const |
LabelledStateIterator | endOfTargetStateOfEvent (const Event &e) const |
EventTransitionIterator | eventTransitionBegin (const Event &e) const |
EventTransitionIterator | eventTransitionEnd (const Event &e) const |
OutputEventTransitionIterator | outputEventTransitionBegin (State s, Event e) const |
OutputEventTransitionIterator | outputEventTransitionEnd (State s, Event e) const |
InputEventTransitionIterator | inputEventTransitionBegin (State s, Event e) const |
InputEventTransitionIterator | inputEventTransitionEnd (State s, Event e) const |
TransitionIterator | transitionBegin () const |
TransitionIterator | transitionEnd () const |
OutputTransitionIterator | outputTransitionBegin (State s) const |
OutputTransitionIterator | outputTransitionEnd (State s) const |
InputTransitionIterator | inputTransitionBegin (State s) const |
InputTransitionIterator | inputTransitionEnd (State s) const |
unsigned | numberOfTransitions () const |
bool | sanityCheck (string &log) const |
bool | isDeterministic () const |
virtual bool | project (const Component *comp, const set< Event > &projectedEvents) |
virtual bool | project (const Component *comp, const set< Event > &projectedEvents, unordered_map< Diades::Automata::State, unordered_set< Diades::Automata::State > > &dictionary) |
virtual bool | project (const Component *comp, const set< Event > &projectedEvents, const unordered_set< State > &acceptors, unordered_set< State > &newAcceptors) |
bool | minimize () |
bool | minimize (unordered_set< State > &acceptors) |
bool | isComplete () const |
virtual bool | import (const string &filename) |
virtual bool | component2dot (const string &fileName) const |
virtual bool | exportDesCompModel (const string &filename) const |
virtual bool | importDesCompModel (const string &filename) |
virtual bool | importDesCompModel (istream &stream) |
![]() | |
Loggable () | |
Loggable (const string &loggerName) | |
Loggable (Logger &logger) | |
void | changeLogger (const string &newLoggerName) |
void | changeLogger (Logger &newLogger) |
Diades::Utils::Log | log (Log::Level level, const char *msg) |
Static Public Member Functions | |
static string | typeName () |
_status = 1 acceptor, non-acceptor otherwise More... | |
![]() | |
static string | typeName () |
the name by default More... | |
Private Member Functions | |
void | pruneSpuriousStates () |
void | extractUnobservableBehaviours (const Component &comp, const ObservableMask &mask, const unordered_map< State, State > &sources, unordered_map< State, State > &targets, unsigned level) |
bool | extractBehaviours (const Component &comp, const ObservableMask &mask, const unordered_map< State, State > &sources, const Event &obs, unordered_map< State, State > &targets, unsigned level) |
void | computeTrace (const Component &comp, Event event, bool presence) |
Private Attributes | |
unordered_set< State > | _acceptors |
Diades::Graph::NodeMap< int > | _status |
set of acceptor states More... | |
Additional Inherited Members | |
![]() | |
static const string | defaultComponentName |
![]() | |
virtual void | determine (const Component *comp, const unordered_set< State > &acceptors, unordered_set< State > &newAcceptors) |
virtual void | determine (const Component *comp) |
virtual bool | parseDesCompName (istream &stream) |
virtual bool | parseDesCompStates (istream &stream) |
virtual bool | parseDesCompFaultyEvents (istream &stream) |
virtual bool | parseDesCompNormalEvents (istream &stream) |
virtual bool | parseDesCompObservableEvents (istream &stream) |
virtual bool | parseDesCompMaskedEvents (istream &stream, unsigned number, map< string, set< string > > &maskEvents) |
virtual bool | parseDesCompTransitions (istream &stream) |
![]() | |
Diades::Graph::Graph | _behav |
unordered_set< State > | _initial |
Diades::Graph::NodeMap< int > | _isInitial |
This class implements the notion of traces. It is a component whose states have a status. Traces are used to compute languages over the component behaviours
Diades::Automata::Trace::Trace | ( | ) |
default constructor
|
inline |
Definition at line 402 of file Trace.hh.
References _acceptors, mergeInfoStates(), and states.
|
inline |
|
inlinevirtual |
Clear the Trace
Reimplemented from Diades::Automata::Component.
Definition at line 422 of file Trace.hh.
References Diades::Automata::Component::behaviour(), Diades::Automata::Component::clear(), Diades::Graph::NodeMap< T >::init(), and trace2dot().
|
private |
Creation of the trace of event 'event'
component | a Component |
event | an Event |
presence | type of the Trace Compute the Trace of the event 'event'. Every event sequence recognised by the Trace is a sequence S of the Component. If presence is true, then S neccessarily contains the Event "event". If presence is not true then S does not contain the Event "event". Here the trace is represented as a regular language L by the minimal deterministic automaton MDA(L) (this automation is theoretically unique) |
|
inline |
bool Diades::Automata::Trace::extract | ( | const Component & | comp, |
const ObservableMask & | mask, | ||
const vector< Event > & | observations | ||
) |
Trace extraction
void Diades::Automata::Trace::extract | ( | const Trace & | trace, |
const Trace & | projection, | ||
const set< Event > & | projectedEvents | ||
) |
void Diades::Automata::Trace::extractAllObservableTraces | ( | const ObservableComponent & | comp | ) |
comp | an ObservableComponent |
|
private |
void Diades::Automata::Trace::extractObservableTrace | ( | const ObservableComponent & | comp, |
Event | event, | ||
bool | presence | ||
) |
Partially Observable Trace extraction
comp | an ObservableComponent |
event | an Event |
presence | is the event is present or not |
|
private |
|
inline |
Definition at line 263 of file Trace.hh.
References Diades::Automata::Component::initialStateBegin().
|
inline |
bool Diades::Automata::Trace::isContinuationFinite | ( | ) | const |
bool Diades::Automata::Trace::isFinite | ( | list< set< Event > > & | combinations | ) | const |
combinations |
|
inline |
Make all the states as acceptor states
Definition at line 368 of file Trace.hh.
References setAcceptor(), Diades::Automata::Component::stateBegin(), and Diades::Automata::Component::stateEnd().
|
inline |
Make all the states as non-acceptor states
Definition at line 384 of file Trace.hh.
References setNonAcceptor(), Diades::Automata::Component::stateBegin(), and Diades::Automata::Component::stateEnd().
State Diades::Automata::Trace::makeComplete | ( | ) |
Completeness Make the trace like a monitor by completing with a hole state to which events that are not considered in the Trace force to to go to that state. This is used by SpecialisedActiveDiagnoser.
|
virtual |
Merge information about states when synchronising
components | The set of components that are synchronising |
states | The configuration of states |
currentState | The corresponding state in the current Component currentState = (components[0]->state[0],..., components[n]->state[n]) |
Reimplemented from Diades::Automata::Component.
Referenced by acceptors().
|
private |
|
inline |
Set the state to be an acceptor state
state | a State |
Definition at line 299 of file Trace.hh.
References Diades::Automata::Component::behaviour(), and require.
Referenced by makeAllAcceptors().
|
inline |
Set the state to be a non acceptor state
state | a State |
Definition at line 319 of file Trace.hh.
References Diades::Automata::Component::behaviour(), and require.
Referenced by makeAllNonAcceptors().
Substraction of two Trace objects: generate the trace that gathers the words of the first trace minus the words of the second trace if trace2 includes trace1 then the empty trace is computed
void Diades::Automata::Trace::trace2dot | ( | const string & | filename | ) | const |
Export to dot
Referenced by clear().
|
inlinestatic |
|
private |
Definition at line 21 of file Trace.hh.
Referenced by acceptors().
|
private |