Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove empty Comb.cpp
[simgrid.git] / src / mc / explo / Exploration.hpp
index bd99e25..ee3c452 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2016-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -6,7 +6,10 @@
 #ifndef SIMGRID_MC_CHECKER_HPP
 #define SIMGRID_MC_CHECKER_HPP
 
-#include "src/mc/api.hpp"
+#include "simgrid/forward.h"
+#include "src/mc/api/RemoteApp.hpp"
+#include "src/mc/mc_record.hpp"
+#include <xbt/Extendable.hpp>
 
 #include <memory>
 
@@ -27,18 +30,27 @@ namespace simgrid::mc {
 class Exploration : public xbt::Extendable<Exploration> {
   std::unique_ptr<RemoteApp> remote_app_;
 
+  FILE* dot_output_ = nullptr;
+
 public:
   explicit Exploration(const std::vector<char*>& args);
+  virtual ~Exploration();
 
   // No copy:
   Exploration(Exploration const&) = delete;
   Exploration& operator=(Exploration const&) = delete;
 
-  virtual ~Exploration() = default;
-
   /** Main function of this algorithm */
   virtual void run() = 0;
 
+  /** Produce an error message indicating that the application crashed (status was produced by waitpid) */
+  void report_crash(int status);
+  /** Produce an error message indicating that a property was violated */
+  void report_assertion_failure();
+
+  /** Kill the application and the model-checker (which exits with `status`)*/
+  XBT_ATTRIB_NORETURN void system_exit(int status);
+
   /* These methods are callbacks called by the model-checking engine
    * to get and display information about the current state of the
    * model-checking algorithm: */
@@ -55,12 +67,15 @@ public:
   virtual void log_state();
 
   RemoteApp& get_remote_app() { return *remote_app_.get(); }
+
+  /** Print something to the dot output file*/
+  void dot_output(const char* fmt, ...) XBT_ATTRIB_PRINTF(2, 3);
 };
 
 // External constructors so that the types (and the types of their content) remain hidden
 XBT_PUBLIC Exploration* create_liveness_checker(const std::vector<char*>& args);
-XBT_PUBLIC Exploration* create_dfs_exploration(const std::vector<char*>& args);
-XBT_PUBLIC Exploration* create_communication_determinism_checker(const std::vector<char*>& args);
+XBT_PUBLIC Exploration* create_dfs_exploration(const std::vector<char*>& args, bool with_dpor);
+XBT_PUBLIC Exploration* create_communication_determinism_checker(const std::vector<char*>& args, bool with_dpor);
 XBT_PUBLIC Exploration* create_udpor_checker(const std::vector<char*>& args);
 
 } // namespace simgrid::mc