* src/tgba/tgba.hh, src/tgba/tgba.cc
(tgba::project_state): New method. * src/tgba/tgbaproduct.hh, src/tgba/tgbaproduct.cc (tgba_product::project_state): New method. * src/tgba/tgbabta.hh, src/tgba/tgbabta.cc (tgba_bta_proxy::project_state): New method. * src/tgbaalgos/magic.cc (magic_search::print_result): Take a restrict argument.
This commit is contained in:
parent
a66ad58b5d
commit
24099078d6
10 changed files with 106 additions and 18 deletions
|
|
@ -7,7 +7,7 @@ namespace spot
|
|||
last_support_variables_input_(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
tgba::~tgba()
|
||||
{
|
||||
if (last_support_conditions_input_)
|
||||
|
|
@ -15,14 +15,14 @@ namespace spot
|
|||
if (last_support_variables_input_)
|
||||
delete last_support_variables_input_;
|
||||
}
|
||||
|
||||
bdd
|
||||
|
||||
bdd
|
||||
tgba::support_conditions(const state* state) const
|
||||
{
|
||||
if (! last_support_conditions_input_
|
||||
|| last_support_conditions_input_->compare(state) != 0)
|
||||
{
|
||||
last_support_conditions_output_ =
|
||||
last_support_conditions_output_ =
|
||||
compute_support_conditions(state);
|
||||
if (last_support_conditions_input_)
|
||||
delete last_support_conditions_input_;
|
||||
|
|
@ -37,7 +37,7 @@ namespace spot
|
|||
if (! last_support_variables_input_
|
||||
|| last_support_variables_input_->compare(state) != 0)
|
||||
{
|
||||
last_support_variables_output_ =
|
||||
last_support_variables_output_ =
|
||||
compute_support_variables(state);
|
||||
if (last_support_variables_input_)
|
||||
delete last_support_variables_input_;
|
||||
|
|
@ -46,4 +46,12 @@ namespace spot
|
|||
return last_support_variables_output_;
|
||||
}
|
||||
|
||||
state*
|
||||
tgba::project_state(const state* s, const tgba* t) const
|
||||
{
|
||||
if (t == this)
|
||||
return s->clone();
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,21 @@ namespace spot
|
|||
/// who owns the state.
|
||||
virtual std::string format_state(const state* state) const = 0;
|
||||
|
||||
/// \brief Project a state on an automata.
|
||||
///
|
||||
/// This converts \a s, into that corresponding spot::state for \a
|
||||
/// t. This is useful when you have the state of a product, and
|
||||
/// want restrict this state to a specific automata occuring in
|
||||
/// the product.
|
||||
///
|
||||
/// It goes without saying that \a s and \a t should be compatible
|
||||
/// (i.e., \a s is a state of \a t).
|
||||
///
|
||||
/// \return 0 if the projection fails (\a s is unrelated to \a t),
|
||||
/// or a new \c state* (the projected state) that must be
|
||||
/// deleted by the caller.
|
||||
virtual state* project_state(const state* s, const tgba* t) const;
|
||||
|
||||
/// \brief Return the set of all accepting conditions used
|
||||
/// by this automaton.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace spot
|
|||
|
||||
virtual std::string format_state(const state* state) const;
|
||||
|
||||
bdd_dict* get_dict() const;
|
||||
virtual bdd_dict* get_dict() const;
|
||||
|
||||
/// \brief Get the core data associated to this automaton.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -234,6 +234,19 @@ namespace spot
|
|||
+ right_->format_state(s->right()));
|
||||
}
|
||||
|
||||
state*
|
||||
tgba_product::project_state(const state* s, const tgba* t) const
|
||||
{
|
||||
const state_bdd_product* s2 = dynamic_cast<const state_bdd_product*>(s);
|
||||
assert(s2);
|
||||
if (t == this)
|
||||
return s2->clone();
|
||||
state* res = left_->project_state(s2->left(), t);
|
||||
if (res)
|
||||
return res;
|
||||
return right_->project_state(s2->right(), t);
|
||||
}
|
||||
|
||||
bdd
|
||||
tgba_product::all_accepting_conditions() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ namespace spot
|
|||
|
||||
virtual std::string format_state(const state* state) const;
|
||||
|
||||
virtual state* project_state(const state* s, const tgba* t) const;
|
||||
|
||||
virtual bdd all_accepting_conditions() const;
|
||||
virtual bdd neg_accepting_conditions() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -213,13 +213,23 @@ namespace spot
|
|||
std::string
|
||||
tgba_tba_proxy::format_state(const state* state) const
|
||||
{
|
||||
const state_tba_proxy* s =
|
||||
dynamic_cast<const state_tba_proxy*>(state);
|
||||
const state_tba_proxy* s = dynamic_cast<const state_tba_proxy*>(state);
|
||||
assert(s);
|
||||
return a_->format_state(s->real_state()) + "("
|
||||
+ bdd_format_set(get_dict(), s->accepting_cond()) + ")";
|
||||
}
|
||||
|
||||
state*
|
||||
tgba_tba_proxy::project_state(const state* s, const tgba* t) const
|
||||
{
|
||||
const state_tba_proxy* s2 = dynamic_cast<const state_tba_proxy*>(s);
|
||||
assert(s2);
|
||||
if (t == this)
|
||||
return s2->clone();
|
||||
return a_->project_state(s2->real_state(), t);
|
||||
}
|
||||
|
||||
|
||||
bdd
|
||||
tgba_tba_proxy::all_accepting_conditions() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ namespace spot
|
|||
|
||||
virtual std::string format_state(const state* state) const;
|
||||
|
||||
virtual state* project_state(const state* s, const tgba* t) const;
|
||||
|
||||
virtual bdd all_accepting_conditions() const;
|
||||
virtual bdd neg_accepting_conditions() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue