* 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.
63 lines
1.6 KiB
C++
63 lines
1.6 KiB
C++
#ifndef SPOT_TGBA_TGBABDDTRANSLATEPROXY_HH
|
|
# define SPOT_TGBA_TGBABDDTRANSLATEPROXY_HH
|
|
|
|
#include "tgba.hh"
|
|
|
|
namespace spot
|
|
{
|
|
/// \brief Proxy for a spot::tgba_succ_iterator_concrete that renumber
|
|
/// BDD variables on the fly.
|
|
class tgba_bdd_translate_proxy_succ_iterator: public tgba_succ_iterator
|
|
{
|
|
public:
|
|
tgba_bdd_translate_proxy_succ_iterator(tgba_succ_iterator* it,
|
|
bddPair* rewrite);
|
|
virtual ~tgba_bdd_translate_proxy_succ_iterator();
|
|
|
|
// iteration
|
|
void first();
|
|
void next();
|
|
bool done();
|
|
|
|
// inspection
|
|
state* current_state();
|
|
bdd current_condition();
|
|
bdd current_promise();
|
|
protected:
|
|
tgba_succ_iterator* iter_;
|
|
bddPair* rewrite_;
|
|
};
|
|
|
|
|
|
/// \brief Proxy for a spot::tgba_bdd_concrete that renumber BDD variables
|
|
/// on the fly.
|
|
class tgba_bdd_translate_proxy: public tgba
|
|
{
|
|
public:
|
|
/// \brief Constructor.
|
|
/// \param from The spot::tgba to masquerade.
|
|
/// \param to The new dictionary to use.
|
|
tgba_bdd_translate_proxy(const tgba& from,
|
|
const tgba_bdd_dict& to);
|
|
|
|
virtual ~tgba_bdd_translate_proxy();
|
|
|
|
virtual state* get_init_state() const;
|
|
|
|
virtual tgba_bdd_translate_proxy_succ_iterator*
|
|
succ_iter(const state* state) const;
|
|
|
|
virtual const tgba_bdd_dict& get_dict() const;
|
|
|
|
virtual std::string format_state(const state* state) const;
|
|
|
|
private:
|
|
const tgba& from_; ///< The spot::tgba to masquerade.
|
|
tgba_bdd_dict to_; ///< The new dictionar to use.
|
|
bddPair* rewrite_to_; ///< The rewriting pair for from->to.
|
|
bddPair* rewrite_from_; ///< The rewriting pair for to->from.
|
|
};
|
|
|
|
}
|
|
|
|
#endif // SPOT_TGBA_TGBABDDTRANSLATEPROXY_HH
|