Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / include / simgrid / modelchecker.h
1 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid    */
2
3 /* Copyright (c) 2008-2013. 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 #ifdef HAVE_MC
17
18 extern int _sg_do_model_check; /* please don't use directly: we inline MC_is_active, but that's what you should use */
19 extern int _sg_mc_visited;
20
21 #define MC_is_active() _sg_do_model_check
22 #define MC_visited_reduction() _sg_mc_visited
23
24 XBT_PUBLIC(void) MC_assert(int);
25 XBT_PUBLIC(int) MC_random(int min, int max);
26 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol(const char* id, void* fct);
27 XBT_PUBLIC(void *) MC_snapshot(void);
28 XBT_PUBLIC(int) MC_compare_snapshots(void *s1, void *s2);
29 XBT_PUBLIC(void) MC_cut(void);
30 XBT_PUBLIC(void) MC_ignore(void *addr, size_t size);
31
32 #else
33
34 #define MC_assert(a) xbt_assert(a)
35 #define MC_is_active() 0
36 #define MC_visited_reduction() 0
37
38 #endif
39
40
41
42 #endif /* SIMGRID_MODELCHECKER_H */