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, void* fct);
32 XBT_PUBLIC(void *) MC_snapshot(void);
33 XBT_PUBLIC(int) MC_compare_snapshots(void *s1, void *s2);
34 XBT_PUBLIC(void) MC_cut(void);
35 XBT_PUBLIC(void) MC_ignore(void *addr, size_t size);
39 #define MC_is_active() 0
40 #define MC_visited_reduction() 0
42 #define MC_assert(a) xbt_assert(a)
43 #define MC_automaton_new_propositional_symbol(a, b) ((void)0)
44 #define MC_snapshot() ((void*)0)
45 #define MC_compare_snapshots(a, b) 0
46 #define MC_cut() ((void)0)
47 #define MC_ignore(a, b) ((void)0)
51 /** Replay path (if any) in string representation
53 * This is a path as generated by `MC_record_stack_to_string()`.
55 XBT_PUBLIC_DATA(char*) MC_record_path;
57 /** Whether the replay mode is enabled */
58 static inline bool MC_record_replay_is_active(void) {
59 return MC_record_path;
64 #endif /* SIMGRID_MODELCHECKER_H */