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,
"Spot could not parse formula: " << prefixLtl <<
": " << errorMsg.str());
26 spot::formula spotFormula = spotPrefixLtl.f;
29 spot::translator trans = spot::translator();
30 trans.set_type(spot::postprocessor::Generic);
31 trans.set_pref(spot::postprocessor::Deterministic | spot::postprocessor::SBAcc | spot::postprocessor::Complete);
32 STORM_LOG_INFO(
"Construct deterministic automaton for " << spotFormula);
33 auto aut = trans.run(spotFormula);
35 if (!(aut->get_acceptance().is_dnf()) && dnf) {
36 STORM_LOG_INFO(
"Convert acceptance condition " << aut->get_acceptance() <<
" into DNF...");
38 aut = to_generalized_rabin(aut,
true);
41 STORM_LOG_INFO(
"The deterministic automaton has acceptance condition: " << aut->get_acceptance());
45 std::stringstream autStream;
47 spot::print_hoa(autStream, aut,
"is");
56 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Storm is compiled without Spot support.");
63 STORM_LOG_INFO(
"Calling external LTL->DA tool: " << ltl2daTool <<
" '" << prefixLtl <<
"' da.hoa");
68 STORM_LOG_THROW(pid >= 0, storm::exceptions::FileIoException,
"Could not construct deterministic automaton, fork failed");
72 if (execlp(ltl2daTool.c_str(), ltl2daTool.c_str(), prefixLtl.c_str(),
"da.hoa", NULL) < 0) {
73 std::cerr <<
"ERROR: exec failed: " << strerror(errno) <<
'\n';
77 return std::shared_ptr<DeterministicAutomaton>();
82 while (wait(&status) != pid);
85 if (WIFEXITED(status)) {
86 rv = WEXITSTATUS(status);
88 STORM_LOG_THROW(
false, storm::exceptions::FileIoException,
"Could not construct deterministic automaton: process aborted");
91 "Could not construct deterministic automaton for " << prefixLtl <<
", return code = " << rv);
93 STORM_LOG_INFO(
"Reading automaton for " << prefixLtl <<
" from da.hoa");