DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <BddStateMachine.hh>
Public Types | |
using | Exception = Diades::Utils::Exception< BddStateMachine > |
using | VariableVector = Variable::VariableVector |
using | FormulaVector = Formula::FormulaVector |
using | SlStates = Formula |
using | SlTransitions = Formula |
using | SlEvents = Formula |
using | Event = size_t |
Public Member Functions | |
BddStateMachine () | |
FormulaFactory & | setFormulaFactory (FormulaFactory &factory) |
FormulaFactory & | resetInternalFormulaFactory () |
const Variable & | eventVariable () const |
Variable & | eventVariable () |
Variable & | setEventVariable (Variable &event) |
Variable & | stateVariable () |
const Variable & | stateVariable () const |
Variable & | setStateVariable (Variable &stateVar) |
Variable & | nextStateVariable () |
const Variable & | nextStateVariable () const |
Variable & | setNextStateVariable (Variable &nextStateVar) |
~BddStateMachine () | |
const SlStates & | initialStates () const |
const SlStates & | addInitialStates (const SlStates &newInitialStates) |
const SlStates & | setInitialStates (const SlStates &newInitialStates) |
const SlEvents & | addEvent (Event evt) |
const SlEvents & | event (const Value &eventValue) const |
const SlEvents & | event (Event evt) const |
const SlEvents & | sources (const Value &sourceStateValue) const |
template<typename ValueIterator > | |
const SlEvents & | sources (ValueIterator first, ValueIterator last) const |
const SlEvents & | targets (const Value &targetStateValue) const |
template<typename ValueIterator > | |
const SlEvents & | targets (ValueIterator first, ValueIterator last) const |
const SlTransitions & | addTransitions (const SlTransitions &transition) |
const SlTransitions & | transitions () const |
const SlTransitions & | transitions (const SlEvents &event) const |
const SlTransitions & | noTransitions () const |
const SlTransitions & | transitions (const SlStates &sources, const SlEvents &events) const |
const SlEvents & | events () const |
template<typename EventIterator > | |
const SlEvents & | events (EventIterator first, EventIterator last) |
const SlStates & | trigger (const SlStates &sources, const SlEvents &events) const |
const SlStates & | synchronousTrigger (const SlStates &sources, const SlEvents &events) const |
const SlStates & | reach (const SlStates &sources, const SlEvents &nonObservables, const SlEvents &observations) |
FormulaFactory & | factory () |
void | clear () |
Static Public Member Functions | |
static string | typeName () |
Private Attributes | |
FormulaVector | _behaviour |
FormulaVector | _initialState |
FormulaVector | _noTransitions |
std::unordered_map< std::string, FormulaVector > | _eventOfValue |
std::unordered_map< Event, FormulaVector > | _formulaOfEvent |
FormulaVector | _events |
FormulaVector | _setOfEvents |
VariableVector | _stateVariable |
VariableVector | _nextStateVariable |
VariableVector | _eventVariable |
FormulaFactory | _internalFactory |
std::vector< std::reference_wrapper< FormulaFactory > > | _factory |
A BddStateMachine represents a finite state automata with help of Binary Decision Diagram
Definition at line 32 of file BddStateMachine.hh.
Definition at line 82 of file BddStateMachine.hh.
using Diades::Sdmdl::Experimental::BddStateMachine::Exception = Diades::Utils::Exception<BddStateMachine> |
Definition at line 49 of file BddStateMachine.hh.
Definition at line 59 of file BddStateMachine.hh.
Definition at line 77 of file BddStateMachine.hh.
Definition at line 65 of file BddStateMachine.hh.
Definition at line 71 of file BddStateMachine.hh.
VariableVector vector of Variables as defined in Diades::Sdmdl::Experimental::BddStateMachine::VariableVector |
Definition at line 54 of file BddStateMachine.hh.
|
inline |
Default Constructor, create an empty machine based on the internal factory. To make an effective BddStateMachine then use setEvent/State/NextState/Variable methods and then reset the internal factory. Another way to do is to setup an external factory encoding the Event/State/NextState/Variable and then call setFormulaFactory(FormulaFactory & factory)
Definition at line 158 of file BddStateMachine.hh.
References Diades::Sdmdl::FormulaFactory::isFalse(), and setInitialStates().
|
inline |
Destructor
Definition at line 338 of file BddStateMachine.hh.
References Diades::Sdmdl::FormulaFactory::destroy().
Add an event
evt | an Event |
Definition at line 381 of file BddStateMachine.hh.
References eventVariable(), factory(), and Diades::Sdmdl::Variable::getValue().
Referenced by Diades::Sdmdl::Experimental::encodeEvent().
const SlStates& Diades::Sdmdl::Experimental::BddStateMachine::addInitialStates | ( | const SlStates & | newInitialStates | ) |
Add initial states to the current ones
newInitialStates | a new set of initial states |
Referenced by Diades::Sdmdl::Experimental::encodeInitialStates(), and initialStates().
|
inline |
Add transitions to the machine
transitions | new transitions |
Definition at line 501 of file BddStateMachine.hh.
Referenced by Diades::Sdmdl::Experimental::encodeTransitions().
void Diades::Sdmdl::Experimental::BddStateMachine::clear | ( | ) |
Clear the StateMachine
Referenced by Diades::Sdmdl::Experimental::encode(), and factory().
|
inline |
Definition at line 401 of file BddStateMachine.hh.
References Diades::Sdmdl::Value::label().
Referenced by Diades::Sdmdl::Experimental::encodeTransitions(), events(), runGlobalDiagnosisProblem(), and transitions().
Definition at line 412 of file BddStateMachine.hh.
|
inline |
Definition at line 559 of file BddStateMachine.hh.
Referenced by events(), and transitions().
|
inline |
Definition at line 568 of file BddStateMachine.hh.
References current, event(), events(), factory(), reach(), sources(), synchronousTrigger(), and trigger().
|
inline |
Definition at line 242 of file BddStateMachine.hh.
Referenced by addEvent(), Diades::Sdmdl::Experimental::encodeTransitions(), and resetInternalFormulaFactory().
|
inline |
Definition at line 251 of file BddStateMachine.hh.
|
inline |
Definition at line 623 of file BddStateMachine.hh.
References clear(), and require.
Referenced by addEvent(), Diades::Sdmdl::Experimental::encodeInitialStates(), Diades::Sdmdl::Experimental::encodeTransitions(), events(), and runGlobalDiagnosisProblem().
|
inline |
Definition at line 350 of file BddStateMachine.hh.
References addInitialStates(), and require.
|
inline |
Definition at line 306 of file BddStateMachine.hh.
Referenced by Diades::Sdmdl::Experimental::encodeTransitions(), resetInternalFormulaFactory(), and targets().
|
inline |
Definition at line 315 of file BddStateMachine.hh.
const SlTransitions& Diades::Sdmdl::Experimental::BddStateMachine::noTransitions | ( | ) | const |
Note that this method is lazy. As long as noTransitions() is not called, the noTransition formula is not computed.
Referenced by transitions().
const SlStates& Diades::Sdmdl::Experimental::BddStateMachine::reach | ( | const SlStates & | sources, |
const SlEvents & | nonObservables, | ||
const SlEvents & | observations | ||
) |
sources | |
nonObservables | |
observations |
Referenced by events(), and runGlobalDiagnosisProblem().
|
inline |
Set the internal factory to be the one to use. This factory is cleared first. Any reference to an external factory is lost but this factory remains unchanged. The factory will be initialised depending on the availabity of the state/nextState/event Variables
Definition at line 206 of file BddStateMachine.hh.
References eventVariable(), Diades::Sdmdl::FormulaFactory::isFalse(), nextStateVariable(), Diades::Sdmdl::FormulaFactory::reset(), setInitialStates(), and stateVariable().
Referenced by Diades::Sdmdl::Experimental::encode().
set the Variable that encodes the events
event | the Variable |
Definition at line 263 of file BddStateMachine.hh.
Referenced by Diades::Sdmdl::Experimental::encode().
|
inline |
Set the formula factory to an external one. If a factory was already is use, two cases hold: it is the internal one it remains unchanged but no mor reference on it. If it was an external one, the reference is lost but it remains unchanged
factory | the external factory to use |
Definition at line 191 of file BddStateMachine.hh.
|
inline |
Set initial states
newInitialStates | a new set of initial states |
Definition at line 369 of file BddStateMachine.hh.
Referenced by BddStateMachine(), and resetInternalFormulaFactory().
|
inline |
set the Variable that encodes the target states
nextStateVar | the Variable |
Definition at line 327 of file BddStateMachine.hh.
Referenced by Diades::Sdmdl::Experimental::encode().
|
inline |
set the Variable that encodes the source states
stateVar | the Variable |
Definition at line 295 of file BddStateMachine.hh.
Referenced by Diades::Sdmdl::Experimental::encode().
|
inline |
Source state encoding
Definition at line 423 of file BddStateMachine.hh.
References stateVariable().
Referenced by events(), runGlobalDiagnosisProblem(), and sources().
|
inline |
Source state encoding of a range
begin | first ValueIterator of the range |
end | ValueIterator after the last Value of the range |
Definition at line 435 of file BddStateMachine.hh.
|
inline |
Definition at line 274 of file BddStateMachine.hh.
Referenced by Diades::Sdmdl::Experimental::encodeInitialStates(), Diades::Sdmdl::Experimental::encodeTransitions(), resetInternalFormulaFactory(), and sources().
|
inline |
Definition at line 283 of file BddStateMachine.hh.
const SlStates& Diades::Sdmdl::Experimental::BddStateMachine::synchronousTrigger | ( | const SlStates & | sources, |
const SlEvents & | events | ||
) | const |
Trigger one event belonging to the set of events from the set of sources
sources | |
events |
Referenced by events().
|
inline |
Target state encoding
Definition at line 462 of file BddStateMachine.hh.
References nextStateVariable().
Referenced by targets().
|
inline |
Target state encoding of a range
begin | first ValueIterator of the range |
end | ValueIterator after the last Value of the range |
Definition at line 475 of file BddStateMachine.hh.
|
inline |
Definition at line 515 of file BddStateMachine.hh.
References require.
|
inline |
event | an SlEvents |
Definition at line 527 of file BddStateMachine.hh.
References event(), noTransitions(), and require.
|
inline |
sources | SlStates (source states) |
events | SlEvents |
Definition at line 549 of file BddStateMachine.hh.
const SlStates& Diades::Sdmdl::Experimental::BddStateMachine::trigger | ( | const SlStates & | sources, |
const SlEvents & | events | ||
) | const |
Trigger one event belonging to the set of events from the set of sources
sources | |
events |
Referenced by events().
|
inlinestatic |
|
private |
Definition at line 88 of file BddStateMachine.hh.
|
private |
Definition at line 105 of file BddStateMachine.hh.
|
private |
Definition at line 116 of file BddStateMachine.hh.
|
private |
Definition at line 134 of file BddStateMachine.hh.
|
mutableprivate |
in used. It might be the internal factory or an external one.
Definition at line 145 of file BddStateMachine.hh.
|
private |
Definition at line 110 of file BddStateMachine.hh.
|
private |
Definition at line 92 of file BddStateMachine.hh.
|
private |
Definition at line 139 of file BddStateMachine.hh.
|
private |
of a transition
Definition at line 130 of file BddStateMachine.hh.
|
mutableprivate |
Definition at line 99 of file BddStateMachine.hh.
|
private |
Definition at line 120 of file BddStateMachine.hh.
|
private |
of a transition
Definition at line 125 of file BddStateMachine.hh.