return mc_model_checker->get_remote_process().actors();
}
-bool Api::actor_is_enabled(aid_t pid) const
-{
- return session->actor_is_enabled(pid);
-}
-
unsigned long Api::get_maxpid() const
{
static const char* name = nullptr;
// ACTOR APIs
std::vector<simgrid::mc::ActorInformation>& get_actors() const;
- bool actor_is_enabled(aid_t pid) const;
unsigned long get_maxpid() const;
int get_actors_size() const;
/** Log additional information about the state of the model-checker */
virtual void log_state() = 0;
- Session* get_session() { return session_; }
+ Session& get_session() { return *session_; }
};
// External constructors so that the types (and the types of their content) remain hidden
/* Add all enabled actors to the interleave set of the initial state */
for (auto& act : api::get().get_actors()) {
auto actor = act.copy.get_buffer();
- if (api::get().actor_is_enabled(actor->get_pid()))
+ if (get_session().actor_is_enabled(actor->get_pid()))
initial_state->mark_todo(actor);
}
/* Add all enabled actors to the interleave set of the next state */
for (auto& act : api::get().get_actors()) {
auto actor = act.copy.get_buffer();
- if (api::get().actor_is_enabled(actor->get_pid()))
+ if (get_session().actor_is_enabled(actor->get_pid()))
next_state->mark_todo(actor);
}
void CommunicationDeterminismChecker::run()
{
XBT_INFO("Check communication determinism");
- get_session()->take_initial_snapshot();
+ get_session().take_initial_snapshot();
this->prepare();
this->real_run();
/* Add all enabled actors to the interleave set of the initial state */
for (auto& act : api::get().get_actors()) {
auto actor = act.copy.get_buffer();
- if (api::get().actor_is_enabled(actor->get_pid()))
+ if (get_session().actor_is_enabled(actor->get_pid()))
next_pair->graph_state->mark_todo(actor);
}
api::get().automaton_load(_sg_mc_property_file.get().c_str());
XBT_DEBUG("Starting the liveness algorithm");
- get_session()->take_initial_snapshot();
+ get_session().take_initial_snapshot();
/* Initialize */
this->previous_pair_ = 0;
auto actors = api::get().get_actors();
for (auto& remoteActor : actors) {
auto actor = remoteActor.copy.get_buffer();
- if (api::get().actor_is_enabled(actor->get_pid())) {
+ if (get_session().actor_is_enabled(actor->get_pid())) {
next_state->mark_todo(actor);
if (reductionMode_ == ReductionMode::dpor)
break; // With DPOR, we take the first enabled transition
(reductionMode_ == ReductionMode::none ? "none"
: (reductionMode_ == ReductionMode::dpor ? "dpor" : "unknown")));
- get_session()->take_initial_snapshot();
+ get_session().take_initial_snapshot();
XBT_DEBUG("Starting the safety algorithm");
/* Get an enabled actor and insert it in the interleave set of the initial state */
auto actors = api::get().get_actors();
for (auto& actor : actors)
- if (api::get().actor_is_enabled(actor.copy.get_buffer()->get_pid())) {
+ if (get_session().actor_is_enabled(actor.copy.get_buffer()->get_pid())) {
initial_state->mark_todo(actor.copy.get_buffer());
if (reductionMode_ != ReductionMode::none)
break;