X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/00e79d1291f14583564ed0eba2d5e56ee30bf7d3..788fd4a0324f3ef5aa40f37eb6e4c8c5accd1164:/src/mc/explo/LivenessChecker.cpp?ds=sidebyside diff --git a/src/mc/explo/LivenessChecker.cpp b/src/mc/explo/LivenessChecker.cpp index c0929f102f..3638fd67a3 100644 --- a/src/mc/explo/LivenessChecker.cpp +++ b/src/mc/explo/LivenessChecker.cpp @@ -23,10 +23,11 @@ VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t prop_state, RemoteApp& remote_app) : num(pair_num), prop_state_(prop_state) { + auto* memory = remote_app.get_remote_process_memory(); this->app_state_ = std::move(app_state); if (not this->app_state_->get_system_state()) - this->app_state_->set_system_state(std::make_shared(pair_num, remote_app.get_page_store())); - this->heap_bytes_used = mc_model_checker->get_remote_process().get_remote_heap_bytes(); + this->app_state_->set_system_state(std::make_shared(pair_num, remote_app.get_page_store(), *memory)); + this->heap_bytes_used = memory->get_remote_heap_bytes(); this->actor_count_ = app_state_->get_actor_count(); this->other_num = -1; this->atomic_propositions = std::move(atomic_propositions); @@ -73,7 +74,8 @@ std::shared_ptr LivenessChecker::insert_acceptance_pair(simgrid::mc std::shared_ptr const& pair_test = *i; if (xbt_automaton_state_compare(pair_test->prop_state_, new_pair->prop_state_) != 0 || *(pair_test->atomic_propositions) != *(new_pair->atomic_propositions) || - (*pair_test->app_state_->get_system_state() != *new_pair->app_state_->get_system_state())) + (not pair_test->app_state_->get_system_state()->equals_to(*new_pair->app_state_->get_system_state(), + *get_remote_app().get_remote_process_memory()))) continue; XBT_INFO("Pair %d already reached (equal to pair %d) !", new_pair->num, pair_test->num); exploration_stack_.pop_back(); @@ -102,7 +104,7 @@ void LivenessChecker::replay() if (_sg_mc_checkpoint > 0) { const Pair* pair = exploration_stack_.back().get(); if (const auto* system_state = pair->app_state_->get_system_state()) { - system_state->restore(&get_remote_app().get_remote_process()); + system_state->restore(*get_remote_app().get_remote_process_memory()); return; } } @@ -118,7 +120,7 @@ void LivenessChecker::replay() std::shared_ptr state = pair->app_state_; if (pair->exploration_started) { - state->get_transition()->replay(); + state->get_transition()->replay(get_remote_app()); XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, state->get_transition()->to_string().c_str(), state.get()); } @@ -150,7 +152,8 @@ int LivenessChecker::insert_visited_pair(std::shared_ptr visited_pa const VisitedPair* pair_test = i->get(); if (xbt_automaton_state_compare(pair_test->prop_state_, visited_pair->prop_state_) != 0 || *(pair_test->atomic_propositions) != *(visited_pair->atomic_propositions) || - (*pair_test->app_state_->get_system_state() != *visited_pair->app_state_->get_system_state())) + (not pair_test->app_state_->get_system_state()->equals_to(*visited_pair->app_state_->get_system_state(), + *get_remote_app().get_remote_process_memory()))) continue; if (pair_test->other_num == -1) visited_pair->other_num = pair_test->num; @@ -177,7 +180,7 @@ void LivenessChecker::purge_visited_pairs() } } -LivenessChecker::LivenessChecker(const std::vector& args) : Exploration(args) {} +LivenessChecker::LivenessChecker(const std::vector& args) : Exploration(args, true) {} LivenessChecker::~LivenessChecker() { xbt_automaton_free(property_automaton_); @@ -241,7 +244,7 @@ xbt_automaton_state_t LivenessChecker::get_automaton_transition_dst(xbt_dynar_t const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t); return transition->dst; } -void LivenessChecker::automaton_register_symbol(RemoteProcess const& remote_process, const char* name, +void LivenessChecker::automaton_register_symbol(RemoteProcessMemory const& remote_process, const char* name, RemotePtr address) { if (property_automaton_ == nullptr) @@ -306,7 +309,7 @@ std::shared_ptr LivenessChecker::create_pair(const Pair* current_pair, xbt /* Add all enabled actors to the interleave set of the initial state */ for (auto const& [aid, _] : next_pair->app_state_->get_actors_list()) if (next_pair->app_state_->is_actor_enabled(aid)) - next_pair->app_state_->mark_todo(aid); + next_pair->app_state_->consider_one(aid); next_pair->requests = next_pair->app_state_->count_todo(); /* FIXME : get search_cycle value for each accepting state */ @@ -398,7 +401,7 @@ void LivenessChecker::run() } } - current_pair->app_state_->execute_next(current_pair->app_state_->next_transition()); + current_pair->app_state_->execute_next(current_pair->app_state_->next_transition(), get_remote_app()); XBT_DEBUG("Execute: %s", current_pair->app_state_->get_transition()->to_string().c_str()); /* Update the dot output */