Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc' into mc++
[simgrid.git] / include / simgrid / modelchecker.h
1 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid    */
2
3 /* Copyright (c) 2008-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include <simgrid_config.h> /* HAVE_MC ? */
10 #include <xbt.h>
11 #include "xbt/automaton.h"
12
13 #ifndef SIMGRID_MODELCHECKER_H
14 #define SIMGRID_MODELCHECKER_H
15
16 SG_BEGIN_DECL()
17
18 #ifdef HAVE_MC
19
20 extern int _sg_do_model_check; /* please don't use directly: we inline MC_is_active, but that's what you should use */
21 extern int _sg_mc_visited;
22
23 #define MC_is_active()                  _sg_do_model_check
24 #define MC_visited_reduction()          _sg_mc_visited
25
26 XBT_PUBLIC(void) MC_assert(int);
27 XBT_PUBLIC(int) MC_random(int min, int max);
28 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol(const char* id, void* fct);
29 XBT_PUBLIC(void *) MC_snapshot(void);
30 XBT_PUBLIC(int) MC_compare_snapshots(void *s1, void *s2);
31 XBT_PUBLIC(void) MC_cut(void);
32 XBT_PUBLIC(void) MC_ignore(void *addr, size_t size);
33
34 #else
35
36 #define MC_is_active()                  0
37 #define MC_visited_reduction()          0
38
39 #define MC_assert(a)                    xbt_assert(a)
40 #define MC_random(a, b)                 0
41 #define MC_automaton_new_propositional_symbol(a, b) ((void)0)
42 #define MC_snapshot()                   ((void*)0)
43 #define MC_compare_snapshots(a, b)      0
44 #define MC_cut()                        ((void)0)
45 #define MC_ignore(a, b)                 ((void)0)
46
47 #endif
48
49 SG_END_DECL()
50
51 #endif /* SIMGRID_MODELCHECKER_H */