Commit 74f14567 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Fix usage of minimize_obligation in the CGI script.

* wrap/python/cgi-bin/ltl2tgba.py (reduce_wdba): Use
minimize_obligation_new a pass the formula.
* wrap/python/spot.i (minimize_obligation_new): New function, to
cope with the strange specification of spot::minimize_obligation()
not always creating a new automaton.
parent a8fb2c4b
2011-01-07 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix usage of minimize_obligation in the CGI script.
* wrap/python/cgi-bin/ltl2tgba.py (reduce_wdba): Use
minimize_obligation_new a pass the formula.
* wrap/python/spot.i (minimize_obligation_new): New function, to
cope with the strange specification of spot::minimize_obligation()
not always creating a new automaton.
2011-01-06 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* NEWS: Convert to utf-8 and fix a few typos.
......
......@@ -574,7 +574,10 @@ elif trans_taa:
if reduce_dmonitor:
automaton = spot.minimize_monitor(automaton)
elif reduce_wdba:
automaton = spot.minimize_obligation(automaton)
minimized = spot.minimize_obligation_new(automaton, f)
if minimized:
automaton = minimized
minimized = 0
elif reduce_scc:
# Do not suppress all useless acceptance conditions if
# degeneralization is requested: keeping those that lead to
......
......@@ -149,7 +149,6 @@ using namespace spot;
%feature("new") spot::ltl_to_tgba_lacim;
%feature("new") spot::minimize_wdba;
%feature("new") spot::minimize_monitor;
%feature("new") spot::minimize_obligation;
%feature("new") spot::reduc_tgba_sim;
%feature("new") spot::scc_filter;
%feature("new") spot::tgba_dupexp_bfs;
......@@ -229,8 +228,23 @@ namespace std {
};
}
%feature("new") minimize_obligation_new;
%inline %{
// A variant of minimize_obligation() that always return a new object.
const spot::tgba*
minimize_obligation_new(const spot::tgba* a, const spot::ltl::formula* f)
{
const tgba* res = spot::minimize_obligation(a, f);
// Return 0 if the output is the same as the input, otherwise
// it is hard for swig to know if the output is "new" or not.
if (res == a)
return 0;
else
return res;
}
spot::ltl::parse_error_list
empty_parse_error_list()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment