Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
c9e84cd35f7bdfb470ea24e9074fccb3da865384
[simgrid.git] / src / mc / mc_liveness.cpp
1 /* Copyright (c) 2011-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <cstring>
8
9 #include <unistd.h>
10 #include <sys/wait.h>
11
12 #include <xbt/automaton.h>
13 #include <xbt/dynar.h>
14 #include <xbt/fifo.h>
15 #include <xbt/log.h>
16 #include <xbt/sysdep.h>
17
18 #include "src/mc/mc_request.h"
19 #include "src/mc/mc_liveness.h"
20 #include "src/mc/mc_private.h"
21 #include "src/mc/mc_record.h"
22 #include "src/mc/mc_smx.h"
23 #include "src/mc/Client.hpp"
24 #include "src/mc/mc_private.h"
25 #include "src/mc/mc_replay.h"
26 #include "src/mc/mc_safety.h"
27 #include "src/mc/mc_exit.h"
28
29 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc,
30                                 "Logging specific to algorithms for liveness properties verification");
31
32 /********* Global variables *********/
33
34 xbt_dynar_t acceptance_pairs;
35
36 /********* Static functions *********/
37
38 namespace simgrid {
39 namespace mc {
40
41 static xbt_dynar_t visited_pairs;
42
43 Pair::Pair() : num(++mc_stats->expanded_pairs),
44   visited_pair_removed(_sg_mc_visited > 0 ? 0 : 1)
45 {}
46
47 Pair::~Pair() {
48   if (this->visited_pair_removed)
49     MC_state_delete(this->graph_state, 1);
50 }
51
52 static  void show_stack_liveness(xbt_fifo_t stack)
53 {
54   int value;
55   simgrid::mc::Pair* pair;
56   xbt_fifo_item_t item;
57   smx_simcall_t req;
58   char *req_str = nullptr;
59
60   for (item = xbt_fifo_get_last_item(stack);
61        item; item = xbt_fifo_get_prev_item(item)) {
62     pair = (simgrid::mc::Pair*) xbt_fifo_get_item_content(item);
63     req = MC_state_get_executed_request(pair->graph_state, &value);
64     if (req && req->call != SIMCALL_NONE) {
65       req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::executed);
66       XBT_INFO("%s", req_str);
67       xbt_free(req_str);
68     }
69   }
70 }
71
72 static void dump_stack_liveness(xbt_fifo_t stack)
73 {
74   simgrid::mc::Pair* pair;
75   while ((pair = (simgrid::mc::Pair*) xbt_fifo_pop(stack)) != nullptr)
76     delete pair;
77 }
78
79 static simgrid::xbt::unique_ptr<s_xbt_dynar_t> get_atomic_propositions_values()
80 {
81   unsigned int cursor = 0;
82   xbt_automaton_propositional_symbol_t ps = nullptr;
83   simgrid::xbt::unique_ptr<s_xbt_dynar_t> values = simgrid::xbt::unique_ptr<s_xbt_dynar_t>(xbt_dynar_new(sizeof(int), nullptr));
84   xbt_dynar_foreach(simgrid::mc::property_automaton->propositional_symbols, cursor, ps) {
85     int res = xbt_automaton_propositional_symbol_evaluate(ps);
86     xbt_dynar_push_as(values.get(), int, res);
87   }
88   return std::move(values);
89 }
90
91 static int snapshot_compare(simgrid::mc::VisitedPair* state1, simgrid::mc::VisitedPair* state2)
92 {
93   simgrid::mc::Snapshot* s1 = state1->graph_state->system_state;
94   simgrid::mc::Snapshot* s2 = state2->graph_state->system_state;
95   int num1 = state1->num;
96   int num2 = state2->num;
97   return snapshot_compare(num1, s1, num2, s2);
98 }
99
100 static simgrid::mc::VisitedPair* is_reached_acceptance_pair(simgrid::mc::Pair* pair)
101 {
102   simgrid::mc::VisitedPair* new_pair = new VisitedPair(
103     pair->num, pair->automaton_state, pair->atomic_propositions.get(),
104     pair->graph_state);
105   new_pair->acceptance_pair = 1;
106
107   if (xbt_dynar_is_empty(acceptance_pairs))
108     xbt_dynar_push(acceptance_pairs, &new_pair);
109   else {
110
111     int min = -1, max = -1, index;
112     //int res;
113     simgrid::mc::VisitedPair* pair_test;
114     int cursor;
115
116     index = simgrid::mc::get_search_interval(
117       (simgrid::mc::VisitedPair**) xbt_dynar_get_ptr(acceptance_pairs, 0),
118       xbt_dynar_length(acceptance_pairs),
119       new_pair, &min, &max);
120
121     if (min != -1 && max != -1) {       // Acceptance pair with same number of processes and same heap bytes used exists
122
123       cursor = min;
124       if(pair->search_cycle == 1){
125         while (cursor <= max) {
126           pair_test = (simgrid::mc::VisitedPair*) xbt_dynar_get_as(acceptance_pairs, cursor, simgrid::mc::VisitedPair*);
127           if (xbt_automaton_state_compare(pair_test->automaton_state, new_pair->automaton_state) == 0) {
128             if (xbt_automaton_propositional_symbols_compare_value(
129                 pair_test->atomic_propositions.get(),
130                 new_pair->atomic_propositions.get()) == 0) {
131               if (snapshot_compare(pair_test, new_pair) == 0) {
132                 XBT_INFO("Pair %d already reached (equal to pair %d) !", new_pair->num, pair_test->num);
133                 xbt_fifo_shift(mc_stack);
134                 if (dot_output != nullptr)
135                   fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_global_state->prev_pair, pair_test->num, initial_global_state->prev_req);
136                 return nullptr;
137               }
138             }
139           }
140           cursor++;
141         }
142       }
143       xbt_dynar_insert_at(acceptance_pairs, min, &new_pair);
144     } else {
145       pair_test = (simgrid::mc::VisitedPair*) xbt_dynar_get_as(acceptance_pairs, index, simgrid::mc::VisitedPair*);
146       if (pair_test->nb_processes < new_pair->nb_processes)
147         xbt_dynar_insert_at(acceptance_pairs, index + 1, &new_pair);
148       else if (pair_test->heap_bytes_used < new_pair->heap_bytes_used)
149         xbt_dynar_insert_at(acceptance_pairs, index + 1, &new_pair);
150       else
151         xbt_dynar_insert_at(acceptance_pairs, index, &new_pair);
152     }
153   }
154   return new_pair;
155 }
156
157 static void remove_acceptance_pair(int pair_num)
158 {
159   unsigned int cursor = 0;
160   simgrid::mc::VisitedPair* pair_test = nullptr;
161   int pair_found = 0;
162
163   xbt_dynar_foreach(acceptance_pairs, cursor, pair_test)
164     if (pair_test->num == pair_num) {
165        pair_found = 1;
166       break;
167     }
168
169   if(pair_found == 1) {
170     xbt_dynar_remove_at(acceptance_pairs, cursor, &pair_test);
171
172     pair_test->acceptance_removed = 1;
173
174     if (_sg_mc_visited == 0 || pair_test->visited_removed == 1) 
175       delete pair_test;
176
177   }
178 }
179
180
181 static int MC_automaton_evaluate_label(xbt_automaton_exp_label_t l,
182                                        xbt_dynar_t atomic_propositions_values)
183 {
184
185   switch (l->type) {
186   case 0:{
187       int left_res = MC_automaton_evaluate_label(l->u.or_and.left_exp, atomic_propositions_values);
188       int right_res = MC_automaton_evaluate_label(l->u.or_and.right_exp, atomic_propositions_values);
189       return (left_res || right_res);
190     }
191   case 1:{
192       int left_res = MC_automaton_evaluate_label(l->u.or_and.left_exp, atomic_propositions_values);
193       int right_res = MC_automaton_evaluate_label(l->u.or_and.right_exp, atomic_propositions_values);
194       return (left_res && right_res);
195     }
196   case 2:{
197       int res = MC_automaton_evaluate_label(l->u.exp_not, atomic_propositions_values);
198       return (!res);
199     }
200   case 3:{
201       unsigned int cursor = 0;
202       xbt_automaton_propositional_symbol_t p = nullptr;
203       xbt_dynar_foreach(simgrid::mc::property_automaton->propositional_symbols, cursor, p) {
204         if (std::strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0)
205           return (int) xbt_dynar_get_as(atomic_propositions_values, cursor, int);
206       }
207       return -1;
208     }
209   case 4:
210     return 2;
211   default:
212     return -1;
213   }
214 }
215
216 static void MC_pre_modelcheck_liveness(void)
217 {
218   simgrid::mc::Pair* initial_pair = nullptr;
219   mc_model_checker->wait_for_requests();
220   acceptance_pairs = xbt_dynar_new(sizeof(simgrid::mc::VisitedPair*), nullptr);
221   if(_sg_mc_visited > 0)
222     simgrid::mc::visited_pairs = xbt_dynar_new(sizeof(simgrid::mc::VisitedPair*), nullptr);
223
224   initial_global_state->snapshot = simgrid::mc::take_snapshot(0);
225   initial_global_state->prev_pair = 0;
226
227   unsigned int cursor = 0;
228   xbt_automaton_state_t automaton_state;
229   
230   xbt_dynar_foreach(simgrid::mc::property_automaton->states, cursor, automaton_state) {
231     if (automaton_state->type == -1) {  /* Initial automaton state */
232
233       initial_pair = new Pair();
234       initial_pair->automaton_state = automaton_state;
235       initial_pair->graph_state = MC_state_new();
236       initial_pair->atomic_propositions = get_atomic_propositions_values();
237       initial_pair->depth = 1;
238
239       /* Get enabled processes and insert them in the interleave set of the graph_state */
240       for (auto& p : mc_model_checker->process().simix_processes())
241         if (simgrid::mc::process_is_enabled(&p.copy))
242           MC_state_interleave_process(initial_pair->graph_state, &p.copy);
243
244       initial_pair->requests = MC_state_interleave_size(initial_pair->graph_state);
245       initial_pair->search_cycle = 0;
246
247       xbt_fifo_unshift(mc_stack, initial_pair);
248     }
249   }
250 }
251
252 static void MC_replay_liveness(xbt_fifo_t stack)
253 {
254   xbt_fifo_item_t item;
255   simgrid::mc::Pair* pair = nullptr;
256   mc_state_t state = nullptr;
257   smx_simcall_t req = nullptr, saved_req = NULL;
258   int value, depth = 1;
259   char *req_str;
260
261   XBT_DEBUG("**** Begin Replay ****");
262
263   /* Intermediate backtracking */
264   if(_sg_mc_checkpoint > 0) {
265     item = xbt_fifo_get_first_item(stack);
266     pair = (simgrid::mc::Pair*) xbt_fifo_get_item_content(item);
267     if(pair->graph_state->system_state){
268       simgrid::mc::restore_snapshot(pair->graph_state->system_state);
269       return;
270     }
271   }
272
273   /* Restore the initial state */
274   simgrid::mc::restore_snapshot(initial_global_state->snapshot);
275
276     /* Traverse the stack from the initial state and re-execute the transitions */
277     for (item = xbt_fifo_get_last_item(stack);
278          item != xbt_fifo_get_first_item(stack);
279          item = xbt_fifo_get_prev_item(item)) {
280
281       pair = (simgrid::mc::Pair*) xbt_fifo_get_item_content(item);
282
283       state = (mc_state_t) pair->graph_state;
284
285       if (pair->exploration_started) {
286
287         saved_req = MC_state_get_executed_request(state, &value);
288
289         if (saved_req != nullptr) {
290           /* because we got a copy of the executed request, we have to fetch the
291              real one, pointed by the request field of the issuer process */
292           const smx_process_t issuer = MC_smx_simcall_get_issuer(saved_req);
293           req = &issuer->simcall;
294
295           /* Debug information */
296           if (XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)) {
297             req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::simix);
298             XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
299             xbt_free(req_str);
300           }
301
302         }
303
304         simgrid::mc::handle_simcall(req, value);
305         mc_model_checker->wait_for_requests();
306       }
307
308       /* Update statistics */
309       mc_stats->visited_pairs++;
310       mc_stats->executed_transitions++;
311
312       depth++;
313
314     }
315
316   XBT_DEBUG("**** End Replay ****");
317 }
318
319 /**
320  * \brief Checks whether a given pair has already been visited by the algorithm.
321  */
322 static
323 int is_visited_pair(simgrid::mc::VisitedPair* visited_pair, simgrid::mc::Pair* pair)
324 {
325   if (_sg_mc_visited == 0)
326     return -1;
327
328   simgrid::mc::VisitedPair* new_visited_pair = nullptr;
329   if (visited_pair == nullptr)
330     new_visited_pair = new simgrid::mc::VisitedPair(
331       pair->num, pair->automaton_state, pair->atomic_propositions.get(),
332       pair->graph_state);
333   else
334     new_visited_pair = visited_pair;
335
336   if (xbt_dynar_is_empty(visited_pairs)) {
337     xbt_dynar_push(visited_pairs, &new_visited_pair);
338     return -1;
339   }
340
341     int min = -1, max = -1, index;
342     //int res;
343     simgrid::mc::VisitedPair* pair_test;
344     int cursor;
345
346     index = get_search_interval(
347       (simgrid::mc::VisitedPair**) xbt_dynar_get_ptr(visited_pairs, 0),
348       xbt_dynar_length(visited_pairs), new_visited_pair, &min, &max);
349
350     if (min != -1 && max != -1) {       // Visited pair with same number of processes and same heap bytes used exists
351       cursor = min;
352       while (cursor <= max) {
353         pair_test = (simgrid::mc::VisitedPair*) xbt_dynar_get_as(visited_pairs, cursor, simgrid::mc::VisitedPair*);
354         if (xbt_automaton_state_compare(pair_test->automaton_state, new_visited_pair->automaton_state) == 0) {
355           if (xbt_automaton_propositional_symbols_compare_value(
356               pair_test->atomic_propositions.get(),
357               new_visited_pair->atomic_propositions.get()) == 0) {
358             if (snapshot_compare(pair_test, new_visited_pair) == 0) {
359               if (pair_test->other_num == -1)
360                 new_visited_pair->other_num = pair_test->num;
361               else
362                 new_visited_pair->other_num = pair_test->other_num;
363               if (dot_output == nullptr)
364                 XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", new_visited_pair->num, pair_test->num);
365               else
366                 XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", new_visited_pair->num, pair_test->num, new_visited_pair->other_num);
367               xbt_dynar_remove_at(visited_pairs, cursor, &pair_test);
368               xbt_dynar_insert_at(visited_pairs, cursor, &new_visited_pair);
369               pair_test->visited_removed = 1;
370               if (!pair_test->acceptance_pair
371                   || pair_test->acceptance_removed == 1)
372                 delete pair_test;
373               return new_visited_pair->other_num;
374             }
375           }
376         }
377         cursor++;
378       }
379       xbt_dynar_insert_at(visited_pairs, min, &new_visited_pair);
380     } else {
381       pair_test = (simgrid::mc::VisitedPair*) xbt_dynar_get_as(visited_pairs, index, simgrid::mc::VisitedPair*);
382       if (pair_test->nb_processes < new_visited_pair->nb_processes)
383         xbt_dynar_insert_at(visited_pairs, index + 1, &new_visited_pair);
384       else if (pair_test->heap_bytes_used < new_visited_pair->heap_bytes_used)
385         xbt_dynar_insert_at(visited_pairs, index + 1, &new_visited_pair);
386       else
387         xbt_dynar_insert_at(visited_pairs, index, &new_visited_pair);
388     }
389
390     if ((ssize_t) xbt_dynar_length(visited_pairs) > _sg_mc_visited) {
391       int min2 = mc_stats->expanded_pairs;
392       unsigned int cursor2 = 0;
393       unsigned int index2 = 0;
394       xbt_dynar_foreach(visited_pairs, cursor2, pair_test) {
395         if (!mc_model_checker->is_important_snapshot(*pair_test->graph_state->system_state)
396             && pair_test->num < min2) {
397           index2 = cursor2;
398           min2 = pair_test->num;
399         }
400       }
401       xbt_dynar_remove_at(visited_pairs, index2, &pair_test);
402       pair_test->visited_removed = 1;
403       if (!pair_test->acceptance_pair || pair_test->acceptance_removed)
404         delete pair_test;
405     }
406   return -1;
407 }
408
409 static int MC_modelcheck_liveness_main(void)
410 {
411   simgrid::mc::Pair* current_pair = nullptr;
412   int value, res, visited_num = -1;
413   smx_simcall_t req = nullptr;
414   xbt_automaton_transition_t transition_succ = nullptr;
415   int cursor = 0;
416   simgrid::mc::Pair* next_pair = nullptr;
417   simgrid::xbt::unique_ptr<s_xbt_dynar_t> prop_values;
418   simgrid::mc::VisitedPair* reached_pair = nullptr;
419   
420   while(xbt_fifo_size(mc_stack) > 0){
421
422     /* Get current pair */
423     current_pair = (simgrid::mc::Pair*) xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
424
425     /* Update current state in buchi automaton */
426     simgrid::mc::property_automaton->current_state = current_pair->automaton_state;
427
428     XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size = %d, pair_num = %d, requests = %d)",
429        current_pair->depth, current_pair->search_cycle,
430        MC_state_interleave_size(current_pair->graph_state), current_pair->num,
431        current_pair->requests);
432
433     if (current_pair->requests > 0) {
434
435       if (current_pair->automaton_state->type == 1 && current_pair->exploration_started == 0) {
436         /* If new acceptance pair, return new pair */
437         if ((reached_pair = is_reached_acceptance_pair(current_pair)) == nullptr) {
438           int counter_example_depth = current_pair->depth;
439           XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
440           XBT_INFO("|             ACCEPTANCE CYCLE            |");
441           XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
442           XBT_INFO("Counter-example that violates formula :");
443           MC_record_dump_path(mc_stack);
444           simgrid::mc::show_stack_liveness(mc_stack);
445           simgrid::mc::dump_stack_liveness(mc_stack);
446           MC_print_statistics(mc_stats);
447           XBT_INFO("Counter-example depth : %d", counter_example_depth);
448           return SIMGRID_MC_EXIT_LIVENESS;
449         }
450       }
451
452       /* Pair already visited ? stop the exploration on the current path */
453       if ((current_pair->exploration_started == 0)
454         && (visited_num = simgrid::mc::is_visited_pair(
455           reached_pair, current_pair)) != -1) {
456
457         if (dot_output != nullptr){
458           fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_global_state->prev_pair, visited_num, initial_global_state->prev_req);
459           fflush(dot_output);
460         }
461
462         XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
463         current_pair->requests = 0;
464         goto backtracking;
465         
466       }else{
467
468         req = MC_state_get_request(current_pair->graph_state, &value);
469
470          if (dot_output != nullptr) {
471            if (initial_global_state->prev_pair != 0 && initial_global_state->prev_pair != current_pair->num) {
472              fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_global_state->prev_pair, current_pair->num, initial_global_state->prev_req);
473              xbt_free(initial_global_state->prev_req);
474            }
475            initial_global_state->prev_pair = current_pair->num;
476            initial_global_state->prev_req = simgrid::mc::request_get_dot_output(req, value);
477            if (current_pair->search_cycle)
478              fprintf(dot_output, "%d [shape=doublecircle];\n", current_pair->num);
479            fflush(dot_output);
480          }
481
482          char* req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::simix);
483          XBT_DEBUG("Execute: %s", req_str);
484          xbt_free(req_str);
485
486          /* Set request as executed */
487          MC_state_set_executed_request(current_pair->graph_state, req, value);
488
489          /* Update mc_stats */
490          mc_stats->executed_transitions++;
491          if(current_pair->exploration_started == 0)
492            mc_stats->visited_pairs++;
493
494          /* Answer the request */
495          simgrid::mc::handle_simcall(req, value);
496          
497          /* Wait for requests (schedules processes) */
498          mc_model_checker->wait_for_requests();
499
500          current_pair->requests--;
501          current_pair->exploration_started = 1;
502
503          /* Get values of atomic propositions (variables used in the property formula) */ 
504          prop_values = get_atomic_propositions_values();
505
506          /* Evaluate enabled/true transitions in automaton according to atomic propositions values and create new pairs */
507          cursor = xbt_dynar_length(current_pair->automaton_state->out) - 1;
508          while (cursor >= 0) {
509            transition_succ = (xbt_automaton_transition_t)xbt_dynar_get_as(current_pair->automaton_state->out, cursor, xbt_automaton_transition_t);
510            res = MC_automaton_evaluate_label(transition_succ->label, prop_values.get());
511            if (res == 1 || res == 2) { /* 1 = True transition (always enabled), 2 = enabled transition according to atomic prop values */
512               next_pair = new Pair();
513               next_pair->graph_state = MC_state_new();
514               next_pair->automaton_state = transition_succ->dst;
515               next_pair->atomic_propositions = get_atomic_propositions_values();
516               next_pair->depth = current_pair->depth + 1;
517               /* Get enabled processes and insert them in the interleave set of the next graph_state */
518               for (auto& p : mc_model_checker->process().simix_processes())
519                 if (simgrid::mc::process_is_enabled(&p.copy))
520                   MC_state_interleave_process(next_pair->graph_state, &p.copy);
521
522               next_pair->requests = MC_state_interleave_size(next_pair->graph_state);
523
524               /* FIXME : get search_cycle value for each acceptant state */
525               if (next_pair->automaton_state->type == 1 || current_pair->search_cycle)
526                 next_pair->search_cycle = 1;
527
528               /* Add new pair to the exploration stack */
529               xbt_fifo_unshift(mc_stack, next_pair);
530
531            }
532            cursor--;
533          }
534
535       } /* End of visited_pair test */
536       
537     } else {
538
539     backtracking:
540       if(visited_num == -1)
541         XBT_DEBUG("No more request to execute. Looking for backtracking point.");
542     
543       prop_values.reset();
544     
545       /* Traverse the stack backwards until a pair with a non empty interleave
546          set is found, deleting all the pairs that have it empty in the way. */
547       while ((current_pair = (simgrid::mc::Pair*) xbt_fifo_shift(mc_stack)) != nullptr) {
548         if (current_pair->requests > 0) {
549           /* We found a backtracking point */
550           XBT_DEBUG("Backtracking to depth %d", current_pair->depth);
551           xbt_fifo_unshift(mc_stack, current_pair);
552           MC_replay_liveness(mc_stack);
553           XBT_DEBUG("Backtracking done");
554           break;
555         }else{
556           /* Delete pair */
557           XBT_DEBUG("Delete pair %d at depth %d", current_pair->num, current_pair->depth);
558           if (current_pair->automaton_state->type == 1) 
559             remove_acceptance_pair(current_pair->num);
560           delete current_pair;
561         }
562       }
563
564     } /* End of if (current_pair->requests > 0) else ... */
565     
566   } /* End of while(xbt_fifo_size(mc_stack) > 0) */
567
568   XBT_INFO("No property violation found.");
569   MC_print_statistics(mc_stats);
570   return SIMGRID_MC_EXIT_SUCCESS;
571 }
572
573 int modelcheck_liveness(void)
574 {
575   XBT_INFO("Check the liveness property %s", _sg_mc_property_file);
576   MC_automaton_load(_sg_mc_property_file);
577   mc_model_checker->wait_for_requests();
578
579   XBT_DEBUG("Starting the liveness algorithm");
580   _sg_mc_liveness = 1;
581
582   /* Create exploration stack */
583   mc_stack = xbt_fifo_new();
584
585   /* Create the initial state */
586   initial_global_state = xbt_new0(s_mc_global_t, 1);
587
588   MC_pre_modelcheck_liveness();
589   int res = MC_modelcheck_liveness_main();
590
591   /* We're done */
592   simgrid::mc::processes_time.clear();
593
594   return res;
595 }
596
597 }
598 }