Now succ_iter() can fetch extra information from
the root of a product to reduce its number of successors. * src/tgba/Makefile.am (libtgba_la_SOURCES): Add tgba.cc. * src/tgba/tgba.hh (tgba::succ_iter): Add the global_state and global_automaton arguments. (tgba::support_conditions, tgba::support_variables, tgba::compute_support_conditions, tgba::compute_support_variables): New functions. (tgba::last_support_conditions_input_, tgba::last_support_conditions_output_, tgba::last_support_variables_input_, tgba::last_support_variables_output_): New attributes. * src/tgba/tgbabddconcrete.cc (tgba_bdd_concrete::succ_iter): Handle the two new arguments. (tgba_bdd_concrete::compute_support_conditions, tgba_bdd_concrete::compute_support_variables): Implement them. * src/tgba/tgbabddconcrete.hh: Adjust. * src/tgba/tgbaexplicit.cc (tgba_explicit::succ_iter): Ignore the two new arguments. (tgba_explicit::compute_support_conditions, tgba_explicit::compute_support_variables): Implement them. * src/tgba/tgbaexplicit.hh: Adjust. * src/tgba/tgbaproduct.cc (tgba_product::succ_iter): Handle the two new arguments. (tgba_product::compute_support_conditions, tgba_product::compute_support_variables): Implement them. * src/tgba/tgbaproduct.hh: Adjust. * iface/gspn/gspn.cc (tgba_gspn_private_::last_state_cond_input, tgba_gspn_private_::last_state_cond_output, (tgba_gspn_private_::tgba_gspn_private_): Set last_state_cond_input. (tgba_gspn_private_::~tgba_gspn_private_): Delete last_state_cond_input. (tgba_gspn_private_::state_conds): New function, eved out from tgba_gspn::succ_iter. (tgba_gspn::succ_iter): Use it. Use the two new arguments. (tgba_gspn::compute_support_conditions, tgba_gspn::compute_support_variables): New functions. * iface/gspn/gspn.hh: Adjust.
This commit is contained in:
parent
4bf6c52bea
commit
1d9c3d6409
13 changed files with 435 additions and 119 deletions
|
|
@ -31,12 +31,11 @@ namespace spot
|
|||
/// a state.
|
||||
class tgba
|
||||
{
|
||||
public:
|
||||
virtual
|
||||
~tgba()
|
||||
{
|
||||
}
|
||||
protected:
|
||||
tgba();
|
||||
virtual ~tgba();
|
||||
|
||||
public:
|
||||
/// \brief Get the initial state of the automaton.
|
||||
///
|
||||
/// The state has been allocated with \c new. It is the
|
||||
|
|
@ -44,18 +43,63 @@ namespace spot
|
|||
/// longer needed.
|
||||
virtual state* get_init_state() const = 0;
|
||||
|
||||
/// \brief Get an iterator over the successors of \a state.
|
||||
/// \brief Get an iterator over the successors of \a local_state.
|
||||
///
|
||||
/// The iterator has been allocated with \c new. It is the
|
||||
/// responsability of the caller to \c delete it when no
|
||||
/// longer needed.
|
||||
///
|
||||
/// \param state is the state whose successors are to be explored.
|
||||
/// During synchornized products, additional informations are
|
||||
/// passed about the entire product and its state. Recall that
|
||||
/// products can be nested, forming a tree of spot::tgba where
|
||||
/// most values are computed on demand. \a global_automaton
|
||||
/// designate the root spot::tgba, and \a global_state its
|
||||
/// state. This two objects can be used by succ_iter() to
|
||||
/// restrict the set of successors to compute.
|
||||
///
|
||||
/// \param local_state The state whose successors are to be explored.
|
||||
/// This pointer is not adopted in any way by \c succ_iter, and
|
||||
/// it is still the caller's responsability to delete it when
|
||||
/// appropriate (this can be done during the lifetime of
|
||||
/// the iterator).
|
||||
virtual tgba_succ_iterator* succ_iter(const state* state) const = 0;
|
||||
/// \param global_state In a product, the state of the global
|
||||
/// product automaton. Otherwise, 0. Like \a locale_state,
|
||||
/// \a global_state is not adopted by \c succ_iter.
|
||||
/// \param global_automaton In a product, the state of the global
|
||||
/// product automaton. Otherwise, 0.
|
||||
virtual tgba_succ_iterator*
|
||||
succ_iter(const state* local_state,
|
||||
const state* global_state = 0,
|
||||
const tgba* global_automaton = 0) const = 0;
|
||||
|
||||
/// \brief Get a formula that must hold whatever successor is taken.
|
||||
///
|
||||
/// \return A formula which must be verified for all successors
|
||||
/// of \a state.
|
||||
///
|
||||
/// This can be as simple as \c bddtrue, or more completely
|
||||
/// the disjunction of the condition of all successors. This
|
||||
/// is used as an hint by \c succ_iter() to reduce the number
|
||||
/// of successor to compute in a product.
|
||||
///
|
||||
/// Sub classes should implement compute_support_conditions(),
|
||||
/// this function is just a wrapper that will cache the
|
||||
/// last return value for efficiency.
|
||||
bdd support_conditions(const state* state) const;
|
||||
|
||||
/// \brief Get the conjunctions of variables tested by
|
||||
/// the outgoing transitions of \a state.
|
||||
///
|
||||
/// All variables tested by outgoing transitions must be
|
||||
/// returned. This is mandatory.
|
||||
///
|
||||
/// This is used as an hint by some \c succ_iter() to reduce the
|
||||
/// number of successor to compute in a product.
|
||||
///
|
||||
/// Sub classes should implement compute_support_variables(),
|
||||
/// this function is just a wrapper that will cache the
|
||||
/// last return value for efficiency.
|
||||
bdd support_variables(const state* state) const;
|
||||
|
||||
/// \brief Get the dictionary associated to the automaton.
|
||||
///
|
||||
|
|
@ -89,10 +133,21 @@ namespace spot
|
|||
/// <tt>Acc[b]</tt> and <tt>Acc[c]</tt> to describe accepting sets,
|
||||
/// this function should return <tt>!Acc[a]\&!Acc[b]\&!Acc[c]</tt>.
|
||||
///
|
||||
/// This is useful when making products: each operand conditions
|
||||
/// This is useful when making products: each operand's condition
|
||||
/// set should be augmented with the neg_accepting_conditions() of
|
||||
/// the other operand.
|
||||
virtual bdd neg_accepting_conditions() const = 0;
|
||||
|
||||
protected:
|
||||
/// Do the actual computation of tgba::support_conditions().
|
||||
virtual bdd compute_support_conditions(const state* state) const = 0;
|
||||
/// Do the actual computation of tgba::support_variables().
|
||||
virtual bdd compute_support_variables(const state* state) const = 0;
|
||||
private:
|
||||
mutable const state* last_support_conditions_input_;
|
||||
mutable bdd last_support_conditions_output_;
|
||||
mutable const state* last_support_variables_input_;
|
||||
mutable bdd last_support_variables_output_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue