X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/26501dd7026096ebf4d7a8e4ca5d16cea63e2a87..6260d187764dc644d699e1a53454f7efdcc682df:/src/mc/explo/odpor/Execution.hpp diff --git a/src/mc/explo/odpor/Execution.hpp b/src/mc/explo/odpor/Execution.hpp index cfe24bd544..f3bd7eddb1 100644 --- a/src/mc/explo/odpor/Execution.hpp +++ b/src/mc/explo/odpor/Execution.hpp @@ -19,6 +19,8 @@ namespace simgrid::mc::odpor { +std::vector get_textual_trace(const PartialExecution& w); + /** * @brief The occurrence of a transition in an execution * @@ -86,13 +88,15 @@ private: Execution(std::vector&& contents) : contents_(std::move(contents)) {} public: - using Handle = decltype(contents_)::const_iterator; using EventHandle = uint32_t; Execution() = default; Execution(const Execution&) = default; Execution& operator=(Execution const&) = default; Execution(Execution&&) = default; + Execution(const PartialExecution&); + + std::vector get_textual_trace() const; size_t size() const { return this->contents_.size(); } bool empty() const { return this->contents_.empty(); } @@ -139,7 +143,8 @@ public: * can serve as an initial to reverse the race between `e` * and `e'` */ - std::optional get_first_sdpor_initial_from(EventHandle e, std::unordered_set backtrack_set) const; + std::unordered_set get_missing_source_set_actors_from(EventHandle e, + const std::unordered_set& backtrack_set) const; /** * @brief Computes the analogous lines from the SDPOR algorithm @@ -232,6 +237,14 @@ public: */ aid_t get_actor_with_handle(EventHandle handle) const { return get_event_with_handle(handle).get_transition()->aid_; } + /** + * @brief Determines the transition associated with the given handle `handle` + */ + const Transition* get_transition_for_handle(EventHandle handle) const + { + return get_event_with_handle(handle).get_transition().get(); + } + /** * @brief Returns a handle to the newest event of the execution, * if such an event exists @@ -262,6 +275,25 @@ public: */ std::unordered_set get_racing_events_of(EventHandle handle) const; + /** + * @brief Returns a set of events which are in a reversible + * race with the given event handle `handle` + * + * Two events `e` and `e'` in an execution `E` are said to + * be in a reversible race iff + * + * 1. `e` and `e'` race + * 2. In any equivalent execution sequence `E'` to `E` + * where `e` occurs immediately before `e'`, the actor + * running `e'` was enabled in the state prior to `e` + * + * @param handle the event with respect to which + * reversible races are computed + * @returns a set of event handles from which are in a reversible + * race with `handle` + */ + std::unordered_set get_reversible_races_of(EventHandle handle) const; + /** * @brief Computes `pre(e, E)` as described in ODPOR [1] * @@ -303,6 +335,11 @@ public: * actor which executed transition `t`. */ void push_transition(std::shared_ptr); + + /** + * @brief Extends the execution by a sequence of steps + */ + void push_partial_execution(const PartialExecution&); }; } // namespace simgrid::mc::odpor