remove twa::compute_support_conditions
Fixes #148. * spot/twa/twa.hh, spot/twa/twa.cc, spot/kripke/fairkripke.hh, spot/kripke/fairkripke.cc, spot/ta/tgtaexplicit.hh, spot/ta/tgtaexplicit.cc, spot/twa/twagraph.hh, spot/twa/twaproduct.hh, spot/twa/twaproduct.cc, spot/twaalgos/stutter.cc, spot/twa/taatgba.hh, spot/twa/taatgba.cc: Remove the method. * spot/taalgos/tgba2ta.cc: Emulate it with a simple loop. * NEWS: Mention the removal.
This commit is contained in:
parent
39b95474f8
commit
a3e0c8624e
14 changed files with 15 additions and 120 deletions
|
|
@ -66,22 +66,6 @@ namespace spot
|
|||
return new taa_succ_iterator(s->get_state(), acc());
|
||||
}
|
||||
|
||||
bdd
|
||||
taa_tgba::compute_support_conditions(const spot::state* s) const
|
||||
{
|
||||
const spot::set_state* se = down_cast<const spot::set_state*>(s);
|
||||
assert(se);
|
||||
const state_set* ss = se->get_state();
|
||||
|
||||
bdd res = bddtrue;
|
||||
taa_tgba::state_set::const_iterator i;
|
||||
taa_tgba::state::const_iterator j;
|
||||
for (i = ss->begin(); i != ss->end(); ++i)
|
||||
for (j = (*i)->begin(); j != (*i)->end(); ++j)
|
||||
res |= (*j)->condition;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*----------.
|
||||
| state_set |
|
||||
`----------*/
|
||||
|
|
|
|||
|
|
@ -58,8 +58,6 @@ namespace spot
|
|||
virtual std::string format_state(const spot::state* state) const = 0;
|
||||
|
||||
protected:
|
||||
virtual bdd compute_support_conditions(const spot::state* state)
|
||||
const final;
|
||||
|
||||
typedef std::vector<taa_tgba::state_set*> ss_vec;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ namespace spot
|
|||
{
|
||||
twa::twa(const bdd_dict_ptr& d)
|
||||
: iter_cache_(nullptr),
|
||||
dict_(d),
|
||||
last_support_conditions_input_(nullptr)
|
||||
dict_(d)
|
||||
{
|
||||
props = 0U;
|
||||
bddaps_ = bddtrue;
|
||||
|
|
@ -39,27 +38,11 @@ namespace spot
|
|||
|
||||
twa::~twa()
|
||||
{
|
||||
if (last_support_conditions_input_)
|
||||
last_support_conditions_input_->destroy();
|
||||
delete iter_cache_;
|
||||
release_named_properties();
|
||||
get_dict()->unregister_all_my_variables(this);
|
||||
}
|
||||
|
||||
bdd
|
||||
twa::support_conditions(const state* state) const
|
||||
{
|
||||
if (!last_support_conditions_input_
|
||||
|| last_support_conditions_input_->compare(state) != 0)
|
||||
{
|
||||
last_support_conditions_output_ = compute_support_conditions(state);
|
||||
if (last_support_conditions_input_)
|
||||
last_support_conditions_input_->destroy();
|
||||
last_support_conditions_input_ = state->clone();
|
||||
}
|
||||
return last_support_conditions_output_;
|
||||
}
|
||||
|
||||
state*
|
||||
twa::project_state(const state* s,
|
||||
const const_twa_ptr& t) const
|
||||
|
|
|
|||
|
|
@ -687,21 +687,6 @@ namespace spot
|
|||
iter_cache_ = i;
|
||||
}
|
||||
|
||||
/// \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 precisely
|
||||
/// 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 dictionary associated to the automaton.
|
||||
///
|
||||
/// Automata are labeled by Boolean formulas over atomic
|
||||
|
|
@ -901,12 +886,7 @@ namespace spot
|
|||
return acc_.mark(0);
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Do the actual computation of tgba::support_conditions().
|
||||
virtual bdd compute_support_conditions(const state* state) const = 0;
|
||||
mutable const state* last_support_conditions_input_;
|
||||
private:
|
||||
mutable bdd last_support_conditions_output_;
|
||||
std::vector<formula> aps_;
|
||||
bdd bddaps_;
|
||||
|
||||
|
|
|
|||
|
|
@ -202,9 +202,6 @@ namespace spot
|
|||
|
||||
virtual ~twa_graph()
|
||||
{
|
||||
// Prevent this state from being destroyed by ~twa(),
|
||||
// as the state will be destroyed when g_ is destroyed.
|
||||
last_support_conditions_input_ = nullptr;
|
||||
}
|
||||
|
||||
#ifndef SWIG
|
||||
|
|
@ -425,14 +422,6 @@ namespace spot
|
|||
SPOT_RETURN(g_.is_dead_edge(t));
|
||||
#endif
|
||||
|
||||
virtual bdd compute_support_conditions(const state* s) const
|
||||
{
|
||||
bdd sum = bddfalse;
|
||||
for (auto& t: out(state_number(s)))
|
||||
sum |= t.cond;
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// Iterate over all edges, and merge those with compatible
|
||||
/// extremities and acceptance.
|
||||
void merge_edges();
|
||||
|
|
|
|||
|
|
@ -318,13 +318,6 @@ namespace spot
|
|||
|
||||
twa_product::~twa_product()
|
||||
{
|
||||
// Prevent these states from being destroyed by ~tgba(): they
|
||||
// will be destroyed before when the pool is destructed.
|
||||
if (last_support_conditions_input_)
|
||||
{
|
||||
last_support_conditions_input_->destroy();
|
||||
last_support_conditions_input_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const state*
|
||||
|
|
@ -359,16 +352,6 @@ namespace spot
|
|||
return new twa_succ_iterator_product(li, ri, this, p);
|
||||
}
|
||||
|
||||
bdd
|
||||
twa_product::compute_support_conditions(const state* in) const
|
||||
{
|
||||
const state_product* s = down_cast<const state_product*>(in);
|
||||
assert(s);
|
||||
bdd lsc = left_->support_conditions(s->left());
|
||||
bdd rsc = right_->support_conditions(s->right());
|
||||
return lsc & rsc;
|
||||
}
|
||||
|
||||
const acc_cond& twa_product::left_acc() const
|
||||
{
|
||||
return left_->acc();
|
||||
|
|
|
|||
|
|
@ -102,9 +102,6 @@ namespace spot
|
|||
const acc_cond& left_acc() const;
|
||||
const acc_cond& right_acc() const;
|
||||
|
||||
protected:
|
||||
virtual bdd compute_support_conditions(const state* state) const;
|
||||
|
||||
protected:
|
||||
const_twa_ptr left_;
|
||||
const_twa_ptr right_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue