return snapshot;
}
-void Api::s_close()
-{
- if (simgrid::mc::property_automaton != nullptr) {
- xbt_automaton_free(simgrid::mc::property_automaton);
- simgrid::mc::property_automaton = nullptr;
- }
-}
-
-void Api::automaton_load(const char* file) const
-{
- if (simgrid::mc::property_automaton == nullptr)
- simgrid::mc::property_automaton = xbt_automaton_new();
-
- xbt_automaton_load(simgrid::mc::property_automaton, file);
-}
-
-std::vector<int> Api::automaton_propositional_symbol_evaluate() const
-{
- unsigned int cursor = 0;
- std::vector<int> values;
- xbt_automaton_propositional_symbol_t ps = nullptr;
- xbt_dynar_foreach (mc::property_automaton->propositional_symbols, cursor, ps)
- values.push_back(xbt_automaton_propositional_symbol_evaluate(ps));
- return values;
-}
-
-std::vector<xbt_automaton_state_t> Api::get_automaton_state() const
-{
- std::vector<xbt_automaton_state_t> automaton_stack;
- unsigned int cursor = 0;
- xbt_automaton_state_t automaton_state;
- xbt_dynar_foreach (mc::property_automaton->states, cursor, automaton_state)
- if (automaton_state->type == -1)
- automaton_stack.push_back(automaton_state);
- return automaton_stack;
-}
-
-int Api::compare_automaton_exp_label(const xbt_automaton_exp_label* l) const
-{
- 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 cursor;
- }
- return -1;
-}
-
-void Api::set_property_automaton(xbt_automaton_state_t const& automaton_state) const
-{
- mc::property_automaton->current_state = automaton_state;
-}
-
-xbt_automaton_exp_label_t Api::get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const
-{
- const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
- return transition->label;
-}
-
-xbt_automaton_state_t Api::get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const
-{
- const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
- return transition->dst;
-}
-
} // namespace simgrid::mc