ec_algos;
-spot::emptiness_check*
+spot::emptiness_check_ptr
cons_emptiness_check(int num, spot::const_tgba_ptr a,
const spot::const_tgba_ptr& degen,
unsigned int n_acc)
{
- spot::emptiness_check_instantiator* inst = ec_algos[num].inst;
+ auto inst = ec_algos[num].inst;
if (n_acc < inst->min_acceptance_conditions()
|| n_acc > inst->max_acceptance_conditions())
a = degen;
@@ -380,7 +380,7 @@ struct ar_stat
}
void
- count(const spot::tgba_run* run)
+ count(const spot::const_tgba_run_ptr& run)
{
int p = run->prefix.size();
int c = run->cycle.size();
@@ -837,9 +837,8 @@ main(int argc, char** argv)
{
const char* err;
ec_algos[i].inst =
- spot::emptiness_check_instantiator::construct(ec_algos[i]
- .name.c_str(),
- &err);
+ spot::make_emptiness_check_instantiator(ec_algos[i].name.c_str(),
+ &err);
if (ec_algos[i].inst == 0)
{
std::cerr << "Parse error after `" << err << '\'' << std::endl;
@@ -939,9 +938,7 @@ main(int argc, char** argv)
for (int i = 0; i < n_alg; ++i)
{
- spot::emptiness_check* ec;
- spot::emptiness_check_result* res;
- ec = cons_emptiness_check(i, a, degen, real_n_acc);
+ auto ec = cons_emptiness_check(i, a, degen, real_n_acc);
if (!ec)
continue;
++n_ec;
@@ -952,17 +949,16 @@ main(int argc, char** argv)
std::cout << algo << ": ";
}
tm_ec.start(algo);
+ spot::emptiness_check_result_ptr res;
for (int count = opt_R;;)
{
res = ec->check();
if (count-- <= 0)
break;
- delete res;
- delete ec;
ec = cons_emptiness_check(i, a, degen, real_n_acc);
}
tm_ec.stop(algo);
- const spot::unsigned_statistics* ecs = ec->statistics();
+ auto ecs = ec->statistics();
if (opt_z && res)
{
// Notice that ratios are computed w.r.t. the
@@ -1001,7 +997,7 @@ main(int argc, char** argv)
++n_non_empty;
if (opt_replay)
{
- spot::tgba_run* run;
+ spot::tgba_run_ptr run;
bool done = false;
tm_ar.start(algo);
for (int count = opt_R;;)
@@ -1030,7 +1026,6 @@ main(int argc, char** argv)
if (count-- <= 0 || !run)
break;
- delete run;
}
if (!run)
{
@@ -1065,7 +1060,7 @@ main(int argc, char** argv)
if (opt_reduce)
{
- spot::tgba_run* redrun =
+ auto redrun =
spot::reduce_run(res->automaton(), run);
if (!spot::replay_tgba_run(s,
res
@@ -1093,14 +1088,11 @@ main(int argc, char** argv)
<< redrun->cycle.size()
<< ']';
}
- delete redrun;
}
- delete run;
}
}
if (!opt_paper)
std::cout << std::endl;
- delete res;
}
else
{
@@ -1122,7 +1114,6 @@ main(int argc, char** argv)
if (opt_Z && !opt_paper)
ec->print_stats(std::cout);
- delete ec;
}
assert(n_empty + n_non_empty + n_maybe_empty == n_ec);
@@ -1310,10 +1301,6 @@ main(int argc, char** argv)
delete formula_file;
}
- if (opt_ec)
- for (unsigned i = 0; i < ec_algos.size(); ++i)
- delete ec_algos[i].inst;
-
delete ap;
delete apf;
return exit_code;
diff --git a/wrap/python/ajax/spot.in b/wrap/python/ajax/spot.in
index 6d77fa918..6877b47c6 100755
--- a/wrap/python/ajax/spot.in
+++ b/wrap/python/ajax/spot.in
@@ -102,7 +102,6 @@ if not script:
httpd.serve_forever()
import cgi
-import cgitb; cgitb.enable()
import signal
import time
import os.path
@@ -120,6 +119,9 @@ sys.stdout = os.fdopen(sys.stdout.fileno(), "wb", 0)
# even errors from subprocesses get printed).
os.dup2(sys.stdout.fileno(), sys.stderr.fileno())
+import cgitb
+sys.excepthook = cgitb.Hook(file=sys.stderr)
+
# Create the temporary cache directory
os.mkdir(tmpdir, 493) # See comment above about 0o755 or 0755.
@@ -533,7 +535,7 @@ elif translator == 'ta':
refined_rules = False
if form.getfirst('ta', '') == 'lc':
refined_rules = True
- automaton = spot.ltl_to_taa(f, dict, refined_rules)
+ automaton = spot.tgba_dupexp_dfs(spot.ltl_to_taa(f, dict, refined_rules))
elif translator == 'l3':
l3out = '-T'
l3opt = { '-l', '-P', '-A', '-c', '-C', '-o', '-p' }
@@ -770,7 +772,7 @@ if output_type == 'r':
err = ""
opt = (form.getfirst('ec', 'Cou99') + "(" +
form.getfirst('eo', '') + ")")
- eci, err = spot.emptiness_check_instantiator.construct(opt)
+ eci, err = spot.make_emptiness_check_instantiator(opt)
if not eci:
unbufprint('Cannot parse "' + opt
@@ -824,8 +826,4 @@ if output_type == 'r':
del ec_run
del ec_res
unbufprint('
')
- del ec
- del ec_a
- degen = 0
- automaton = 0
finish()
diff --git a/wrap/python/spot.i b/wrap/python/spot.i
index a4483cb52..ed3c4eb42 100644
--- a/wrap/python/spot.i
+++ b/wrap/python/spot.i
@@ -36,7 +36,6 @@
// sed 's/.*<\(.*\)>.*/%shared_ptr(spot::\1)/g'
%shared_ptr(spot::bdd_dict)
%shared_ptr(spot::dstar_aut)
-%shared_ptr(spot::dstar_aut)
%shared_ptr(spot::future_conditions_collector)
%shared_ptr(spot::kripke)
%shared_ptr(spot::saba)
@@ -56,6 +55,10 @@
%shared_ptr(spot::tgba_sgba_proxy)
%shared_ptr(spot::tgta)
%shared_ptr(spot::tgta_explicit)
+%shared_ptr(spot::tgba_run)
+%shared_ptr(spot::emptiness_check)
+%shared_ptr(spot::emptiness_check_result)
+%shared_ptr(spot::emptiness_check_instantiator)
namespace std {
%template(liststr) list;
@@ -203,19 +206,8 @@ using namespace spot;
%include "ltlvisit/simplify.hh"
%include "ltlvisit/tostring.hh"
%include "ltlvisit/tunabbrev.hh"
-%include "ltlvisit/apcollect.hh"
%include "ltlvisit/lbt.hh"
-%feature("new") spot::emptiness_check::check;
-%feature("new") spot::emptiness_check_instantiator::construct;
-%feature("new") spot::emptiness_check_instantiator::instanciate;
-%feature("new") spot::emptiness_check_result::accepting_run;
-%feature("new") spot::explicit_magic_search;
-%feature("new") spot::explicit_se05_search;
-%feature("new") spot::tgba::get_init_state;
-%feature("new") spot::tgba::succ_iter;
-%feature("new") spot::tgba_succ_iterator::current_state;
-
// Help SWIG with namespace lookups.
#define ltl spot::ltl
%include "tgba/bddprint.hh"
@@ -232,6 +224,9 @@ namespace spot {
};
}
+// Should come after the definition of tgba_digraph
+%include "ltlvisit/apcollect.hh"
+
%include "tgbaalgos/degen.hh"
%include "tgbaalgos/dottydec.hh"
%include "tgbaalgos/dotty.hh"