RecordTrace res;
for (auto const& transition : stack_.back()->get_recipe())
res.push_back(transition);
- res.push_back(stack_.back()->get_transition_out().get());
- return res;
-}
-
-std::vector<std::string> DFSExplorer::get_textual_trace() // override
-{
- std::vector<std::string> trace;
- for (auto const& transition : stack_.back()->get_recipe()) {
- trace.push_back(xbt::string_printf("%ld: %s", transition->aid_, transition->to_string().c_str()));
- }
if (const auto trans = stack_.back()->get_transition_out(); trans != nullptr)
- trace.push_back(xbt::string_printf("%ld: %s", trans->aid_, trans->to_string().c_str()));
- return trace;
+ res.push_back(stack_.back()->get_transition_out().get());
+ return res;
}
void DFSExplorer::restore_stack(std::shared_ptr<State> state)
explicit DFSExplorer(const std::vector<char*>& args, bool with_dpor, bool need_memory_info = false);
void run() override;
RecordTrace get_record_trace() override;
- std::vector<std::string> get_textual_trace() override;
void log_state() override;
/** Called once when the exploration starts */
#include "src/mc/mc_environ.h"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
+#include "xbt/string.hpp"
#if SIMGRID_HAVE_STATEFUL_MC
#include "src/mc/sosp/RemoteProcessMemory.hpp"
return strsignal(WTERMSIG(status));
}
}
+
+std::vector<std::string> Exploration::get_textual_trace()
+{
+ std::vector<std::string> trace;
+ for (auto const& transition : get_record_trace())
+ trace.push_back(xbt::string_printf("%ld: %s", transition->aid_, transition->to_string().c_str()));
+ return trace;
+}
+
XBT_ATTRIB_NORETURN void Exploration::report_crash(int status)
{
XBT_INFO("**************************");
* to get and display information about the current state of the
* model-checking algorithm: */
- /** Show the current trace/stack
- *
- * Could this be handled in the Session/ModelChecker instead? */
+ /** Retrieve the current stack to build an execution trace */
virtual RecordTrace get_record_trace() = 0;
/** Generate a textual execution trace of the simulated application */
- virtual std::vector<std::string> get_textual_trace() = 0;
+ std::vector<std::string> get_textual_trace();
/** Log additional information about the state of the model-checker */
virtual void log_state();
{
RecordTrace res;
for (std::shared_ptr<Pair> const& pair : exploration_stack_)
- res.push_back(pair->app_state_->get_transition_out().get());
+ if (pair->app_state_->get_transition_out() != nullptr)
+ res.push_back(pair->app_state_->get_transition_out().get());
return res;
}
XBT_INFO("Counter-example depth: %zu", depth);
}
-std::vector<std::string> LivenessChecker::get_textual_trace() // override
-{
- std::vector<std::string> trace;
- for (std::shared_ptr<Pair> const& pair : exploration_stack_)
- if (pair->app_state_->get_transition_out() != nullptr)
- trace.push_back(pair->app_state_->get_transition_out()->to_string());
-
- return trace;
-}
-
std::shared_ptr<Pair> LivenessChecker::create_pair(const Pair* current_pair, xbt_automaton_state_t state,
std::shared_ptr<const std::vector<int>> propositions)
{
void run() override;
RecordTrace get_record_trace() override;
- std::vector<std::string> get_textual_trace() override;
void log_state() override;
private:
return res;
}
-std::vector<std::string> UdporChecker::get_textual_trace()
-{
- std::vector<std::string> trace;
- for (auto const& state : state_stack) {
- const auto t = state->get_transition_out();
- trace.push_back(xbt::string_printf("%ld: %s", t->aid_, t->to_string().c_str()));
- }
- return trace;
-}
-
} // namespace simgrid::mc::udpor
namespace simgrid::mc {
void run() override;
RecordTrace get_record_trace() override;
- std::vector<std::string> get_textual_trace() override;
std::unique_ptr<State> get_current_state() { return std::make_unique<State>(get_remote_app()); }
private:
const auto& actor_list = engine->get_actor_list();
if (actor_list.empty()) {
XBT_INFO("The replay of the trace is complete. The application is terminating.");
- } else if (std::none_of(begin(actor_list), end(actor_list),
+ } else if (std::none_of(std::begin(actor_list), std::end(actor_list),
[](const auto& kv) { return mc::actor_is_enabled(kv.second); })) {
XBT_INFO("The replay of the trace is complete. DEADLOCK detected.");
engine->display_all_actor_status();
std::string to_string() const;
void push_back(Transition* t) { transitions_.push_back(t); }
+ std::vector<Transition*>::const_iterator begin() const { return transitions_.begin(); }
+ std::vector<Transition*>::const_iterator end() const { return transitions_.end(); }
/** Replay all transitions of a trace */
void replay() const;