Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc_api::compare_automaton_exp_lable() defined. It's called in evaluate_label()
[simgrid.git] / src / mc / checker / LivenessChecker.cpp
index bdebbc2..97d14fb 100644 (file)
@@ -54,12 +54,9 @@ static bool evaluate_label(const xbt_automaton_exp_label* l, std::vector<int> co
   case xbt_automaton_exp_label::AUT_NOT:
     return not evaluate_label(l->u.exp_not, values);
   case xbt_automaton_exp_label::AUT_PREDICAT:{
-      unsigned int cursor = 0;
-      xbt_automaton_propositional_symbol_t p = nullptr;
-      xbt_dynar_foreach(simgrid::mc::property_automaton->propositional_symbols, cursor, p) {
-        if (std::strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0)
-          return values[cursor] != 0;
-      }
+      auto cursor = mcapi::get().compare_automaton_exp_lable(l, values);
+      if(cursor >= 0)
+        return values[cursor] != 0;
       xbt_die("Missing predicate");
       break;
     }