1 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid */
3 /* Copyright (c) 2008-2014. The SimGrid Team.
4 * All rights reserved. */
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. */
11 #include <simgrid_config.h> /* HAVE_MC ? */
13 #include "xbt/automaton.h"
15 #ifndef SIMGRID_MODELCHECKER_H
16 #define SIMGRID_MODELCHECKER_H
20 XBT_PUBLIC(int) MC_random(int min, int max);
24 extern int _sg_do_model_check; /* please don't use directly: we inline MC_is_active, but that's what you should use */
25 extern int _sg_mc_visited;
27 #define MC_is_active() _sg_do_model_check
28 #define MC_visited_reduction() _sg_mc_visited
30 XBT_PUBLIC(void) MC_assert(int);
31 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol(const char* id, int(*fct)(void));
32 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol_pointer(const char *id, int* value);
33 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol_callback(const char* id,
34 xbt_automaton_propositional_symbol_callback_type callback,
35 void* data, xbt_automaton_propositional_symbol_free_function_type free_function);
36 XBT_PUBLIC(void *) MC_snapshot(void);
37 XBT_PUBLIC(int) MC_compare_snapshots(void *s1, void *s2);
38 XBT_PUBLIC(void) MC_cut(void);
39 XBT_PUBLIC(void) MC_ignore(void *addr, size_t size);
43 #define MC_is_active() 0
44 #define MC_visited_reduction() 0
46 #define MC_assert(a) xbt_assert(a)
47 #define MC_automaton_new_propositional_symbol(a, b) ((void)0)
48 #define MC_automaton_new_propositional_symbol_pointer(a, b) ((void)0)
49 #define MC_automaton_new_propositional_symbol_callback(id,callback,data,free_function) \
50 if(free_function) free_function(data);
51 #define MC_snapshot() ((void*)0)
52 #define MC_compare_snapshots(a, b) 0
53 #define MC_cut() ((void)0)
54 #define MC_ignore(a, b) ((void)0)
60 #endif /* SIMGRID_MODELCHECKER_H */