* src/tgbaalgos/reachiter.cc (tgba_reachable_iterator::run)

Reuse s->second to avoid a hash lookup.
* src/tgbaalgos/save.cc (save_bfs::process_state): Delete dest.
This commit is contained in:
Alexandre Duret-Lutz 2004-01-05 17:27:39 +00:00
parent 95f6f2a639
commit 791c389080
6 changed files with 236 additions and 2 deletions

50
src/tgbatest/powerset.cc Normal file
View file

@ -0,0 +1,50 @@
#include <iostream>
#include <cassert>
#include "tgba/tgbaexplicit.hh"
#include "tgbaalgos/powerset.hh"
#include "tgbaparse/public.hh"
#include "tgbaalgos/save.hh"
#include "ltlast/allnodes.hh"
#include "tgbaalgos/dotty.hh"
void
syntax(char* prog)
{
std::cerr << prog << " file" << std::endl;
exit(2);
}
int
main(int argc, char** argv)
{
int exit_code = 0;
if (argc != 2)
syntax(argv[0]);
spot::bdd_dict* dict = new spot::bdd_dict();
spot::ltl::environment& env(spot::ltl::default_environment::instance());
spot::tgba_parse_error_list pel;
spot::tgba_explicit* a = spot::tgba_parse(argv[1], pel, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel))
return 2;
#ifndef DOTTY
spot::tgba_explicit* e = spot::tgba_powerset(a);
spot::tgba_save_reachable(std::cout, e);
delete e;
#else
spot::dotty_reachable(std::cout, a);
#endif
assert(spot::ltl::unop::instance_count() == 0);
assert(spot::ltl::binop::instance_count() == 0);
assert(spot::ltl::multop::instance_count() == 0);
assert(spot::ltl::atomic_prop::instance_count() != 0);
delete a;
assert(spot::ltl::atomic_prop::instance_count() == 0);
delete dict;
return exit_code;
}