DiaDes  0.1
DIAgnosis of Discrete-Event System
Functions
Diades::Automata::Experimental::Projection Namespace Reference

Functions

template<typename Fsm >
void aggregateElementaryBeliefStates (const Fsm &machine, CstBsMap< Fsm > &bsFromState)
 
template<typename Fsm , typename IsGoal >
void computeElementaryBeliefStates (const Fsm &machine, IsGoal isGoal, CstBsMap< Fsm > &bsFromState)
 
template<typename Fsm , typename IsGoal >
void makeBeliefStates (const Fsm &machine, IsGoal isGoal, CstBsMap< Fsm > &bsFromState)
 
template<typename Fsm , typename EventPropertyIdIterator >
void computeElementaryBeliefStates (const Fsm &machine, EventPropertyIdIterator begin, EventPropertyIdIterator end, CstBsMap< Fsm > &bsFromState)
 
template<typename Fsm , typename EventPropertyIdIterator >
void makeBeliefStates (const Fsm &machine, EventPropertyIdIterator begin, EventPropertyIdIterator end, CstBsMap< Fsm > &bsFromState)
 
template<typename Fsm , typename EventPropertyIdIterator >
bool projectRange (const Fsm &machine, Fsm &abstractMachine, EventPropertyIdIterator projectedBegin, EventPropertyIdIterator projectedEnd, EventPropertyIdIterator abstractedBegin, EventPropertyIdIterator abstractedEnd, BeliefStateWithSourceStateCreator< Fsm > &stateCreation, BsMap< Fsm > &bsMap, CstStMap< typename Fsm::State > &stMap)
 
template<typename Fsm , typename IsGoal >
bool projectRange (const Fsm &machine, Fsm &abstractMachine, IsGoal isGoal, BeliefStateWithSourceStateCreator< Fsm > &stateCreation, BsMap< Fsm > &bsMap, CstStMap< typename Fsm::State > &stMap)
 

Function Documentation

◆ aggregateElementaryBeliefStates()

template<typename Fsm >
void Diades::Automata::Experimental::Projection::aggregateElementaryBeliefStates ( const Fsm &  machine,
CstBsMap< Fsm > &  bsFromState 
)
Parameters
machinea StateMachine
bsFromStatethe computed beliefStates

bsFromState[s] should be initialised as { s } U { s' } such that a transition is considered to be elementary ans then we return the aggregation defined as { s } U { s' | exists a path s - e1 -> ... - en -> s' } in the machine such that all the s- ei ->'s are considered as elementary initially. bsFromState[s] is initialised if needed but not reinitialised if it was not empty.

Fix point method, used by the different makeBeliefStates function

Definition at line 41 of file Project.hh.

References states.

Referenced by makeBeliefStates().

◆ computeElementaryBeliefStates() [1/2]

template<typename Fsm , typename IsGoal >
void Diades::Automata::Experimental::Projection::computeElementaryBeliefStates ( const Fsm &  machine,
IsGoal  isGoal,
CstBsMap< Fsm > &  bsFromState 
)
Parameters
machinea StateMachine
isGoala transition Predicate
bsFromStatethe computed elementary beliefStates

Suppose that in a machine we have a transition s - e -> s' where isGoal(s - e -> s') is true then {s,s'} belongs to the elementary state of bsFromState[s]. In other words, bsFromState[s] is the set of states { s } U { s', s - e -> s', isGoal(s - e -> s')}, for any s. If such a transition s - e -> s' does not exist then bsFromState[s] = { s }

bsFromState[s] is initialised if needed but not reinitialised if it was not empty.

Definition at line 89 of file Project.hh.

Referenced by makeBeliefStates().

◆ computeElementaryBeliefStates() [2/2]

template<typename Fsm , typename EventPropertyIdIterator >
void Diades::Automata::Experimental::Projection::computeElementaryBeliefStates ( const Fsm &  machine,
EventPropertyIdIterator  begin,
EventPropertyIdIterator  end,
CstBsMap< Fsm > &  bsFromState 
)
Parameters
machinea StateMachine
beginthe start iterator of a range of EventInfoId to project
endthe end iterator of a range of EventInfoId to project
bsFromStatethe computed elementary beliefStates

Suppose that in a machine we have a transition s - e -> s' where e is an event within the range [begin,end) then {s,s'} belongs to the elementary state of bsFromState[s]. In other words, bsFromState[s] is the set of states { s } U { s', s - e -> s', e in [begin,end)}, for any s. If s - e -> s' does not exist then bsFromState[s] = { s }

bsFromState[s] is initialised if needed but not reinitialised if it was not empty.

Definition at line 154 of file Project.hh.

◆ makeBeliefStates() [1/2]

template<typename Fsm , typename IsGoal >
void Diades::Automata::Experimental::Projection::makeBeliefStates ( const Fsm &  machine,
IsGoal  isGoal,
CstBsMap< Fsm > &  bsFromState 
)
Parameters
machinea StateMachine
isGoala transition Predicate
bsFromStatethe computed beliefStates

