-
- MC_free_snapshot(sn);
- xbt_dynar_reset(prop_ato);
- xbt_free(prop_ato);
- MC_UNSET_RAW_MEM;
-
- if(raw_mem_set)
- MC_SET_RAW_MEM;
- else
- MC_UNSET_RAW_MEM;
-
- return 0;
-
- }
-}
-
-void set_pair_visited_hash(xbt_state_t st, int sc){
-
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-
- MC_SET_RAW_MEM;
-
- mc_snapshot_t sn = xbt_new0(s_mc_snapshot_t, 1);
- MC_take_snapshot_liveness(sn);
-
- mc_pair_visited_hash_t pair = NULL;
- pair = xbt_new0(s_mc_pair_visited_hash_t, 1);
- pair->automaton_state = st;
- pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
- pair->search_cycle = sc;
- pair->hash_regions = malloc(sizeof(unsigned int) * sn->num_reg);
-
- int i;
-
- for(i=0 ; i< sn->num_reg ; i++){
- pair->hash_regions[i] = hash_region(sn->regions[i]->data, sn->regions[i]->size);
- }
-
- /* Get values of propositional symbols */
- unsigned int cursor = 0;
- xbt_propositional_symbol_t ps = NULL;
- int res;
- int_f_void_t f;
-
- xbt_dynar_foreach(_mc_property_automaton->propositional_symbols, cursor, ps){
- f = (int_f_void_t)ps->function;
- res = (*f)();
- xbt_dynar_push_as(pair->prop_ato, int, res);
- }
-
- xbt_dynar_push(visited_pairs_hash, &pair);
-
- MC_free_snapshot(sn);
-
- MC_UNSET_RAW_MEM;
-
- if(raw_mem_set)
- MC_SET_RAW_MEM;
- else
- MC_UNSET_RAW_MEM;
-
-}
-
-void set_pair_visited(xbt_state_t st, int sc){
-
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-
- MC_SET_RAW_MEM;
-
- mc_pair_visited_t pair = NULL;
- pair = xbt_new0(s_mc_pair_visited_t, 1);
- pair->automaton_state = st;
- pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
- pair->search_cycle = sc;
- pair->system_state = xbt_new0(s_mc_snapshot_t, 1);
- MC_take_snapshot_liveness(pair->system_state);
-
-
- /* Get values of propositional symbols */
- unsigned int cursor = 0;
- xbt_propositional_symbol_t ps = NULL;
- int res;
- int_f_void_t f;
-
- xbt_dynar_foreach(_mc_property_automaton->propositional_symbols, cursor, ps){
- f = (int_f_void_t)ps->function;
- res = (*f)();
- xbt_dynar_push_as(pair->prop_ato, int, res);
- }
-
- xbt_dynar_push(visited_pairs, &pair);
-
- MC_UNSET_RAW_MEM;
-
- if(raw_mem_set)
- MC_SET_RAW_MEM;
- else
- MC_UNSET_RAW_MEM;
-
-}
-
-void MC_pair_delete(mc_pair_t pair){
- xbt_free(pair->graph_state->proc_status);
- xbt_free(pair->graph_state);
- xbt_free(pair);
-}
-
-
-
-int MC_automaton_evaluate_label(xbt_exp_label_t l){
-
- switch(l->type){
- case 0 : {
- int left_res = MC_automaton_evaluate_label(l->u.or_and.left_exp);
- int right_res = MC_automaton_evaluate_label(l->u.or_and.right_exp);
- return (left_res || right_res);
- }
- case 1 : {
- int left_res = MC_automaton_evaluate_label(l->u.or_and.left_exp);
- int right_res = MC_automaton_evaluate_label(l->u.or_and.right_exp);
- return (left_res && right_res);
- }
- case 2 : {
- int res = MC_automaton_evaluate_label(l->u.exp_not);
- return (!res);
- }
- case 3 : {
- unsigned int cursor = 0;
- xbt_propositional_symbol_t p = NULL;
- int_f_void_t f;
- xbt_dynar_foreach(_mc_property_automaton->propositional_symbols, cursor, p){
- if(strcmp(p->pred, l->u.predicat) == 0){
- f = (int_f_void_t)p->function;
- return (*f)();
- }