Make sure we can multiply two tgba_explicit.
* tgba/state.hh (state::translate, state::clone, state::as_bdd): New virtual methods. * tgba/stataebdd.cc (state::translate, state::clone): New methods. * tgba/stataebdd.hh (state::translate, state::clone): New methods. * tgba/tgbabddprod.cc (state_bdd_product::clone, tgba_bdd_product_succ_iterator::~tgba_bdd_product_succ_iterator): New methods. (tgba_bdd_product_succ_iterator::first): Reset right_ if any of left_ or right_ is already done (i.e., is empty). (tgba_bdd_product_succ_iterator::done): Return true if right_ is NULL. (tgba_bdd_product_succ_iterator::current_state, tgba_bdd_product::get_init_state): Work directory with `state's. * tgba/tgbabddprod.hh (state_bdd_product::clone, tgba_bdd_product_succ_iterator::~tgba_bdd_product_succ_iterator): New methods. * tgba/tgbabddtranslateproxy.cc (tgba_bdd_translate_proxy_succ_iterator:: tgba_bdd_translate_proxy_succ_iterator): Work on any kind of iteraator. (tgba_bdd_translate_proxy_succ_iterator:: ~tgba_bdd_translate_proxy_succ_iterator): New method. (tgba_bdd_translate_proxy_succ_iterator::current_state, tgba_bdd_translate_proxy::get_init_state, tgba_bdd_translate_proxy::succ_iter): Work on `state's and `tgba_succ_iterator's directlry. (tgba_bdd_translate_proxy::format_state): Delegate formating to the proxied automata. * tgba/tgbaexplicit.cc (state_explicit::clone): New method. * src/tgba/tgbaexplicit.cc (tgba_explicit::get_condition, tgba_explicit::get_promise): Call ltl::destroy on existing formulae. * tgbatest/Makefile.am (check_PROGRAMS): Add explprod. (explprod_SOURCES): New variable. (TESTS): Add explprod.test. (CLEANFILES): Add input1 and input2.
This commit is contained in:
parent
5d2e0a4224
commit
ab09c18597
16 changed files with 275 additions and 85 deletions
48
src/tgbatest/explprod.cc
Normal file
48
src/tgbatest/explprod.cc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include "tgba/ltl2tgba.hh"
|
||||
#include "tgba/tgbaexplicit.hh"
|
||||
#include "tgba/tgbabddprod.hh"
|
||||
#include "tgbaparse/public.hh"
|
||||
#include "tgbaalgos/save.hh"
|
||||
#include "ltlast/allnodes.hh"
|
||||
|
||||
void
|
||||
syntax(char* prog)
|
||||
{
|
||||
std::cerr << prog << " file1 file2" << std::endl;
|
||||
exit(2);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
int exit_code = 0;
|
||||
|
||||
if (argc != 3)
|
||||
syntax(argv[0]);
|
||||
|
||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
spot::tgba_parse_error_list pel1;
|
||||
spot::tgba_explicit* a1 = spot::tgba_parse(argv[1], pel1, env);
|
||||
if (spot::format_tgba_parse_errors(std::cerr, pel1))
|
||||
return 2;
|
||||
spot::tgba_parse_error_list pel2;
|
||||
spot::tgba_explicit* a2 = spot::tgba_parse(argv[2], pel2, env);
|
||||
if (spot::format_tgba_parse_errors(std::cerr, pel1))
|
||||
return 2;
|
||||
|
||||
{
|
||||
spot::tgba_bdd_product p(*a1, *a2);
|
||||
spot::tgba_save_reachable(std::cout, p);
|
||||
}
|
||||
|
||||
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 a1;
|
||||
delete a2;
|
||||
assert(spot::ltl::atomic_prop::instance_count() == 0);
|
||||
return exit_code;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue