1 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid */
3 /* Copyright (c) 2008-2022. The SimGrid Team. All rights reserved. */
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. */
8 #ifndef SIMGRID_MODELCHECKER_H
9 #define SIMGRID_MODELCHECKER_H
11 #include <simgrid/config.h> /* SIMGRID_HAVE_MC ? */
14 #include <stddef.h> /* size_t */
18 /** Explore every branches where that function returns a value between min and max (inclusive) */
19 XBT_PUBLIC int MC_random(int min, int max);
23 /* Internal variable used to check if we're running under the MC. Please use MC_is_active instead. */
24 extern XBT_PUBLIC int _sg_do_model_check;
25 extern XBT_PUBLIC int _sg_mc_max_visited_states;
27 #define MC_is_active() _sg_do_model_check
28 #define MC_visited_reduction() _sg_mc_max_visited_states
30 /** Assertion for the model-checker
32 * This function is used to define safety properties to verify.
34 XBT_PUBLIC void MC_assert(int);
36 XBT_PUBLIC void MC_automaton_new_propositional_symbol(const char* id, int (*fct)(void));
37 XBT_PUBLIC void MC_automaton_new_propositional_symbol_pointer(const char* id, int* value);
39 XBT_PUBLIC void MC_ignore_heap(void* address, size_t size);
40 XBT_PUBLIC void MC_unignore_heap(void* address, size_t size);
44 #define MC_is_active() 0
45 #define MC_visited_reduction() 0
47 #define MC_assert(a) xbt_assert(a)
49 #define MC_automaton_new_propositional_symbol(a, b) ((void)0)
50 #define MC_automaton_new_propositional_symbol_pointer(a, b) ((void)0)
52 #define MC_ignore_heap(a, s) ((void)0)
53 #define MC_unignore_heap(a, s) ((void)0)
59 #endif /* SIMGRID_MODELCHECKER_H */