#include <por.hh>
Public Member Functions | |
int | ample_set (state_t s, enabled_trans_container_t &enabled_trans, std::size_t &proc_gid) |
Generates all enabled transitions and proc_gid of ample set choosed by estimated heuristic. | |
int | ample_set_succs (state_t s, succ_container_t &succs, std::size_t &proc_gid) |
Generates successors of ample set choosed by estimated heuristic. | |
int | generate_ample_sets (state_t s, bool *ample_sets, enabled_trans_container_t &enabled_trans, std::size_t &le_proc_gid) |
Generates all enabled transitions and offers possible candidates to an ample set. | |
int | generate_composed_ample_sets (state_t s, bool *ample_sets, enabled_trans_container_t **ample_trans, enabled_trans_container_t &all_enabled_trans) |
Generates all enabled transitions and offers possible candidates to an ample set composed of several processes. | |
void | get_dep (bit_string_t *result) |
void | get_pre (bit_string_t *result) |
Returns field of bit_string_t storing for all transition set of processes whose may enable this transition. | |
bit_string_t | get_visibility () |
Returns a bit_string_t structure (see bit_string_t class) containing information which transition is visible or not (trans[i]==true iff transition with GID=i is visible). | |
void | init (explicit_system_t *S, list< expression_t * > *vis_list=NULL) |
Initialization and static analysis of the system, necessary to call. | |
por_t (void) | |
A creator. | |
void | set_choose_type (std::size_t type) |
Method for estimating of choosing specific ample set, parameter type is one of constants POR_FIRST, POR_LAST, POR_SMALLEST or POR_FIND_ONLY. | |
void | set_dep (bit_string_t *new_dep) |
void | set_pre (bit_string_t *new_pre) |
void | set_visibility (bit_string_t trans) |
Method for changing of visibility relation (trans[i]==true iff transition with GID=i is visible). | |
void | static_c3 () |
Adds to visible transitions so called sticky transitions in order to fulfill cycle condition (by static analysis). | |
~por_t () | |
A destructor (frees some used memory). | |
Public Attributes | |
bool | count_approx_interuptions |
unsigned * | dep_interupted |
bit_string_t * | full_dep |
bit_string_t * | full_pre |
bit_string_t | full_vis |
unsigned * | pre_interupted |
unsigned * | vis_interupted |
Class implements basic features necessary to using partial order reduction, i.e. static analysis findindg dependency and visibility relations, or choosing appropriate candidates for ample-sets. The cycle condition is not ensured by this class and it has to be treated externally.
int ample_set | ( | state_t | s, | |
enabled_trans_container_t & | enabled_trans, | |||
std::size_t & | proc_gid | |||
) |
Generates all enabled transitions and proc_gid of ample set choosed by estimated heuristic.
If proc_gid==system_tget_process_count(), then the state must be fully expanded.
s | = state for which we generate ample set | |
enabled_trans | = container of all enabled transitions as generated by function explicit_system_t::get_async_enabled_trans (programmer hasn't generate them again, which would be time consumed) | |
proc_gid | = GID of process whose (enabled) transitions can be taken as ample set. The process is choosed by estimated heuristic (see a creator of this class por_t::por_t) |
References generate_ample_sets(), and dve_system_t::get_process_count().
int ample_set_succs | ( | state_t | s, | |
succ_container_t & | succs, | |||
std::size_t & | proc_gid | |||
) |
Generates successors of ample set choosed by estimated heuristic.
s | = state for which we generate ample set | |
succs | = container of generated successors |
bitwise OR of SUCC_NORMAL, SUCC_ERROR and SUCC_DEADLOCK according to explicit_system_t::get_enabled_trans (use functions explicit_system_t::succs_normal(), explicit_system_t::succs_error() and explicit_system_t::succs_deadlock() for testing)
References generate_ample_sets(), enabled_trans_container_t::get_begin(), enabled_trans_container_t::get_count(), dve_explicit_system_t::get_enabled_trans_succs(), dve_explicit_system_t::get_ith_succ(), dve_system_t::get_process_count(), and array_t::push_back().
int generate_ample_sets | ( | state_t | s, | |
bool * | ample_sets, | |||
enabled_trans_container_t & | enabled_trans, | |||
std::size_t & | ample_proc_gid | |||
) |
Generates all enabled transitions and offers possible candidates to an ample set.
s | = state for which we generate ample set | |
ample_sets | = set of dimension equal to number of processes of the system. If ample_sets[i]=true, then the set of transitions of the i-th process is a candidate to ample set. | |
enabled_trans | = container of all enabled transitions as generated by function explicit_system_t::get_async_enabled_trans (programmer don't have to generate them again, which would be time consumed) |
References error_vector_t::clear(), error_vector_t::count(), gerr, bit_string_t::get_bit(), enabled_trans_container_t::get_count(), dve_explicit_system_t::get_enabled_trans(), enabled_trans_container_t::get_enabled_transition(), process_t::get_gid(), transition_t::get_gid(), dve_system_t::get_process_count(), dve_transition_t::get_process_gid(), dve_system_t::get_property_gid(), dve_explicit_system_t::get_receiving_trans(), dve_explicit_system_t::get_sending_or_normal_trans(), dve_explicit_system_t::get_state_of_process(), dve_system_t::get_transition(), system_t::get_with_property(), error_vector_t::perror(), array_of_abstract_t::size(), and SUCC_ERROR.
Referenced by ample_set(), and ample_set_succs().
int generate_composed_ample_sets | ( | state_t | s, | |
bool * | ample_sets, | |||
enabled_trans_container_t ** | ample_trans, | |||
enabled_trans_container_t & | all_enabled_trans | |||
) |
Generates all enabled transitions and offers possible candidates to an ample set composed of several processes.
Extension of classic ample_set notion: ample set can composed of several processes here.
s | = state for which we generate ample set | |
ample_sets | = set of dimension equal to number of processes of the system. If ample_set[i]=true, then there exists an ample set A containing process i, where A is a proper subset of all enabled conditions. | |
ample_trans | = array of enabled_trans_container_t of dimension equal to number of processes of the system. if ample_set[i]=true, then ample_trans[i] contains (enabled) transitions of an ample set which covers transitions of the i-th process. |
References array_of_abstract_t::back(), enabled_trans_container_t::clear(), error_vector_t::clear(), error_vector_t::count(), array_of_abstract_t::extend(), gerr, bit_string_t::get_bit(), enabled_trans_container_t::get_count(), dve_explicit_system_t::get_enabled_trans(), enabled_trans_container_t::get_enabled_transition(), process_t::get_gid(), transition_t::get_gid(), dve_transition_t::get_process_gid(), dve_system_t::get_property_gid(), enabled_trans_container_t::get_property_succ_count(), dve_explicit_system_t::get_receiving_trans(), dve_explicit_system_t::get_sending_or_normal_trans(), dve_explicit_system_t::get_state_of_process(), dve_system_t::get_transition(), system_t::get_with_property(), error_vector_t::perror(), dve_explicit_system_t::print_state(), state_t::ptr, enabled_trans_container_t::set_next_begin(), enabled_trans_container_t::set_property_succ_count(), array_of_abstract_t::size(), state_t::size, and SUCC_ERROR.
void init | ( | explicit_system_t * | S, | |
list< expression_t * > * | vis_list = NULL | |||
) |
Initialization and static analysis of the system, necessary to call.
If the system is without property, visibility is computed from the list of expressions given in the argument vis_list. For the systems with the property the parameter is omitted.
References bit_string_t::alloc_mem(), bit_string_t::clear(), bit_string_t::DBG_print(), bit_string_t::enable_bit(), bit_string_t::get_bit(), dve_transition_t::get_channel_gid(), dve_transition_t::get_effect(), dve_transition_t::get_effect_count(), transition_t::get_gid(), dve_system_t::get_global_variable_count(), dve_transition_t::get_guard(), transition_t::get_lid(), dve_symbol_table_t::get_process(), dve_system_t::get_process(), dve_system_t::get_process_count(), dve_transition_t::get_process_gid(), dve_system_t::get_property_process(), dve_transition_t::get_state1_gid(), dve_transition_t::get_state1_lid(), dve_transition_t::get_state2_gid(), dve_symbol_table_t::get_state_count(), dve_system_t::get_symbol_table(), dve_transition_t::get_sync_expr_list_item(), dve_transition_t::get_sync_expr_list_size(), dve_transition_t::get_sync_mode(), process_t::get_trans_count(), dve_system_t::get_trans_count(), process_t::get_transition(), dve_system_t::get_transition(), dve_symbol_table_t::get_variable(), dve_symbol_t::get_vector_size(), system_t::get_with_property(), dve_symbol_t::is_vector(), dve_expression_t::left(), dve_expression_t::right(), bit_string_t::set_bit(), SYNC_ASK, SYNC_ASK_BUFFER, SYNC_EXCLAIM, SYNC_EXCLAIM_BUFFER, and SYNC_NO_SYNC.