Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Add Factor some gorry code to State::getRecordElement()
[simgrid.git] / src / mc / LivenessChecker.cpp
index 567548f..2837d43 100644 (file)
@@ -296,15 +296,8 @@ LivenessChecker::~LivenessChecker()
 RecordTrace LivenessChecker::getRecordTrace() // override
 {
   RecordTrace res;
-  for (std::shared_ptr<Pair> const& pair : explorationStack_) {
-    int value;
-    smx_simcall_t req = MC_state_get_executed_request(pair->graph_state.get(), &value);
-    if (req && req->call != SIMCALL_NONE) {
-      smx_process_t issuer = MC_smx_simcall_get_issuer(req);
-      const int pid = issuer->pid;
-      res.push_back(RecordTraceElement(pid, value));
-    }
-  }
+  for (std::shared_ptr<Pair> const& pair : explorationStack_)
+    res.push_back(pair->graph_state->getRecordElement());
   return res;
 }
 
@@ -398,9 +391,6 @@ int LivenessChecker::main(void)
       simgrid::mc::request_to_string(
         req, value, simgrid::mc::RequestType::simix).c_str());
 
-    /* Set request as executed */
-    MC_state_set_executed_request(current_pair->graph_state.get(), req, value);
-
     /* Update mc_stats */
     mc_stats->executed_transitions++;
     if (!current_pair->exploration_started)
@@ -449,7 +439,7 @@ std::shared_ptr<Pair> LivenessChecker::newPair(Pair* current_pair, xbt_automaton
   /* Get enabled processes and insert them in the interleave set of the next graph_state */
   for (auto& p : mc_model_checker->process().simix_processes())
     if (simgrid::mc::process_is_enabled(&p.copy))
-      MC_state_interleave_process(next_pair->graph_state.get(), &p.copy);
+      next_pair->graph_state->interleave(&p.copy);
   next_pair->requests = next_pair->graph_state->interleaveSize();
   /* FIXME : get search_cycle value for each acceptant state */
   if (next_pair->automaton_state->type == 1 ||