X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/595e59c568ff5f8510de201bfd800951cdc2adcb..4bcfd40036f842e976d329cd0cee7349b8e0f4d6:/src/mc/checker/LivenessChecker.hpp diff --git a/src/mc/checker/LivenessChecker.hpp b/src/mc/checker/LivenessChecker.hpp index 9b095c1d10..25517a02ed 100644 --- a/src/mc/checker/LivenessChecker.hpp +++ b/src/mc/checker/LivenessChecker.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2015. The SimGrid Team. +/* Copyright (c) 2007-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -14,20 +14,17 @@ #include #include -#include -#include -#include -#include "src/mc/mc_state.h" #include "src/mc/checker/Checker.hpp" - -SG_BEGIN_DECL() - -SG_END_DECL() +#include "src/mc/mc_state.hpp" +#include +#include +#include namespace simgrid { namespace mc { -struct XBT_PRIVATE Pair { +class XBT_PRIVATE Pair { +public: int num = 0; bool search_cycle = false; std::shared_ptr graph_state = nullptr; /* System state included */ @@ -37,18 +34,19 @@ struct XBT_PRIVATE Pair { int depth = 0; bool exploration_started = false; - Pair(unsigned long expanded_pairs); - ~Pair(); + explicit Pair(unsigned long expanded_pairs); + ~Pair() = default; Pair(Pair const&) = delete; Pair& operator=(Pair const&) = delete; }; -struct XBT_PRIVATE VisitedPair { - int num = 0; +class XBT_PRIVATE VisitedPair { +public: + int num; int other_num = 0; /* Dot output for */ std::shared_ptr graph_state = nullptr; /* System state included */ - xbt_automaton_state_t automaton_state = nullptr; + xbt_automaton_state_t automaton_state; std::shared_ptr> atomic_propositions; std::size_t heap_bytes_used = 0; int actors_count = 0; @@ -57,13 +55,13 @@ struct XBT_PRIVATE VisitedPair { int pair_num, xbt_automaton_state_t automaton_state, std::shared_ptr> atomic_propositions, std::shared_ptr graph_state); - ~VisitedPair(); + ~VisitedPair() = default; }; class XBT_PRIVATE LivenessChecker : public Checker { public: - LivenessChecker(Session& session); - ~LivenessChecker(); + explicit LivenessChecker(Session& session); + ~LivenessChecker() = default; void run() override; RecordTrace getRecordTrace() override; std::vector getTextualTrace() override; @@ -79,7 +77,7 @@ private: void purgeVisitedPairs(); void backtrack(); std::shared_ptr newPair(Pair* pair, xbt_automaton_state_t state, std::shared_ptr> propositions); -private: + // A stack of (application_state, automaton_state) pairs for DFS exploration: std::list> explorationStack_; std::list> acceptancePairs_;