Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / src / mc / checker / SafetyChecker.hpp
index e628c92..0d08f13 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2016. The SimGrid Team.
+/* Copyright (c) 2008-2021. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,40 +7,42 @@
 #ifndef SIMGRID_MC_SAFETY_CHECKER_HPP
 #define SIMGRID_MC_SAFETY_CHECKER_HPP
 
+#include "src/mc/VisitedState.hpp"
+#include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_safety.hpp"
+
 #include <list>
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/checker/Checker.hpp"
-#include "src/mc/VisitedState.hpp"
-
 namespace simgrid {
 namespace mc {
 
 class XBT_PRIVATE SafetyChecker : public Checker {
-  simgrid::mc::ReductionMode reductionMode_ = simgrid::mc::ReductionMode::unset;
+  ReductionMode reductionMode_ = ReductionMode::unset;
+
 public:
-  SafetyChecker(Session& session);
-  ~SafetyChecker();
-  int run() override;
-  RecordTrace getRecordTrace() override;
-  std::vector<std::string> getTextualTrace() override;
-  void logState() override;
-private:
-  bool checkNonTermination(simgrid::mc::State* current_state);
-  int backtrack();
-  void restoreState();
+  explicit SafetyChecker();
+  ~SafetyChecker() override = default;
+  void run() override;
+  RecordTrace get_record_trace() override;
+  std::vector<std::string> get_textual_trace() override;
+  void log_state() override;
+
 private:
+  void check_non_termination(const State* current_state);
+  void backtrack();
+  void restore_state();
+
   /** Stack representing the position in the exploration graph */
-  std::list<std::unique_ptr<simgrid::mc::State>> stack_;
-  simgrid::mc::VisitedStates visitedStates_;
-  std::unique_ptr<simgrid::mc::VisitedState> visitedState_;
-  unsigned long expandedStatesCount_ = 0;
+  std::list<std::unique_ptr<State>> stack_;
+  VisitedStates visited_states_;
+  std::unique_ptr<VisitedState> visited_state_;
+  unsigned long expanded_states_count_ = 0;
 };
 
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif