Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
2c308ddd02f76b530a5f03104c6d0a4d1fdcb6ba
[simgrid.git] / include / simgrid / modelchecker.h
1 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid    */
2
3 /* Copyright (c) 2008-2023. The SimGrid Team. All rights reserved.          */
4
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. */
7
8 #ifndef SIMGRID_MODELCHECKER_H
9 #define SIMGRID_MODELCHECKER_H
10
11 #include <stddef.h> /* size_t */
12 #include <xbt/base.h>
13
14 SG_BEGIN_DECL
15
16 /** Explore every branches where that function returns a value between min and max (inclusive) */
17 XBT_PUBLIC int MC_random(int min, int max);
18
19 /** Assertion for the model-checker: Defines a safety property to verify */
20 XBT_PUBLIC void MC_assert(int);
21
22 /** Check whether the model-checker is currently active, ie if this process was started with simgrid-mc.
23  *  It is off in simulation or when replaying MC traces (see MC_record_replay_is_active()) */
24 XBT_PUBLIC int MC_is_active();
25
26 XBT_PUBLIC void MC_automaton_new_propositional_symbol_pointer(const char* id, int* value);
27
28 XBT_PUBLIC void MC_ignore(void* addr, size_t size);
29 XBT_PUBLIC void MC_unignore(void* addr, size_t size);
30 XBT_PUBLIC void MC_ignore_heap(void* address, size_t size);
31 XBT_PUBLIC void MC_unignore_heap(void* address, size_t size);
32
33 SG_END_DECL
34
35 #endif /* SIMGRID_MODELCHECKER_H */