Logo AND Algorithmique Numérique Distribuée

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