safra: Fix properties and use new API

* src/tests/safra.cc, src/twaalgos/safra.cc: Here.
This commit is contained in:
Alexandre Lewkowicz 2015-11-09 17:45:21 +01:00 committed by Alexandre Duret-Lutz
parent bb93f6e9af
commit d15b5f43a6
2 changed files with 9 additions and 11 deletions

View file

@ -20,7 +20,8 @@
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
#include "ltlparse/public.hh" // ltl::parse #include "tl/parse.hh" // spot::parse_infix_psl
#include "tl/formula.hh" // spot::formula
#include "parseaut/public.hh" #include "parseaut/public.hh"
#include "twa/twagraph.hh" #include "twa/twagraph.hh"
#include "twaalgos/degen.hh" #include "twaalgos/degen.hh"
@ -96,22 +97,19 @@ int main(int argc, char* argv[])
spot::twa_graph_ptr res; spot::twa_graph_ptr res;
if (in_ltl) if (in_ltl)
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
const spot::ltl::formula* f = spot::formula f = spot::parse_infix_psl(input, pel);
spot::ltl::parse_infix_psl(input, pel); if (spot::format_parse_errors(std::cerr, input, pel))
if (spot::ltl::format_parse_errors(std::cerr, input, pel))
return 2; return 2;
spot::translator trans(dict); spot::translator trans(dict);
trans.set_pref(spot::postprocessor::Deterministic); trans.set_pref(spot::postprocessor::Deterministic);
auto tmp = trans.run(f); auto tmp = trans.run(f);
res = spot::tgba_determinisation(tmp, sim, pretty_print, scc_opt); res = spot::tgba_determinisation(tmp, sim, pretty_print, scc_opt);
f->destroy();
} }
else if (in_hoa) else if (in_hoa)
{ {
spot::parse_aut_error_list pel; auto aut = spot::parse_aut(input, dict);
auto aut = spot::parse_aut(input, pel, dict); if (aut->format_errors(std::cerr))
if (spot::format_parse_aut_errors(std::cerr, input, pel))
return 2; return 2;
res = tgba_determinisation(aut->aut, sim, pretty_print, scc_opt); res = tgba_determinisation(aut->aut, sim, pretty_print, scc_opt);
} }

View file

@ -493,7 +493,7 @@ safra_state::compute_succs(const const_twa_graph_ptr& aut,
res->copy_ap_of(aut); res->copy_ap_of(aut);
res->prop_copy(aut, res->prop_copy(aut,
{ false, // state based { false, // state based
true, // inherently_weak false, // inherently_weak
false, // deterministic false, // deterministic
true // stutter inv true // stutter inv
}); });
@ -550,7 +550,7 @@ safra_state::compute_succs(const const_twa_graph_ptr& aut,
// Acceptance is now min(odd) since we con emit Red on paths 0 with new opti // Acceptance is now min(odd) since we con emit Red on paths 0 with new opti
res->set_acceptance(sets, acc_cond::acc_code::parity(false, true, sets)); res->set_acceptance(sets, acc_cond::acc_code::parity(false, true, sets));
res->prop_deterministic(true); res->prop_deterministic(true);
res->prop_state_based_acc(false); res->prop_state_acc(false);
if (bisimulation) if (bisimulation)
res = simulation(res); res = simulation(res);
if (pretty_print) if (pretty_print)