bsFromState[s] is defined as { s } U { s' | exists a path s - e1 -> ... - en -> s' } in the machine such that all the s- ei ->'s are such that isGoal(s - ei -> s')) bsFromState[s] is initialised if needed but not reinitialised if it was not empty.

Fix point method

Definition at line 125 of file Project.hh.

References aggregateElementaryBeliefStates(), and computeElementaryBeliefStates().

Referenced by projectRange().

◆ makeBeliefStates() [2/2]

template<typename Fsm , typename EventPropertyIdIterator >
void Diades::Automata::Experimental::Projection::makeBeliefStates ( const Fsm &  machine,
EventPropertyIdIterator  begin,
EventPropertyIdIterator  end,
CstBsMap< Fsm > &  bsFromState 
)
Parameters
machinea StateMachine
beginthe start iterator of a range of EventInfoId to abstract
endthe end iterator of a range of EventInfoId to abstract
bsFromStatethe computed beliefStates

bsFromState[s] is defined as { s } U { s' | exists a path s - e1 -> ... - en -> s' } in the machine such that all the ei's are in [begin,end) bsFromState[s] is initialised if needed but not reinitialised if it was not empty.

Fix point method

Definition at line 192 of file Project.hh.

References aggregateElementaryBeliefStates(), and computeElementaryBeliefStates().

◆ projectRange() [1/2]

template<typename Fsm , typename EventPropertyIdIterator >
bool Diades::Automata::Experimental::Projection::projectRange ( const Fsm &  machine,
Fsm &  abstractMachine,
EventPropertyIdIterator  projectedBegin,
EventPropertyIdIterator  projectedEnd,
EventPropertyIdIterator  abstractedBegin,
EventPropertyIdIterator  abstractedEnd,
BeliefStateWithSourceStateCreator< Fsm > &  stateCreation,
BsMap< Fsm > &  bsMap,
CstStMap< typename Fsm::State > &  stMap 
)
Parameters
machinea StateMachine
abstractMachinethe resulting abstracted StateMachine
projectedBeginthe start iterator of a range of EventInfoId to project
projectedEndthe end iterator of a range of EventInfoId to project
abstractedBeginthe start iterator of a range of EventInfoId to abstract
abstractedtedEndthe end iterator of a range of EventInfoId to abstract
bsMapresulting mapping that associates a State from abstractMachine to the set of abstracted states in the initial machine
stMapresulting mapping that associates a State of the initial machine to the state in the abstractMachine. Only initial states or states from the initial machine that are targets of a projected transition have an association. Any other states of the initial StateMachine are associated with an invalid state (as they may actually belong to several belief states of the abstracted machine).
Returns
true if the projection is a success. If not the state of the abstractedMachine is undetermined. Be aware the [projectedBegin,projectedEnd) and [abstractedBegin,abstractedEnd) should be a partition of the events from StateMachine. If not, the returned result is undetermined. This function is internal
Precondition
machine should not be abstractedMachine. machine must have at least one initial state
[projectedBegin,projectedEnd) represents a set of EventInfoId of the StateMachine
[abstractedBegin,abstractedEnd) represents the complement set of [projectedBegin,projectedEnd) in the StateMachine, no check is performed. If not the case, the result is undetermined
Postcondition
the abstractMachine only contains events from [begin,end)

Definition at line 233 of file Project.hh.

References makeBeliefStates(), and Diades::Automata::Experimental::BeliefStateWithSourceStateCreator< StateMachine >::newState().

Referenced by Diades::Automata::Experimental::abstractEvents(), and Diades::Automata::Experimental::project().

◆ projectRange() [2/2]

template<typename Fsm , typename IsGoal >
bool Diades::Automata::Experimental::Projection::projectRange ( const Fsm &  machine,
Fsm &  abstractMachine,
IsGoal  isGoal,
BeliefStateWithSourceStateCreator< Fsm > &  stateCreation,
BsMap< Fsm > &  bsMap,
CstStMap< typename Fsm::State > &  stMap 
)
Parameters
machinea StateMachine
abstractMachinethe resulting abstracted StateMachine
isGoala transition Predicate (P(t))
bsMapresulting mapping that associates a State from abstractMachine to the set of abstracted states in the initial machine
stMapresulting mapping that associates a State of the initial machine to the state in the abstractMachine. Only initial states or states from the initial machine that are targets of a projected transition have an association. Any other states of the initial StateMachine are associated with an invalid state (as they may actually belong to several belief states of the abstracted machine).
Returns
true if the projection is a success. If not the state of the abstractedMachine is undetermined.
Precondition
machine should not be abstractedMachine. machine must have at least one initial state
P(t) is a predicate that is true over a set of transitions in the StateMachine
Postcondition
the abstractMachine only contains transitions such that P(t) is true

Definition at line 327 of file Project.hh.

References makeBeliefStates(), and Diades::Automata::Experimental::BeliefStateWithSourceStateCreator< StateMachine >::newState().