* lbtt/: New directory. Contains a patched version of lbtt 1.0.1.
* Makefile.am (MAYBE_LBTT): New variables. (SUBDIRS): Add $(MAYBE_LBTT). (EXTRA_DIST): Add m4/lbtt.m4. * configure.ac: Call AX_CHECK_LBTT. * m4/lbtt.m4: New file. * src/tgbatest/Makefile.am (check_PROGRAMS): Add spotlbtt. (spotlbtt_SOURCES): New variables. (TESTS): Add spotlbtt.test. (CLEANFILE): Add config. * src/tgbatest/defs.in (top_builddir, LBTT, LBTT_TRANSLATE): New substitutions. * src/tgbatest/spotlbtt.cc, src/tgbatest/spotlbtt.test: New files.
This commit is contained in:
parent
71b7da1437
commit
79bed65843
9 changed files with 165 additions and 6 deletions
63
src/tgbatest/spotlbtt.cc
Normal file
63
src/tgbatest/spotlbtt.cc
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include "ltlvisit/destroy.hh"
|
||||
#include "ltlast/allnodes.hh"
|
||||
#include "ltlparse/public.hh"
|
||||
#include "tgbaalgos/ltl2tgba.hh"
|
||||
#include "tgbaalgos/lbtt.hh"
|
||||
|
||||
|
||||
void
|
||||
syntax(char* prog)
|
||||
{
|
||||
std::cerr << "Usage: "<< prog << " file" << std::endl;
|
||||
exit(2);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
int exit_code = 0;
|
||||
|
||||
if (argc != 2)
|
||||
syntax(argv[0]);
|
||||
|
||||
std::ifstream fin(argv[1]);
|
||||
if (! fin)
|
||||
{
|
||||
std::cerr << "Cannot open " << argv[1] << std::endl;
|
||||
exit(2);
|
||||
}
|
||||
|
||||
std::string input;
|
||||
if (! std::getline(fin, input, '\0'))
|
||||
{
|
||||
std::cerr << "Cannot read " << argv[1] << std::endl;
|
||||
exit(2);
|
||||
}
|
||||
|
||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
spot::ltl::parse_error_list pel;
|
||||
spot::ltl::formula* f = spot::ltl::parse(input, pel, env);
|
||||
|
||||
exit_code = spot::ltl::format_parse_errors(std::cerr, input, pel);
|
||||
|
||||
if (f)
|
||||
{
|
||||
spot::tgba_bdd_concrete a = spot::ltl_to_tgba(f);
|
||||
spot::ltl::destroy(f);
|
||||
spot::lbtt_reachable(std::cout, a);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit_code = 1;
|
||||
}
|
||||
|
||||
assert(spot::ltl::atomic_prop::instance_count() == 0);
|
||||
assert(spot::ltl::unop::instance_count() == 0);
|
||||
assert(spot::ltl::binop::instance_count() == 0);
|
||||
assert(spot::ltl::multop::instance_count() == 0);
|
||||
return exit_code;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue