Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add reversible race calculator
[simgrid.git] / src / mc / explo / odpor / ReversibleRaceCalculator.hpp
1 /* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_MC_ODPOR_REVERSIBLE_RACE_CALCULATOR_HPP
7 #define SIMGRID_MC_ODPOR_REVERSIBLE_RACE_CALCULATOR_HPP
8
9 #include "src/mc/explo/udpor/EventSet.hpp"
10 #include "src/mc/explo/udpor/udpor_forward.hpp"
11 #include "src/mc/transition/Transition.hpp"
12 #include "src/mc/transition/TransitionActorJoin.hpp"
13 #include "src/mc/transition/TransitionAny.hpp"
14 #include "src/mc/transition/TransitionComm.hpp"
15 #include "src/mc/transition/TransitionObjectAccess.hpp"
16 #include "src/mc/transition/TransitionRandom.hpp"
17 #include "src/mc/transition/TransitionSynchro.hpp"
18
19 #include <memory>
20
21 namespace simgrid::mc::odpor {
22
23 /**
24  * @brief Computes whether a race between two events
25  * in a given execution is a reversible race.
26  *
27  * @note: All of the methods assume that there is
28  * indeed a race between the two events in the
29  * execution; indeed, the question the method answers
30  * is only sensible in the context of a race
31  */
32 struct ReversibleRaceCalculator final {
33   static EventSet is_race_reversible(const Execution&, Execution::Handle e1, std::shared_ptr<Transition>);
34   static EventSet is_race_reversible(const Execution&, Execution::Handle e1, std::shared_ptr<Transition>);
35   static EventSet is_race_reversible(const Execution&, Execution::Handle e1, std::shared_ptr<Transition>);
36   static EventSet is_race_reversible(const Execution&, Execution::Handle e1, std::shared_ptr<Transition>);
37
38 public:
39   static EventSet is_race_reversible(const Execution&, Execution::Handle e1, Execution::Handle e2);
40 };
41
42 } // namespace simgrid::mc::odpor
43 #endif