#include <explicit_system.hh>
Public Member Functions | |
bool | can_evaluate_expressions () |
bool | can_system_transitions () |
explicit_system_t (error_vector_t &evect) | |
A constructor. | |
virtual | ~explicit_system_t () |
A destructor. | |
Methods for expression evaluation | |
virtual bool | eval_expr (const expression_t *const expr, const state_t state, data_t &data) const =0 |
Evaluates an expression. | |
Methods working with system transitions and enabled transitions | |
virtual int | get_enabled_ith_trans (const state_t state, const size_int_t i, enabled_trans_t &enb_trans)=0 |
Computes the i-th enabled transition in a state `state'. | |
virtual int | get_enabled_trans (const state_t state, enabled_trans_container_t &enb_trans)=0 |
Creates a list of enabled transitions in a state `state'. | |
virtual int | get_enabled_trans_count (const state_t state, size_int_t &count)=0 |
Computes the count of transitions in a state `state'. | |
virtual bool | get_enabled_trans_succ (const state_t state, const enabled_trans_t &enabled, state_t &new_state)=0 |
Generates a successor of `state' using enabled transition `enabled'. | |
virtual bool | get_enabled_trans_succs (const state_t state, succ_container_t &succs, const enabled_trans_container_t &enabled_trans)=0 |
virtual int | get_succs (state_t state, succ_container_t &succs, enabled_trans_container_t &etc)=0 |
Creates successors of state `state'. | |
virtual enabled_trans_t * | new_enabled_trans () const =0 |
Creates an instance of enabled transition. | |
Obligatory part of abstact interface | |
A destructor.
These methods have to implemented in each implementation of explicit_system_t | |
virtual state_t | get_initial_state ()=0 |
Returns an initial state of the system. | |
virtual int | get_ith_succ (state_t state, const int i, state_t &succ)=0 |
Computes i-th successor of `state'. | |
virtual size_int_t | get_preallocation_count () const =0 |
Returns a count of successors to preallocate in successor container. | |
virtual int | get_succs (state_t state, succ_container_t &succs)=0 |
Creates successors of state `state'. | |
virtual bool | is_accepting (state_t state, size_int_t acc_group=0, size_int_t pair_member=1)=0 |
virtual bool | is_erroneous (state_t state)=0 |
Returns, whether the state of the system is erroneous. | |
virtual void | print_state (state_t state, std::ostream &outs=std::cout)=0 |
Prints the standard text representation of a state of the system. | |
virtual size_int_t | violated_assertion_count (const state_t state) const =0 |
Returns a count of assertions violated in the state `state'. | |
virtual std::string | violated_assertion_string (const state_t state, const size_int_t index) const =0 |
virtual bool | violates_assertion (const state_t state) const =0 |
Returns, whether any assertion is violated in the state `state'. |
The role of explicit system implemented by explicit_system_t is to provide an interface to the generator of states of a model of the system stored in the parent class system_t.
The most important methods are get_initial_state() and get_succs(). Values returned from get_succs() can be analyzed by succs_normal(), succs_error() and succs_deadlock().
explicit_system_t | ( | error_vector_t & | evect | ) | [inline] |
bool can_evaluate_expressions | ( | ) | [inline] |
Tells whether the implementation of explicit_system_t interface can evaluate expressions
bool can_system_transitions | ( | ) | [inline] |
Tells whether the implementation of explicit_system_t interface can work with system_trans_t and enabled_trans_t
virtual bool eval_expr | ( | const expression_t *const | expr, | |
const state_t | state, | |||
data_t & | data | |||
) | const [pure virtual] |
Evaluates an expression.
expr | = expression to evaluate | |
state | = state of the system, in which we want to evaluate the expression expr | |
data | = computed value of the expression |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual int get_enabled_ith_trans | ( | const state_t | state, | |
const size_int_t | i, | |||
enabled_trans_t & | enb_trans | |||
) | [pure virtual] |
Computes the i-th enabled transition in a state `state'.
Computes the i-th enabled transition in a state state.
state | = state of the system | |
i | = the index of the enabled transition (0..get_async_enabled_trans_count) | |
enb_trans | = the variable for storing computed transition |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual int get_enabled_trans | ( | const state_t | state, | |
enabled_trans_container_t & | enb_trans | |||
) | [pure virtual] |
Creates a list of enabled transitions in a state `state'.
Creates a list of enabled transitions in a state state and stores it to the container enb_trans (see enabled_trans_container_t).
state | = state of the system | |
enb_trans | = container for storing enabled transitions (see Enabled transitions for details) |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual int get_enabled_trans_count | ( | const state_t | state, | |
size_int_t & | count | |||
) | [pure virtual] |
Computes the count of transitions in a state `state'.
Computes the count of transitions in a state state.
state | = state of the system | |
count | = computed count of enabled transitions |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual bool get_enabled_trans_succ | ( | const state_t | state, | |
const enabled_trans_t & | enabled, | |||
state_t & | new_state | |||
) | [pure virtual] |
Generates a successor of `state' using enabled transition `enabled'.
state | = state of system | |
enabled | = enabled transition to use for generation of successor | |
new_state | = state to rewrite by the successor of state |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual bool get_enabled_trans_succs | ( | const state_t | state, | |
succ_container_t & | succs, | |||
const enabled_trans_container_t & | enabled_trans | |||
) | [pure virtual] |
Generates successors of `state' using list of enabled transitions `enabled_trans'
state | = state of system | |
succs | = container for storage of successors of state | |
enabled_trans | = list of enabled transitions to use for generation of successors |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual state_t get_initial_state | ( | ) | [pure virtual] |
Returns an initial state of the system.
This method takes a model of the system stored in system_t (parent of this class) and computes the initial state of the system.
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual size_int_t get_preallocation_count | ( | ) | const [pure virtual] |
Returns a count of successors to preallocate in successor container.
succ_container_t uses this method to estimate an amount of memory to preallocate. Repeated reallocation is slow - therefore good estimation is useful, but not necessary.
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual int get_succs | ( | state_t | state, | |
succ_container_t & | succs, | |||
enabled_trans_container_t & | etc | |||
) | [pure virtual] |
Creates successors of state `state'.
Creates successors of state state and saves them to successor container (see succ_container_t). Furthermore it stores enabled transitions of the systems which are used to generate successors of state
state | = state of the system | |
succs | = successors container for storage of successors of state | |
etc | = container of enabled transitions (see enabled_trans_container_t and enabled_trans_t) |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual int get_succs | ( | state_t | state, | |
succ_container_t & | succs | |||
) | [pure virtual] |
Creates successors of state `state'.
Creates successors of state state and saves them to successor container (see succ_container_t).
state | = state of the system | |
succs | = successors container for storage of successors of state |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual bool is_accepting | ( | state_t | state, | |
size_int_t | acc_group = 0 , |
|||
size_int_t | pair_member = 1 | |||
) | [pure virtual] |
Returns, whether the state is accepting in the specifed accepting group of Buchi or generalized Buchi automata, or whether the state belongs to the first or second component of the specified accepting pair of Rabin or Streett automata.
state | = state of the system |
false
is returned. Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual bool is_erroneous | ( | state_t | state | ) | [pure virtual] |
Returns, whether the state of the system is erroneous.
An erroneous state is a special state that is unique in the whole system. It is reached by bad model specification (model that permits variable/index overflow synchronization collision etc.)
state | = state of the system |
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual enabled_trans_t* new_enabled_trans | ( | ) | const [pure virtual] |
Creates an instance of enabled transition.
This method is needed by enabled_trans_container_t, which cannot allocate enabled transitions itself, because it does not know their concrete type. The abstract type enabled_trans_t is not sufficient for creation because of its purely abstract methods.
{ Example - implementation of this method in DVE system:}
enabled_trans_t * dve_explicit_system_t::new_enabled_trans() const { return (new dve_enabled_trans_t); }
This method is implemented only if can_system_transitions() returns true.
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual size_int_t violated_assertion_count | ( | const state_t | state | ) | const [pure virtual] |
Returns a count of assertions violated in the state `state'.
If an implementation of explicit_system_t do not support assertions, this method can be implemented so that it returns always 0.
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual std::string violated_assertion_string | ( | const state_t | state, | |
const size_int_t | index | |||
) | const [pure virtual] |
Returns a string representation of index-th assertion violated in the state `state'
If an implementation of explicit_system_t do not support assertions, this method can be implemented so that it returns always empty string.
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.
virtual bool violates_assertion | ( | const state_t | state | ) | const [pure virtual] |
Returns, whether any assertion is violated in the state `state'.
If an implementation of explicit_system_t do not support assertions, this method can be implemented so that it returns always false
.
Implemented in bymoc_explicit_system_t, and dve_explicit_system_t.