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
|
|
@ -7,7 +7,7 @@
|
|||
namespace spot
|
||||
{
|
||||
|
||||
/// \brief A state for spot::tgba_bdd_product.
|
||||
/// \brief A state for spot::tgba_bdd_product.
|
||||
///
|
||||
/// This state is in fact a pair of state: the state from the left
|
||||
/// automaton and that of the right.
|
||||
|
|
@ -19,32 +19,33 @@ namespace spot
|
|||
/// \param right The state from the right automaton.
|
||||
/// These state are acquired by spot::state_bdd_product, and will
|
||||
/// be deleted on destruction.
|
||||
state_bdd_product(state_bdd* left, state_bdd* right)
|
||||
: state_bdd(left->as_bdd() & right->as_bdd()),
|
||||
left_(left),
|
||||
state_bdd_product(state* left, state* right)
|
||||
: state_bdd(left->as_bdd() & right->as_bdd()),
|
||||
left_(left),
|
||||
right_(right)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
virtual ~state_bdd_product();
|
||||
|
||||
state_bdd*
|
||||
state*
|
||||
left() const
|
||||
{
|
||||
return left_;
|
||||
}
|
||||
|
||||
state_bdd*
|
||||
state*
|
||||
right() const
|
||||
{
|
||||
return right_;
|
||||
}
|
||||
|
||||
virtual int compare(const state* other) const;
|
||||
virtual state_bdd_product* clone() const;
|
||||
|
||||
private:
|
||||
state_bdd* left_; ///< State from the left automaton.
|
||||
state_bdd* right_; ///< State from the right automaton.
|
||||
state* left_; ///< State from the left automaton.
|
||||
state* right_; ///< State from the right automaton.
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -52,16 +53,18 @@ namespace spot
|
|||
class tgba_bdd_product_succ_iterator: public tgba_succ_iterator
|
||||
{
|
||||
public:
|
||||
tgba_bdd_product_succ_iterator(tgba_succ_iterator* left,
|
||||
tgba_bdd_product_succ_iterator(tgba_succ_iterator* left,
|
||||
tgba_succ_iterator* right);
|
||||
|
||||
|
||||
virtual ~tgba_bdd_product_succ_iterator();
|
||||
|
||||
// iteration
|
||||
void first();
|
||||
void next();
|
||||
bool done();
|
||||
|
||||
// inspection
|
||||
state_bdd* current_state();
|
||||
state_bdd_product* current_state();
|
||||
bdd current_condition();
|
||||
bdd current_promise();
|
||||
|
||||
|
|
@ -77,7 +80,7 @@ namespace spot
|
|||
tgba_succ_iterator* right_;
|
||||
bdd current_cond_;
|
||||
};
|
||||
|
||||
|
||||
/// \brief A lazy product. (States are computed on the fly.)
|
||||
class tgba_bdd_product : public tgba
|
||||
{
|
||||
|
|
@ -87,12 +90,12 @@ namespace spot
|
|||
/// \param right The right automata in the product.
|
||||
/// Do not be fooled by these arguments: a product \emph is commutative.
|
||||
tgba_bdd_product(const tgba& left, const tgba& right);
|
||||
|
||||
|
||||
virtual ~tgba_bdd_product();
|
||||
|
||||
|
||||
virtual state* get_init_state() const;
|
||||
|
||||
virtual tgba_bdd_product_succ_iterator*
|
||||
virtual tgba_bdd_product_succ_iterator*
|
||||
succ_iter(const state* state) const;
|
||||
|
||||
virtual const tgba_bdd_dict& get_dict() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue