Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move code in simgrid::mc
[simgrid.git] / src / mc / mc_liveness.h
1 /* Copyright (c) 2007-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SIMGRID_MC_LIVENESS_H
8 #define SIMGRID_MC_LIVENESS_H
9
10 #include <stdint.h>
11
12 #include <simgrid_config.h>
13 #include <xbt/base.h>
14 #include <xbt/fifo.h>
15 #include <xbt/dynar.h>
16 #include <xbt/automaton.h>
17 #include <xbt/memory.hpp>
18 #include "src/mc/mc_state.h"
19
20 SG_BEGIN_DECL()
21
22 SG_END_DECL()
23
24 namespace simgrid {
25 namespace mc {
26
27 extern XBT_PRIVATE xbt_automaton_t property_automaton;
28
29 struct XBT_PRIVATE Pair {
30   int num = 0;
31   int search_cycle = 0;
32   mc_state_t graph_state = nullptr; /* System state included */
33   xbt_automaton_state_t automaton_state = nullptr;
34   simgrid::xbt::unique_ptr<s_xbt_dynar_t> atomic_propositions;
35   int requests = 0;
36   int depth = 0;
37   int exploration_started = 0;
38   int visited_pair_removed = 0;
39
40   Pair();
41   ~Pair();
42
43   Pair(Pair const&) = delete;
44   Pair& operator=(Pair const&) = delete;
45 };
46
47 struct XBT_PRIVATE VisitedPair {
48   int num = 0;
49   int other_num = 0; /* Dot output for */
50   int acceptance_pair = 0;
51   mc_state_t graph_state = nullptr; /* System state included */
52   xbt_automaton_state_t automaton_state = nullptr;
53   simgrid::xbt::unique_ptr<s_xbt_dynar_t> atomic_propositions;
54   size_t heap_bytes_used = 0;
55   int nb_processes = 0;
56   int acceptance_removed = 0;
57   int visited_removed = 0;
58
59   VisitedPair(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions, mc_state_t graph_state);
60   ~VisitedPair();
61 };
62
63 int modelcheck_liveness(void);
64 XBT_PRIVATE void show_stack_liveness(xbt_fifo_t stack);
65 XBT_PRIVATE void dump_stack_liveness(xbt_fifo_t stack);
66
67 XBT_PRIVATE extern xbt_dynar_t visited_pairs;
68 XBT_PRIVATE int is_visited_pair(simgrid::mc::VisitedPair* visited_pair, simgrid::mc::Pair* pair);
69
70 }
71 }
72
73 #endif