1 /* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_MC_MODEL_CHECKER_HPP
7 #define SIMGRID_MC_MODEL_CHECKER_HPP
9 #include "src/mc/remote/CheckerSide.hpp"
10 #include "src/mc/remote/RemotePtr.hpp"
11 #include "src/mc/sosp/PageStore.hpp"
16 namespace simgrid::mc {
18 /** State of the model-checker (global variables for the model checker)
21 CheckerSide checker_side_;
22 std::unique_ptr<RemoteProcessMemory> remote_process_memory_;
23 Exploration* exploration_ = nullptr;
26 ModelChecker(ModelChecker const&) = delete;
27 ModelChecker& operator=(ModelChecker const&) = delete;
28 explicit ModelChecker(std::unique_ptr<RemoteProcessMemory> remote_simulation, int sockfd);
30 RemoteProcessMemory& get_remote_process_memory() { return *remote_process_memory_; }
31 Channel& channel() { return checker_side_.get_channel(); }
34 void wait_for_requests();
36 /** Let the application take a transition. A new Transition is created iff the last parameter is true */
37 Transition* handle_simcall(aid_t aid, int times_considered, bool new_transition);
39 Exploration* get_exploration() const { return exploration_; }
40 void set_exploration(Exploration* exploration) { exploration_ = exploration; }
44 bool handle_message(const char* buffer, ssize_t size);
45 void handle_waitpid();
48 } // namespace simgrid::mc