20 spot::parsed_formula spotPrefixLtl = spot::parse_prefix_ltl(prefixLtl);
21 if (!spotPrefixLtl.errors.empty()) {
22 std::ostringstream errorMsg;
23 spotPrefixLtl.format_errors(errorMsg);
24 STORM_LOG_THROW(
false, storm::exceptions::ExpressionEvaluationException,
25 "Spot could not parse formula: " << prefixLtl <<
": " << errorMsg.str() <<
".");
27 spot::formula spotFormula = spotPrefixLtl.f;
30 spot::translator trans = spot::translator();
31 trans.set_type(spot::postprocessor::Generic);
32 trans.set_pref(spot::postprocessor::Deterministic | spot::postprocessor::SBAcc | spot::postprocessor::Complete);
33 STORM_LOG_INFO(
"Construct deterministic automaton for " << spotFormula);
34 auto aut = trans.run(spotFormula);
36 if (!(aut->get_acceptance().is_dnf()) && dnf) {
37 STORM_LOG_INFO(
"Convert acceptance condition " << aut->get_acceptance() <<
" into DNF...");
39 aut = to_generalized_rabin(aut,
true);
42 STORM_LOG_INFO(
"The deterministic automaton has acceptance condition: " << aut->get_acceptance());
46 std::stringstream autStream;
48 spot::print_hoa(autStream, aut,
"is");
57 STORM_LOG_THROW(
false, storm::exceptions::MissingLibraryException,
"Storm is compiled without Spot support.");
64 STORM_LOG_INFO(
"Calling external LTL->DA tool: " << ltl2daTool <<
" '" << prefixLtl <<
"' da.hoa");
69 STORM_LOG_THROW(pid >= 0, storm::exceptions::FileIoException,
"Could not construct deterministic automaton, fork failed.");
73 if (execlp(ltl2daTool.c_str(), ltl2daTool.c_str(), prefixLtl.c_str(),
"da.hoa", NULL) < 0) {
74 std::cerr <<
"ERROR: exec failed: " << strerror(errno) <<
'\n';
78 return std::shared_ptr<DeterministicAutomaton>();
83 while (wait(&status) != pid) {
88 if (WIFEXITED(status)) {
89 rv = WEXITSTATUS(status);
91 STORM_LOG_THROW(
false, storm::exceptions::FileIoException,
"Could not construct deterministic automaton: process aborted.");
94 "Could not construct deterministic automaton for " << prefixLtl <<
", return code = " << rv <<
".");
96 STORM_LOG_INFO(
"Reading automaton for " << prefixLtl <<
" from da.hoa");