Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s/MC_IS_ENABLED/MC_is_active()/ to remove an unfriendly pitfall of the codebase
[simgrid.git] / include / simgrid / modelchecker.h
1 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid    */
2
3 /* Copyright (c) 2008-2012. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include <simgrid_config.h> /* HAVE_MC ? */
9 #include <xbt.h>
10 #include "xbt/automaton.h"
11
12 #ifndef SIMGRID_MODELCHECKER_H
13 #define SIMGRID_MODELCHECKER_H
14
15 #ifdef HAVE_MC
16
17 extern int _surf_do_model_check; /* please don't use directly: we inline MC_is_active, but that's what you should use */
18
19 static int MC_is_active(void) {
20   return _surf_do_model_check;
21 }
22
23 XBT_PUBLIC(void) MC_assert(int);
24 XBT_PUBLIC(int) MC_random(int min, int max);
25 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol(const char* id, void* fct);
26
27 #else
28
29 #define MC_assert(a) xbt_assert(a)
30
31 static int MC_is_active(void) {
32   return 0;
33 }
34
35 #endif
36
37
38
39 #endif /* SIMGRID_MODELCHECKER_H */