* iface/gspn/eesrg.cc, iface/gspn/eesrg.hh, iface/gspn/gspn.cc,
iface/gspn/gspn.hh, src/tgba/bdddict.cc, src/tgba/bdddict.hh, src/tgba/bddprint.hh, src/tgba/succiter.hh, src/tgba/succiterconcrete.cc, src/tgba/succiterconcrete.hh, src/tgba/tgba.hh, src/tgba/tgbabddconcrete.cc, src/tgba/tgbabddconcrete.hh, src/tgba/tgbabddconcretefactory.cc, src/tgba/tgbabddconcretefactory.hh, src/tgba/tgbabddcoredata.cc, src/tgba/tgbabddcoredata.hh, src/tgba/tgbaexplicit.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbaproduct.cc, src/tgba/tgbaproduct.hh, src/tgba/tgbatba.cc, src/tgba/tgbatba.hh, src/tgbaalgos/dotty.cc, src/tgbaalgos/dupexp.cc, src/tgbaalgos/emptinesscheck.cc, src/tgbaalgos/emptinesscheck.hh, src/tgbaalgos/lbtt.cc, src/tgbaalgos/lbtt.hh, src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_lacim.cc, src/tgbaalgos/save.cc, src/tgbatest/explicit.cc, src/tgbatest/ltl2tgba.cc, src/tgbaparse/tgbaparse.yy, wrap/python/tests/ltl2tgba.py: Rewrite `accepting condition' as `acceptance condition'. The symbols which have been renamed are: tgba::all_accepting_conditions tgba::neg_accepting_conditions succ_iterator::current_accepting_conditions bdd_dict::register_accepting_variable bdd_dict::register_accepting_variables bdd_dict::is_registered_accepting_variable tgba_bdd_concrete_factory::declare_accepting_condition tgba_bdd_core_data::accepting_conditions tgba_bdd_core_data::all_accepting_conditions tgba_explicit::declare_accepting_condition tgba_explicit::complement_all_accepting_conditions tgba_explicit::has_accepting_condition tgba_explicit::get_accepting_condition tgba_explicit::add_accepting_condition tgba_explicit::all_accepting_conditions tgba_explicit::neg_accepting_conditions state_tba_proxy::acceptance_cond accepting_cond_splitter
This commit is contained in:
parent
334ae6e757
commit
e341cc9ab6
37 changed files with 312 additions and 272 deletions
40
ChangeLog
40
ChangeLog
|
|
@ -1,3 +1,43 @@
|
||||||
|
2003-11-28 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
|
* iface/gspn/eesrg.cc, iface/gspn/eesrg.hh, iface/gspn/gspn.cc,
|
||||||
|
iface/gspn/gspn.hh, src/tgba/bdddict.cc, src/tgba/bdddict.hh,
|
||||||
|
src/tgba/bddprint.hh, src/tgba/succiter.hh,
|
||||||
|
src/tgba/succiterconcrete.cc, src/tgba/succiterconcrete.hh,
|
||||||
|
src/tgba/tgba.hh, src/tgba/tgbabddconcrete.cc,
|
||||||
|
src/tgba/tgbabddconcrete.hh, src/tgba/tgbabddconcretefactory.cc,
|
||||||
|
src/tgba/tgbabddconcretefactory.hh, src/tgba/tgbabddcoredata.cc,
|
||||||
|
src/tgba/tgbabddcoredata.hh, src/tgba/tgbaexplicit.cc,
|
||||||
|
src/tgba/tgbaexplicit.hh, src/tgba/tgbaproduct.cc,
|
||||||
|
src/tgba/tgbaproduct.hh, src/tgba/tgbatba.cc, src/tgba/tgbatba.hh,
|
||||||
|
src/tgbaalgos/dotty.cc, src/tgbaalgos/dupexp.cc,
|
||||||
|
src/tgbaalgos/emptinesscheck.cc, src/tgbaalgos/emptinesscheck.hh,
|
||||||
|
src/tgbaalgos/lbtt.cc, src/tgbaalgos/lbtt.hh,
|
||||||
|
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_lacim.cc,
|
||||||
|
src/tgbaalgos/save.cc, src/tgbatest/explicit.cc,
|
||||||
|
src/tgbatest/ltl2tgba.cc, src/tgbaparse/tgbaparse.yy,
|
||||||
|
wrap/python/tests/ltl2tgba.py:
|
||||||
|
Rewrite `accepting condition' as `acceptance condition'.
|
||||||
|
The symbols which have been renamed are:
|
||||||
|
tgba::all_accepting_conditions
|
||||||
|
tgba::neg_accepting_conditions
|
||||||
|
succ_iterator::current_accepting_conditions
|
||||||
|
bdd_dict::register_accepting_variable
|
||||||
|
bdd_dict::register_accepting_variables
|
||||||
|
bdd_dict::is_registered_accepting_variable
|
||||||
|
tgba_bdd_concrete_factory::declare_accepting_condition
|
||||||
|
tgba_bdd_core_data::accepting_conditions
|
||||||
|
tgba_bdd_core_data::all_accepting_conditions
|
||||||
|
tgba_explicit::declare_accepting_condition
|
||||||
|
tgba_explicit::complement_all_accepting_conditions
|
||||||
|
tgba_explicit::has_accepting_condition
|
||||||
|
tgba_explicit::get_accepting_condition
|
||||||
|
tgba_explicit::add_accepting_condition
|
||||||
|
tgba_explicit::all_accepting_conditions
|
||||||
|
tgba_explicit::neg_accepting_conditions
|
||||||
|
state_tba_proxy::acceptance_cond
|
||||||
|
accepting_cond_splitter
|
||||||
|
|
||||||
2003-11-26 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
2003-11-26 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
* src/tgbaalgos/ltl2tgba_fm.cc (ltl_trad_visitor::visit) <G>:
|
* src/tgbaalgos/ltl2tgba_fm.cc (ltl_trad_visitor::visit) <G>:
|
||||||
|
|
|
||||||
|
|
@ -319,11 +319,11 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bdd
|
virtual bdd
|
||||||
current_accepting_conditions() const
|
current_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
// There is no acceptance conditions in GSPN systems, so we just
|
// There is no acceptance conditions in GSPN systems, so we just
|
||||||
// return those from OPERAND_.
|
// return those from OPERAND_.
|
||||||
return operand_->current_accepting_conditions();
|
return operand_->current_acceptance_conditions();
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
State state_;
|
State state_;
|
||||||
|
|
@ -457,16 +457,16 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_gspn_eesrg::all_accepting_conditions() const
|
tgba_gspn_eesrg::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
// There is no accepting conditions in GSPN systems.
|
// There is no acceptance conditions in GSPN systems.
|
||||||
return bddfalse;
|
return bddfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_gspn_eesrg::neg_accepting_conditions() const
|
tgba_gspn_eesrg::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
// There is no accepting conditions in GSPN systems.
|
// There is no acceptance conditions in GSPN systems.
|
||||||
return bddtrue;
|
return bddtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@ namespace spot
|
||||||
const tgba* global_automaton = 0) const;
|
const tgba* global_automaton = 0) const;
|
||||||
virtual bdd_dict* get_dict() const;
|
virtual bdd_dict* get_dict() const;
|
||||||
virtual std::string format_state(const state* state) const;
|
virtual std::string format_state(const state* state) const;
|
||||||
virtual bdd all_accepting_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_accepting_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const spot::state* state) const;
|
virtual bdd compute_support_conditions(const spot::state* state) const;
|
||||||
virtual bdd compute_support_variables(const spot::state* state) const;
|
virtual bdd compute_support_variables(const spot::state* state) const;
|
||||||
|
|
|
||||||
|
|
@ -259,9 +259,9 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bdd
|
virtual bdd
|
||||||
current_accepting_conditions() const
|
current_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
// There is no accepting conditions in GSPN systems.
|
// There is no acceptance conditions in GSPN systems.
|
||||||
return bddfalse;
|
return bddfalse;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
@ -393,16 +393,16 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_gspn::all_accepting_conditions() const
|
tgba_gspn::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
// There is no accepting conditions in GSPN systems.
|
// There is no acceptance conditions in GSPN systems.
|
||||||
return bddfalse;
|
return bddfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_gspn::neg_accepting_conditions() const
|
tgba_gspn::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
// There is no accepting conditions in GSPN systems.
|
// There is no acceptance conditions in GSPN systems.
|
||||||
return bddtrue;
|
return bddtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ namespace spot
|
||||||
const tgba* global_automaton = 0) const;
|
const tgba* global_automaton = 0) const;
|
||||||
virtual bdd_dict* get_dict() const;
|
virtual bdd_dict* get_dict() const;
|
||||||
virtual std::string format_state(const state* state) const;
|
virtual std::string format_state(const state* state) const;
|
||||||
virtual bdd all_accepting_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_accepting_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const spot::state* state) const;
|
virtual bdd compute_support_conditions(const spot::state* state) const;
|
||||||
virtual bdd compute_support_variables(const spot::state* state) const;
|
virtual bdd compute_support_variables(const spot::state* state) const;
|
||||||
|
|
|
||||||
|
|
@ -102,11 +102,11 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
bdd_dict::register_accepting_variable(const ltl::formula* f,
|
bdd_dict::register_acceptance_variable(const ltl::formula* f,
|
||||||
const void* for_me)
|
const void* for_me)
|
||||||
{
|
{
|
||||||
int num;
|
int num;
|
||||||
// Do not build an accepting variable that already exists.
|
// Do not build an acceptance variable that already exists.
|
||||||
fv_map::iterator sii = acc_map.find(f);
|
fv_map::iterator sii = acc_map.find(f);
|
||||||
if (sii != acc_map.end())
|
if (sii != acc_map.end())
|
||||||
{
|
{
|
||||||
|
|
@ -124,7 +124,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
bdd_dict::register_accepting_variables(bdd f, const void* for_me)
|
bdd_dict::register_acceptance_variables(bdd f, const void* for_me)
|
||||||
{
|
{
|
||||||
if (f == bddtrue || f == bddfalse)
|
if (f == bddtrue || f == bddfalse)
|
||||||
return;
|
return;
|
||||||
|
|
@ -133,8 +133,8 @@ namespace spot
|
||||||
assert(i != acc_formula_map.end());
|
assert(i != acc_formula_map.end());
|
||||||
var_refs[i->first].insert(for_me);
|
var_refs[i->first].insert(for_me);
|
||||||
|
|
||||||
register_accepting_variables(bdd_high(f), for_me);
|
register_acceptance_variables(bdd_high(f), for_me);
|
||||||
register_accepting_variables(bdd_low(f), for_me);
|
register_acceptance_variables(bdd_low(f), for_me);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -231,7 +231,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
bdd_dict::is_registered_accepting_variable(const ltl::formula* f,
|
bdd_dict::is_registered_acceptance_variable(const ltl::formula* f,
|
||||||
const void* by_me)
|
const void* by_me)
|
||||||
{
|
{
|
||||||
fv_map::iterator fi = acc_map.find(f);
|
fv_map::iterator fi = acc_map.find(f);
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ namespace spot
|
||||||
vf_map now_formula_map; ///< Maps "Now" BDD variables to formulae
|
vf_map now_formula_map; ///< Maps "Now" BDD variables to formulae
|
||||||
fv_map var_map; ///< Maps atomic propositions to BDD variables
|
fv_map var_map; ///< Maps atomic propositions to BDD variables
|
||||||
vf_map var_formula_map; ///< Maps BDD variables to atomic propositions
|
vf_map var_formula_map; ///< Maps BDD variables to atomic propositions
|
||||||
fv_map acc_map; ///< Maps accepting conditions to BDD variables
|
fv_map acc_map; ///< Maps acceptance conditions to BDD variables
|
||||||
vf_map acc_formula_map; ///< Maps BDD variables to accepting conditions
|
vf_map acc_formula_map; ///< Maps BDD variables to acceptance conditions
|
||||||
|
|
||||||
/// \brief Map Next variables to Now variables.
|
/// \brief Map Next variables to Now variables.
|
||||||
///
|
///
|
||||||
|
|
@ -100,23 +100,23 @@ namespace spot
|
||||||
/// \brief Register an atomic proposition.
|
/// \brief Register an atomic proposition.
|
||||||
///
|
///
|
||||||
/// Return (and maybe allocate) a BDD variable designating an
|
/// Return (and maybe allocate) a BDD variable designating an
|
||||||
/// accepting set associated to formula \a f. The \a for_me
|
/// acceptance set associated to formula \a f. The \a for_me
|
||||||
/// argument should point to the object using this BDD variable,
|
/// argument should point to the object using this BDD variable,
|
||||||
/// this is used for reference counting. It is perfectly safe to
|
/// this is used for reference counting. It is perfectly safe to
|
||||||
/// call this function several time with the same arguments.
|
/// call this function several time with the same arguments.
|
||||||
///
|
///
|
||||||
/// \return The variable number. Use bdd_ithvar() or bdd_nithvar()
|
/// \return The variable number. Use bdd_ithvar() or bdd_nithvar()
|
||||||
/// to convert this to a BDD.
|
/// to convert this to a BDD.
|
||||||
int register_accepting_variable(const ltl::formula* f, const void* for_me);
|
int register_acceptance_variable(const ltl::formula* f, const void* for_me);
|
||||||
|
|
||||||
/// \brief Register BDD variables as accepting variables.
|
/// \brief Register BDD variables as acceptance variables.
|
||||||
///
|
///
|
||||||
/// Register all variables occurring in \a f as accepting variables
|
/// Register all variables occurring in \a f as acceptance variables
|
||||||
/// used by \a for_me. This assumes that these accepting variables
|
/// used by \a for_me. This assumes that these acceptance variables
|
||||||
/// are already known from the dictionary (i.e., they have already
|
/// are already known from the dictionary (i.e., they have already
|
||||||
/// been registered by register_accepting_variable() for another
|
/// been registered by register_acceptance_variable() for another
|
||||||
/// automaton).
|
/// automaton).
|
||||||
void register_accepting_variables(bdd f, const void* for_me);
|
void register_acceptance_variables(bdd f, const void* for_me);
|
||||||
|
|
||||||
/// \brief Duplicate the variable usage of another object.
|
/// \brief Duplicate the variable usage of another object.
|
||||||
///
|
///
|
||||||
|
|
@ -135,7 +135,7 @@ namespace spot
|
||||||
/// Check whether formula \a f has already been registered by \a by_me.
|
/// Check whether formula \a f has already been registered by \a by_me.
|
||||||
bool is_registered_proposition(const ltl::formula* f, const void* by_me);
|
bool is_registered_proposition(const ltl::formula* f, const void* by_me);
|
||||||
bool is_registered_state(const ltl::formula* f, const void* by_me);
|
bool is_registered_state(const ltl::formula* f, const void* by_me);
|
||||||
bool is_registered_accepting_variable(const ltl::formula* f,
|
bool is_registered_acceptance_variable(const ltl::formula* f,
|
||||||
const void* by_me);
|
const void* by_me);
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace spot
|
||||||
/// \return The BDD formated as a string.
|
/// \return The BDD formated as a string.
|
||||||
std::string bdd_format_sat(const bdd_dict* dict, bdd b);
|
std::string bdd_format_sat(const bdd_dict* dict, bdd b);
|
||||||
|
|
||||||
/// \brief Print a BDD as a list of accepting conditions.
|
/// \brief Print a BDD as a list of acceptance conditions.
|
||||||
///
|
///
|
||||||
/// This is used when saving a TGBA.
|
/// This is used when saving a TGBA.
|
||||||
/// \param os The output stream.
|
/// \param os The output stream.
|
||||||
|
|
@ -57,7 +57,7 @@ namespace spot
|
||||||
std::ostream& bdd_print_acc(std::ostream& os,
|
std::ostream& bdd_print_acc(std::ostream& os,
|
||||||
const bdd_dict* dict, bdd b);
|
const bdd_dict* dict, bdd b);
|
||||||
|
|
||||||
/// \brief Print a BDD as a set of accepting conditions.
|
/// \brief Print a BDD as a set of acceptance conditions.
|
||||||
///
|
///
|
||||||
/// This is used when saving a TGBA.
|
/// This is used when saving a TGBA.
|
||||||
/// \param os The output stream.
|
/// \param os The output stream.
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace spot
|
||||||
/// This class provides the basic functionalities required to
|
/// This class provides the basic functionalities required to
|
||||||
/// iterate over the successors of a state, as well as querying
|
/// iterate over the successors of a state, as well as querying
|
||||||
/// transition labels. Because transitions are never explicitely
|
/// transition labels. Because transitions are never explicitely
|
||||||
/// encoded, labels (conditions and accepting conditions) can only
|
/// encoded, labels (conditions and acceptance conditions) can only
|
||||||
/// be queried while iterating over the successors.
|
/// be queried while iterating over the successors.
|
||||||
class tgba_succ_iterator
|
class tgba_succ_iterator
|
||||||
{
|
{
|
||||||
|
|
@ -90,9 +90,9 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// This is a boolean function of atomic propositions.
|
/// This is a boolean function of atomic propositions.
|
||||||
virtual bdd current_condition() const = 0;
|
virtual bdd current_condition() const = 0;
|
||||||
/// \brief Get the accepting conditions on the transition leading
|
/// \brief Get the acceptance conditions on the transition leading
|
||||||
/// to this successor.
|
/// to this successor.
|
||||||
virtual bdd current_accepting_conditions() const = 0;
|
virtual bdd current_acceptance_conditions() const = 0;
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,10 @@ namespace spot
|
||||||
// (a + b) & Next[a] & Next[b]
|
// (a + b) & Next[a] & Next[b]
|
||||||
// a & b & Next[a] & !Next[b]
|
// a & b & Next[a] & !Next[b]
|
||||||
// Is this always correct? No! It depends on the
|
// Is this always correct? No! It depends on the
|
||||||
// accepting conditions associated to each transition.
|
// acceptance conditions associated to each transition.
|
||||||
// We cannot merge transitions which have different
|
// We cannot merge transitions which have different
|
||||||
// accepting conditions.
|
// acceptance conditions.
|
||||||
// Let's label transitions with hypothetic accepting sets:
|
// Let's label transitions with hypothetic acceptance sets:
|
||||||
// a & b & Next[a] & Next[b] ; Acc[1]
|
// a & b & Next[a] & Next[b] ; Acc[1]
|
||||||
// !a & b & Next[a] & Next[b] ; Acc[2]
|
// !a & b & Next[a] & Next[b] ; Acc[2]
|
||||||
// a & !b & Next[a] & Next[b] ; Acc[2]
|
// a & !b & Next[a] & Next[b] ; Acc[2]
|
||||||
|
|
@ -103,17 +103,17 @@ namespace spot
|
||||||
|
|
||||||
// Gather all transitions going to this destination...
|
// Gather all transitions going to this destination...
|
||||||
current_ = succ_set_left_ & dest;
|
current_ = succ_set_left_ & dest;
|
||||||
// ... and compute their accepting sets.
|
// ... and compute their acceptance sets.
|
||||||
bdd as = data_.accepting_conditions & current_;
|
bdd as = data_.acceptance_conditions & current_;
|
||||||
|
|
||||||
// AS is false when no satisfaction of the current transition
|
// AS is false when no satisfaction of the current transition
|
||||||
// belongs to an accepting set: current_ can be used as-is.
|
// belongs to an acceptance set: current_ can be used as-is.
|
||||||
if (as != bddfalse)
|
if (as != bddfalse)
|
||||||
{
|
{
|
||||||
// Otherwise, we have accepting sets, and we should
|
// Otherwise, we have acceptance sets, and we should
|
||||||
// restrict current_ to a subset sharing the same
|
// restrict current_ to a subset sharing the same
|
||||||
// accepting conditions.
|
// acceptance conditions.
|
||||||
// same accepting set.
|
// same acceptance set.
|
||||||
|
|
||||||
as = bdd_exist(as, data_.nownext_set);
|
as = bdd_exist(as, data_.nownext_set);
|
||||||
// as = (a | (!a)&b) & (Acc[a] | Acc[b]) + (!a & Acc[b])
|
// as = (a | (!a)&b) & (Acc[a] | Acc[b]) + (!a & Acc[b])
|
||||||
|
|
@ -125,7 +125,7 @@ namespace spot
|
||||||
// current_acc_ = (Acc[a] | Acc[b])
|
// current_acc_ = (Acc[a] | Acc[b])
|
||||||
assert(current_acc_ != bddfalse);
|
assert(current_acc_ != bddfalse);
|
||||||
// Find other transitions included exactly in each of these
|
// Find other transitions included exactly in each of these
|
||||||
// accepting sets and are not included in other sets.
|
// acceptance sets and are not included in other sets.
|
||||||
// Consider
|
// Consider
|
||||||
// !p.!Acc[g].Acc[f] + p.!Acc[g].Acc[f] + p.Acc[g].!Acc[f]
|
// !p.!Acc[g].Acc[f] + p.!Acc[g].Acc[f] + p.Acc[g].!Acc[f]
|
||||||
// if current_acc_ = !Acc[g].Acc[f] we
|
// if current_acc_ = !Acc[g].Acc[f] we
|
||||||
|
|
@ -133,11 +133,11 @@ namespace spot
|
||||||
// belongs to !Acc[g].Acc[f] + Acc[g].!Acc[f], not
|
// belongs to !Acc[g].Acc[f] + Acc[g].!Acc[f], not
|
||||||
// only !Acc[g].Acc[f].
|
// only !Acc[g].Acc[f].
|
||||||
// So, first, filter out all transitions like p, which
|
// So, first, filter out all transitions like p, which
|
||||||
// are also in other accepting sets.
|
// are also in other acceptance sets.
|
||||||
bdd fout = bdd_relprod(as, !current_acc_, data_.acc_set);
|
bdd fout = bdd_relprod(as, !current_acc_, data_.acc_set);
|
||||||
bdd as_fout = as - fout;
|
bdd as_fout = as - fout;
|
||||||
// Then, pick the remaining term that are exactly in all
|
// Then, pick the remaining term that are exactly in all
|
||||||
// required accepting sets.
|
// required acceptance sets.
|
||||||
bdd all = bddtrue;
|
bdd all = bddtrue;
|
||||||
bdd acc = current_acc_;
|
bdd acc = current_acc_;
|
||||||
do
|
do
|
||||||
|
|
@ -188,7 +188,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_succ_iterator_concrete::current_accepting_conditions() const
|
tgba_succ_iterator_concrete::current_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
assert(!done());
|
assert(!done());
|
||||||
return current_acc_;
|
return current_acc_;
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ namespace spot
|
||||||
/// \brief Build a spot::tgba_succ_iterator_concrete.
|
/// \brief Build a spot::tgba_succ_iterator_concrete.
|
||||||
///
|
///
|
||||||
/// \param successors The set of successors with ingoing
|
/// \param successors The set of successors with ingoing
|
||||||
/// conditions and accepting conditions, represented as a BDD.
|
/// conditions and acceptance conditions, represented as a BDD.
|
||||||
/// The job of this iterator will be to enumerate the
|
/// The job of this iterator will be to enumerate the
|
||||||
/// satisfactions of that BDD and split them into destination
|
/// satisfactions of that BDD and split them into destination
|
||||||
/// states and conditions, and compute accepting conditions.
|
/// states and conditions, and compute acceptance conditions.
|
||||||
/// \param d The core data of the automata.
|
/// \param d The core data of the automata.
|
||||||
/// These contains sets of variables useful to split a BDD, and
|
/// These contains sets of variables useful to split a BDD, and
|
||||||
/// compute accepting conditions.
|
/// compute acceptance conditions.
|
||||||
tgba_succ_iterator_concrete(const tgba_bdd_core_data& d, bdd successors);
|
tgba_succ_iterator_concrete(const tgba_bdd_core_data& d, bdd successors);
|
||||||
virtual ~tgba_succ_iterator_concrete();
|
virtual ~tgba_succ_iterator_concrete();
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace spot
|
||||||
// inspection
|
// inspection
|
||||||
state_bdd* current_state() const;
|
state_bdd* current_state() const;
|
||||||
bdd current_condition() const;
|
bdd current_condition() const;
|
||||||
bdd current_accepting_conditions() const;
|
bdd current_acceptance_conditions() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const tgba_bdd_core_data& data_; ///< Core data of the automaton.
|
const tgba_bdd_core_data& data_; ///< Core data of the automaton.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// TGBAs are transition-based, meanings their labels are put
|
/// TGBAs are transition-based, meanings their labels are put
|
||||||
/// on arcs, not on nodes. They use Generalized Büchi acceptance
|
/// on arcs, not on nodes. They use Generalized Büchi acceptance
|
||||||
/// conditions: there are several accepting sets (of
|
/// conditions: there are several acceptance sets (of
|
||||||
/// transitions), and a path can be accepted only if it traverse
|
/// transitions), and a path can be accepted only if it traverse
|
||||||
/// at least one transition of each set infinitely often.
|
/// at least one transition of each set infinitely often.
|
||||||
///
|
///
|
||||||
|
|
@ -153,7 +153,7 @@ namespace spot
|
||||||
/// deleted by the caller.
|
/// deleted by the caller.
|
||||||
virtual state* project_state(const state* s, const tgba* t) const;
|
virtual state* project_state(const state* s, const tgba* t) const;
|
||||||
|
|
||||||
/// \brief Return the set of all accepting conditions used
|
/// \brief Return the set of all acceptance conditions used
|
||||||
/// by this automaton.
|
/// by this automaton.
|
||||||
///
|
///
|
||||||
/// The goal of the emptiness check is to ensure that
|
/// The goal of the emptiness check is to ensure that
|
||||||
|
|
@ -161,19 +161,19 @@ namespace spot
|
||||||
/// of these acceptiong conditions. I.e., the union
|
/// of these acceptiong conditions. I.e., the union
|
||||||
/// of the acceptiong conditions of all transition in
|
/// of the acceptiong conditions of all transition in
|
||||||
/// the SCC should be equal to the result of this function.
|
/// the SCC should be equal to the result of this function.
|
||||||
virtual bdd all_accepting_conditions() const = 0;
|
virtual bdd all_acceptance_conditions() const = 0;
|
||||||
|
|
||||||
/// \brief Return the conjuction of all negated accepting
|
/// \brief Return the conjuction of all negated acceptance
|
||||||
/// variables.
|
/// variables.
|
||||||
///
|
///
|
||||||
/// For instance if the automaton uses variables <tt>Acc[a]</tt>,
|
/// For instance if the automaton uses variables <tt>Acc[a]</tt>,
|
||||||
/// <tt>Acc[b]</tt> and <tt>Acc[c]</tt> to describe accepting sets,
|
/// <tt>Acc[b]</tt> and <tt>Acc[c]</tt> to describe acceptance sets,
|
||||||
/// this function should return <tt>!Acc[a]\&!Acc[b]\&!Acc[c]</tt>.
|
/// this function should return <tt>!Acc[a]\&!Acc[b]\&!Acc[c]</tt>.
|
||||||
///
|
///
|
||||||
/// This is useful when making products: each operand's condition
|
/// This is useful when making products: each operand's condition
|
||||||
/// set should be augmented with the neg_accepting_conditions() of
|
/// set should be augmented with the neg_acceptance_conditions() of
|
||||||
/// the other operand.
|
/// the other operand.
|
||||||
virtual bdd neg_accepting_conditions() const = 0;
|
virtual bdd neg_acceptance_conditions() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Do the actual computation of tgba::support_conditions().
|
/// Do the actual computation of tgba::support_conditions().
|
||||||
|
|
|
||||||
|
|
@ -147,13 +147,13 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_bdd_concrete::all_accepting_conditions() const
|
tgba_bdd_concrete::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return data_.all_accepting_conditions;
|
return data_.all_acceptance_conditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_bdd_concrete::neg_accepting_conditions() const
|
tgba_bdd_concrete::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return data_.negacc_set;
|
return data_.negacc_set;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,8 @@ namespace spot
|
||||||
/// rules, etc.
|
/// rules, etc.
|
||||||
const tgba_bdd_core_data& get_core_data() const;
|
const tgba_bdd_core_data& get_core_data() const;
|
||||||
|
|
||||||
virtual bdd all_accepting_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_accepting_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const state* state) const;
|
virtual bdd compute_support_conditions(const state* state) const;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tgba_bdd_concrete_factory::declare_accepting_condition(bdd b,
|
tgba_bdd_concrete_factory::declare_acceptance_condition(bdd b,
|
||||||
const ltl::formula* a)
|
const ltl::formula* a)
|
||||||
{
|
{
|
||||||
// Maintain a conjunction of BDDs associated to A. We will latter
|
// Maintain a conjunction of BDDs associated to A. We will latter
|
||||||
|
|
@ -82,27 +82,27 @@ namespace spot
|
||||||
acc_map_::iterator ai;
|
acc_map_::iterator ai;
|
||||||
for (ai = acc_.begin(); ai != acc_.end(); ++ai)
|
for (ai = acc_.begin(); ai != acc_.end(); ++ai)
|
||||||
{
|
{
|
||||||
// Register a BDD variable for this accepting condition.
|
// Register a BDD variable for this acceptance condition.
|
||||||
int num = get_dict()->register_accepting_variable(ai->first, this);
|
int num = get_dict()->register_acceptance_variable(ai->first, this);
|
||||||
// Keep track of all accepting conditions for easy
|
// Keep track of all acceptance conditions for easy
|
||||||
// existential quantification.
|
// existential quantification.
|
||||||
data_.declare_accepting_condition(bdd_ithvar(num));
|
data_.declare_acceptance_condition(bdd_ithvar(num));
|
||||||
}
|
}
|
||||||
for (ai = acc_.begin(); ai != acc_.end(); ++ai)
|
for (ai = acc_.begin(); ai != acc_.end(); ++ai)
|
||||||
{
|
{
|
||||||
bdd acc = bdd_ithvar(get_dict()->acc_map[ai->first]);
|
bdd acc = bdd_ithvar(get_dict()->acc_map[ai->first]);
|
||||||
|
|
||||||
// Complete acc with all the other accepting conditions negated.
|
// Complete acc with all the other acceptance conditions negated.
|
||||||
acc &= bdd_exist(data_.negacc_set, acc);
|
acc &= bdd_exist(data_.negacc_set, acc);
|
||||||
|
|
||||||
// Any state matching the BDD formulae registered is part
|
// Any state matching the BDD formulae registered is part
|
||||||
// of this accepting set.
|
// of this acceptance set.
|
||||||
data_.accepting_conditions |= ai->second & acc;
|
data_.acceptance_conditions |= ai->second & acc;
|
||||||
|
|
||||||
// Keep track of all accepting conditions, so that we can
|
// Keep track of all acceptance conditions, so that we can
|
||||||
// easily check whether a transition satisfies all accepting
|
// easily check whether a transition satisfies all acceptance
|
||||||
// conditions.
|
// conditions.
|
||||||
data_.all_accepting_conditions |= acc;
|
data_.all_acceptance_conditions |= acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Any constraint between Now variables also exist between Next
|
// Any constraint between Now variables also exist between Next
|
||||||
|
|
|
||||||
|
|
@ -56,18 +56,18 @@ namespace spot
|
||||||
/// can be turned into BDD using ithvar().
|
/// can be turned into BDD using ithvar().
|
||||||
int create_atomic_prop(const ltl::formula* f);
|
int create_atomic_prop(const ltl::formula* f);
|
||||||
|
|
||||||
/// Declare an accepting condition.
|
/// Declare an acceptance condition.
|
||||||
///
|
///
|
||||||
/// Formula such as 'f U g' or 'F g' make the promise
|
/// Formula such as 'f U g' or 'F g' make the promise
|
||||||
/// that 'g' will be fulfilled eventually. So once
|
/// that 'g' will be fulfilled eventually. So once
|
||||||
/// one of this formula has been translated into a BDD,
|
/// one of this formula has been translated into a BDD,
|
||||||
/// we use declare_accepting_condition() to associate
|
/// we use declare_acceptance_condition() to associate
|
||||||
/// all other states to the accepting set of 'g'.
|
/// all other states to the acceptance set of 'g'.
|
||||||
///
|
///
|
||||||
/// \param b a BDD indicating which variables are in the
|
/// \param b a BDD indicating which variables are in the
|
||||||
/// accepting set
|
/// acceptance set
|
||||||
/// \param a the formula associated
|
/// \param a the formula associated
|
||||||
void declare_accepting_condition(bdd b, const ltl::formula* a);
|
void declare_acceptance_condition(bdd b, const ltl::formula* a);
|
||||||
|
|
||||||
const tgba_bdd_core_data& get_core_data() const;
|
const tgba_bdd_core_data& get_core_data() const;
|
||||||
bdd_dict* get_dict() const;
|
bdd_dict* get_dict() const;
|
||||||
|
|
@ -78,7 +78,7 @@ namespace spot
|
||||||
/// \brief Perfom final computations before the relation can be used.
|
/// \brief Perfom final computations before the relation can be used.
|
||||||
///
|
///
|
||||||
/// This function should be called after all propositions, state,
|
/// This function should be called after all propositions, state,
|
||||||
/// accepting conditions, and constraints have been declared, and
|
/// acceptance conditions, and constraints have been declared, and
|
||||||
/// before calling get_code_data() or get_dict().
|
/// before calling get_code_data() or get_dict().
|
||||||
void finish();
|
void finish();
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ namespace spot
|
||||||
|
|
||||||
typedef Sgi::hash_map<const ltl::formula*, bdd,
|
typedef Sgi::hash_map<const ltl::formula*, bdd,
|
||||||
ptr_hash<ltl::formula> > acc_map_;
|
ptr_hash<ltl::formula> > acc_map_;
|
||||||
acc_map_ acc_; ///< BDD associated to each accepting condition
|
acc_map_ acc_; ///< BDD associated to each acceptance condition
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ namespace spot
|
||||||
{
|
{
|
||||||
tgba_bdd_core_data::tgba_bdd_core_data(bdd_dict* dict)
|
tgba_bdd_core_data::tgba_bdd_core_data(bdd_dict* dict)
|
||||||
: relation(bddtrue),
|
: relation(bddtrue),
|
||||||
accepting_conditions(bddfalse),
|
acceptance_conditions(bddfalse),
|
||||||
all_accepting_conditions(bddfalse),
|
all_acceptance_conditions(bddfalse),
|
||||||
now_set(bddtrue),
|
now_set(bddtrue),
|
||||||
next_set(bddtrue),
|
next_set(bddtrue),
|
||||||
nownext_set(bddtrue),
|
nownext_set(bddtrue),
|
||||||
|
|
@ -45,8 +45,8 @@ namespace spot
|
||||||
|
|
||||||
tgba_bdd_core_data::tgba_bdd_core_data(const tgba_bdd_core_data& copy)
|
tgba_bdd_core_data::tgba_bdd_core_data(const tgba_bdd_core_data& copy)
|
||||||
: relation(copy.relation),
|
: relation(copy.relation),
|
||||||
accepting_conditions(copy.accepting_conditions),
|
acceptance_conditions(copy.acceptance_conditions),
|
||||||
all_accepting_conditions(copy.all_accepting_conditions),
|
all_acceptance_conditions(copy.all_acceptance_conditions),
|
||||||
now_set(copy.now_set),
|
now_set(copy.now_set),
|
||||||
next_set(copy.next_set),
|
next_set(copy.next_set),
|
||||||
nownext_set(copy.nownext_set),
|
nownext_set(copy.nownext_set),
|
||||||
|
|
@ -66,10 +66,10 @@ namespace spot
|
||||||
tgba_bdd_core_data::tgba_bdd_core_data(const tgba_bdd_core_data& left,
|
tgba_bdd_core_data::tgba_bdd_core_data(const tgba_bdd_core_data& left,
|
||||||
const tgba_bdd_core_data& right)
|
const tgba_bdd_core_data& right)
|
||||||
: relation(left.relation & right.relation),
|
: relation(left.relation & right.relation),
|
||||||
accepting_conditions(left.accepting_conditions
|
acceptance_conditions(left.acceptance_conditions
|
||||||
| right.accepting_conditions),
|
| right.acceptance_conditions),
|
||||||
all_accepting_conditions(left.all_accepting_conditions
|
all_acceptance_conditions(left.all_acceptance_conditions
|
||||||
| right.all_accepting_conditions),
|
| right.all_acceptance_conditions),
|
||||||
now_set(left.now_set & right.now_set),
|
now_set(left.now_set & right.now_set),
|
||||||
next_set(left.next_set & right.next_set),
|
next_set(left.next_set & right.next_set),
|
||||||
nownext_set(left.nownext_set & right.nownext_set),
|
nownext_set(left.nownext_set & right.nownext_set),
|
||||||
|
|
@ -122,7 +122,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tgba_bdd_core_data::declare_accepting_condition(bdd acc)
|
tgba_bdd_core_data::declare_acceptance_condition(bdd acc)
|
||||||
{
|
{
|
||||||
notnow_set &= acc;
|
notnow_set &= acc;
|
||||||
notnext_set &= acc;
|
notnext_set &= acc;
|
||||||
|
|
|
||||||
|
|
@ -39,21 +39,21 @@ namespace spot
|
||||||
/// to the next state
|
/// to the next state
|
||||||
bdd relation;
|
bdd relation;
|
||||||
|
|
||||||
/// \brief encodes the accepting conditions
|
/// \brief encodes the acceptance conditions
|
||||||
///
|
///
|
||||||
/// <tt>a U b</tt>, or <tt>F b</tt>, both imply that \c b should
|
/// <tt>a U b</tt>, or <tt>F b</tt>, both imply that \c b should
|
||||||
/// be verified eventually. We encode this with generalized Büchi
|
/// be verified eventually. We encode this with generalized Büchi
|
||||||
/// acceptating conditions. An accepting set, called
|
/// acceptating conditions. An acceptance set, called
|
||||||
/// <tt>Acc[b]</tt>, hold all the state that do not promise to
|
/// <tt>Acc[b]</tt>, hold all the state that do not promise to
|
||||||
/// verify \c b eventually. (I.e., all the states that contain \c
|
/// verify \c b eventually. (I.e., all the states that contain \c
|
||||||
/// b, or do not contain <tt>a U b</tt>, or <tt>F b</tt>.)
|
/// b, or do not contain <tt>a U b</tt>, or <tt>F b</tt>.)
|
||||||
///
|
///
|
||||||
/// The spot::succ_iter::current_accepting_conditions() method
|
/// The spot::succ_iter::current_acceptance_conditions() method
|
||||||
/// will return the \c Acc[x] variables of the accepting sets
|
/// will return the \c Acc[x] variables of the acceptance sets
|
||||||
/// in which a transition is. Actually we never return \c Acc[x]
|
/// in which a transition is. Actually we never return \c Acc[x]
|
||||||
/// alone, but \c Acc[x] and all other accepting variables negated.
|
/// alone, but \c Acc[x] and all other acceptance variables negated.
|
||||||
///
|
///
|
||||||
/// So if there is three accepting set \c a, \c b, and \c c, and a
|
/// So if there is three acceptance set \c a, \c b, and \c c, and a
|
||||||
/// transition is in set \c a, we'll return <tt>
|
/// transition is in set \c a, we'll return <tt>
|
||||||
/// Acc[a]&!Acc[b]&!Acc[c]</tt>. If the transition is in both \c
|
/// Acc[a]&!Acc[b]&!Acc[c]</tt>. If the transition is in both \c
|
||||||
/// a and \c b, we'll return <tt>(Acc[a]\&!Acc[b]\&!Acc[c]) \c | \c
|
/// a and \c b, we'll return <tt>(Acc[a]\&!Acc[b]\&!Acc[c]) \c | \c
|
||||||
|
|
@ -66,22 +66,22 @@ namespace spot
|
||||||
/// check for `b' and have a destination of the form <tt>a U b</tt>,
|
/// check for `b' and have a destination of the form <tt>a U b</tt>,
|
||||||
/// or <tt>F b</tt>.
|
/// or <tt>F b</tt>.
|
||||||
///
|
///
|
||||||
/// To summarize, \c accepting_conditions contains three kinds of
|
/// To summarize, \c acceptance_conditions contains three kinds of
|
||||||
/// variables:
|
/// variables:
|
||||||
/// \li "Next" variables, that encode the destination state,
|
/// \li "Next" variables, that encode the destination state,
|
||||||
/// \li atomic propositions, which are things to verify before going on
|
/// \li atomic propositions, which are things to verify before going on
|
||||||
/// to the next state,
|
/// to the next state,
|
||||||
/// \li "Acc" variables.
|
/// \li "Acc" variables.
|
||||||
bdd accepting_conditions;
|
bdd acceptance_conditions;
|
||||||
|
|
||||||
/// \brief The set of all accepting conditions used by the Automaton.
|
/// \brief The set of all acceptance conditions used by the Automaton.
|
||||||
///
|
///
|
||||||
/// The goal of the emptiness check is to ensure that
|
/// The goal of the emptiness check is to ensure that
|
||||||
/// a strongly connected component walks through each
|
/// a strongly connected component walks through each
|
||||||
/// of these acceptiong conditions. I.e., the union
|
/// of these acceptiong conditions. I.e., the union
|
||||||
/// of the acceptiong conditions of all transition in
|
/// of the acceptiong conditions of all transition in
|
||||||
/// the SCC should be equal to the result of this function.
|
/// the SCC should be equal to the result of this function.
|
||||||
bdd all_accepting_conditions;
|
bdd all_acceptance_conditions;
|
||||||
|
|
||||||
/// The conjunction of all Now variables, in their positive form.
|
/// The conjunction of all Now variables, in their positive form.
|
||||||
bdd now_set;
|
bdd now_set;
|
||||||
|
|
@ -105,12 +105,12 @@ namespace spot
|
||||||
/// and atomic propositions.
|
/// and atomic propositions.
|
||||||
bdd varandnext_set;
|
bdd varandnext_set;
|
||||||
/// \brief The (positive) conjunction of all variables which are
|
/// \brief The (positive) conjunction of all variables which are
|
||||||
/// accepting conditions.
|
/// acceptance conditions.
|
||||||
bdd acc_set;
|
bdd acc_set;
|
||||||
/// \brief The (positive) conjunction of all variables which are not
|
/// \brief The (positive) conjunction of all variables which are not
|
||||||
/// accepting conditions.
|
/// acceptance conditions.
|
||||||
bdd notacc_set;
|
bdd notacc_set;
|
||||||
/// \brief The negative conjunction of all variables which are accepting
|
/// \brief The negative conjunction of all variables which are acceptance
|
||||||
/// conditions.
|
/// conditions.
|
||||||
bdd negacc_set;
|
bdd negacc_set;
|
||||||
|
|
||||||
|
|
@ -139,9 +139,9 @@ namespace spot
|
||||||
/// \brief Update the variable sets to take a new automic proposition into
|
/// \brief Update the variable sets to take a new automic proposition into
|
||||||
/// account.
|
/// account.
|
||||||
void declare_atomic_prop(bdd var);
|
void declare_atomic_prop(bdd var);
|
||||||
/// \brief Update the variable sets to take a new accepting condition
|
/// \brief Update the variable sets to take a new acceptance condition
|
||||||
/// into account.
|
/// into account.
|
||||||
void declare_accepting_condition(bdd prom);
|
void declare_acceptance_condition(bdd prom);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace spot
|
||||||
|
|
||||||
tgba_explicit_succ_iterator::tgba_explicit_succ_iterator
|
tgba_explicit_succ_iterator::tgba_explicit_succ_iterator
|
||||||
(const tgba_explicit::state* s, bdd all_acc)
|
(const tgba_explicit::state* s, bdd all_acc)
|
||||||
: s_(s), all_accepting_conditions_(all_acc)
|
: s_(s), all_acceptance_conditions_(all_acc)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,9 +69,9 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_explicit_succ_iterator::current_accepting_conditions() const
|
tgba_explicit_succ_iterator::current_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return (*i_)->accepting_conditions & all_accepting_conditions_;
|
return (*i_)->acceptance_conditions & all_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -110,9 +110,9 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
tgba_explicit::tgba_explicit(bdd_dict* dict)
|
tgba_explicit::tgba_explicit(bdd_dict* dict)
|
||||||
: dict_(dict), init_(0), all_accepting_conditions_(bddfalse),
|
: dict_(dict), init_(0), all_acceptance_conditions_(bddfalse),
|
||||||
neg_accepting_conditions_(bddtrue),
|
neg_acceptance_conditions_(bddtrue),
|
||||||
all_accepting_conditions_computed_(false)
|
all_acceptance_conditions_computed_(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ namespace spot
|
||||||
transition* t = new transition;
|
transition* t = new transition;
|
||||||
t->dest = d;
|
t->dest = d;
|
||||||
t->condition = bddtrue;
|
t->condition = bddtrue;
|
||||||
t->accepting_conditions = bddfalse;
|
t->acceptance_conditions = bddfalse;
|
||||||
s->push_back(t);
|
s->push_back(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
@ -201,12 +201,12 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tgba_explicit::declare_accepting_condition(const ltl::formula* f)
|
tgba_explicit::declare_acceptance_condition(const ltl::formula* f)
|
||||||
{
|
{
|
||||||
int v = dict_->register_accepting_variable(f, this);
|
int v = dict_->register_acceptance_variable(f, this);
|
||||||
ltl::destroy(f);
|
ltl::destroy(f);
|
||||||
bdd neg = bdd_nithvar(v);
|
bdd neg = bdd_nithvar(v);
|
||||||
neg_accepting_conditions_ &= neg;
|
neg_acceptance_conditions_ &= neg;
|
||||||
|
|
||||||
// Append neg to all acceptance conditions.
|
// Append neg to all acceptance conditions.
|
||||||
ns_map::iterator i;
|
ns_map::iterator i;
|
||||||
|
|
@ -214,35 +214,35 @@ namespace spot
|
||||||
{
|
{
|
||||||
tgba_explicit::state::iterator i2;
|
tgba_explicit::state::iterator i2;
|
||||||
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
||||||
(*i2)->accepting_conditions &= neg;
|
(*i2)->acceptance_conditions &= neg;
|
||||||
}
|
}
|
||||||
|
|
||||||
all_accepting_conditions_computed_ = false;
|
all_acceptance_conditions_computed_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tgba_explicit::complement_all_accepting_conditions()
|
tgba_explicit::complement_all_acceptance_conditions()
|
||||||
{
|
{
|
||||||
bdd all = all_accepting_conditions();
|
bdd all = all_acceptance_conditions();
|
||||||
ns_map::iterator i;
|
ns_map::iterator i;
|
||||||
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
||||||
{
|
{
|
||||||
tgba_explicit::state::iterator i2;
|
tgba_explicit::state::iterator i2;
|
||||||
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
||||||
{
|
{
|
||||||
(*i2)->accepting_conditions = all - (*i2)->accepting_conditions;
|
(*i2)->acceptance_conditions = all - (*i2)->acceptance_conditions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
tgba_explicit::has_accepting_condition(const ltl::formula* f) const
|
tgba_explicit::has_acceptance_condition(const ltl::formula* f) const
|
||||||
{
|
{
|
||||||
return dict_->is_registered_accepting_variable(f, this);
|
return dict_->is_registered_acceptance_variable(f, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_explicit::get_accepting_condition(const ltl::formula* f)
|
tgba_explicit::get_acceptance_condition(const ltl::formula* f)
|
||||||
{
|
{
|
||||||
const ltl::constant* c = dynamic_cast<const ltl::constant*>(f);
|
const ltl::constant* c = dynamic_cast<const ltl::constant*>(f);
|
||||||
if (c)
|
if (c)
|
||||||
|
|
@ -258,34 +258,34 @@ namespace spot
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
bdd_dict::fv_map::iterator i = dict_->acc_map.find(f);
|
bdd_dict::fv_map::iterator i = dict_->acc_map.find(f);
|
||||||
assert(has_accepting_condition(f));
|
assert(has_acceptance_condition(f));
|
||||||
/* If this second assert fails and the first doesn't,
|
/* If this second assert fails and the first doesn't,
|
||||||
things are badly broken. This has already happened. */
|
things are badly broken. This has already happened. */
|
||||||
assert(i != dict_->acc_map.end());
|
assert(i != dict_->acc_map.end());
|
||||||
ltl::destroy(f);
|
ltl::destroy(f);
|
||||||
bdd v = bdd_ithvar(i->second);
|
bdd v = bdd_ithvar(i->second);
|
||||||
v &= bdd_exist(neg_accepting_conditions_, v);
|
v &= bdd_exist(neg_acceptance_conditions_, v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tgba_explicit::add_accepting_condition(transition* t, const ltl::formula* f)
|
tgba_explicit::add_acceptance_condition(transition* t, const ltl::formula* f)
|
||||||
{
|
{
|
||||||
bdd c = get_accepting_condition(f);
|
bdd c = get_acceptance_condition(f);
|
||||||
t->accepting_conditions |= c;
|
t->acceptance_conditions |= c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tgba_explicit::add_accepting_conditions(transition* t, bdd f)
|
tgba_explicit::add_acceptance_conditions(transition* t, bdd f)
|
||||||
{
|
{
|
||||||
bdd sup = bdd_support(f);
|
bdd sup = bdd_support(f);
|
||||||
dict_->register_accepting_variables(sup, this);
|
dict_->register_acceptance_variables(sup, this);
|
||||||
while (sup != bddtrue)
|
while (sup != bddtrue)
|
||||||
{
|
{
|
||||||
neg_accepting_conditions_ &= bdd_nithvar(bdd_var(sup));
|
neg_acceptance_conditions_ &= bdd_nithvar(bdd_var(sup));
|
||||||
sup = bdd_high(sup);
|
sup = bdd_high(sup);
|
||||||
}
|
}
|
||||||
t->accepting_conditions |= f;
|
t->acceptance_conditions |= f;
|
||||||
}
|
}
|
||||||
|
|
||||||
state*
|
state*
|
||||||
|
|
@ -307,7 +307,7 @@ namespace spot
|
||||||
(void) global_state;
|
(void) global_state;
|
||||||
(void) global_automaton;
|
(void) global_automaton;
|
||||||
return new tgba_explicit_succ_iterator(s->get_state(),
|
return new tgba_explicit_succ_iterator(s->get_state(),
|
||||||
all_accepting_conditions());
|
all_acceptance_conditions());
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
|
|
@ -355,38 +355,38 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_explicit::all_accepting_conditions() const
|
tgba_explicit::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
if (!all_accepting_conditions_computed_)
|
if (!all_acceptance_conditions_computed_)
|
||||||
{
|
{
|
||||||
bdd all = bddfalse;
|
bdd all = bddfalse;
|
||||||
|
|
||||||
// Build all_accepting_conditions_ from neg_accepting_conditions_
|
// Build all_acceptance_conditions_ from neg_acceptance_conditions_
|
||||||
// I.e., transform !A & !B & !C into
|
// I.e., transform !A & !B & !C into
|
||||||
// A & !B & !C
|
// A & !B & !C
|
||||||
// + !A & B & !C
|
// + !A & B & !C
|
||||||
// + !A & !B & C
|
// + !A & !B & C
|
||||||
bdd cur = neg_accepting_conditions_;
|
bdd cur = neg_acceptance_conditions_;
|
||||||
while (cur != bddtrue)
|
while (cur != bddtrue)
|
||||||
{
|
{
|
||||||
assert(cur != bddfalse);
|
assert(cur != bddfalse);
|
||||||
|
|
||||||
bdd v = bdd_ithvar(bdd_var(cur));
|
bdd v = bdd_ithvar(bdd_var(cur));
|
||||||
all |= v & bdd_exist(neg_accepting_conditions_, v);
|
all |= v & bdd_exist(neg_acceptance_conditions_, v);
|
||||||
|
|
||||||
assert(bdd_high(cur) != bddtrue);
|
assert(bdd_high(cur) != bddtrue);
|
||||||
cur = bdd_low(cur);
|
cur = bdd_low(cur);
|
||||||
}
|
}
|
||||||
all_accepting_conditions_ = all;
|
all_acceptance_conditions_ = all;
|
||||||
all_accepting_conditions_computed_ = true;
|
all_acceptance_conditions_computed_ = true;
|
||||||
}
|
}
|
||||||
return all_accepting_conditions_;
|
return all_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_explicit::neg_accepting_conditions() const
|
tgba_explicit::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return neg_accepting_conditions_;
|
return neg_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace spot
|
||||||
struct transition
|
struct transition
|
||||||
{
|
{
|
||||||
bdd condition;
|
bdd condition;
|
||||||
bdd accepting_conditions;
|
bdd acceptance_conditions;
|
||||||
state* dest;
|
state* dest;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -59,12 +59,12 @@ namespace spot
|
||||||
void add_neg_condition(transition* t, const ltl::formula* f);
|
void add_neg_condition(transition* t, const ltl::formula* f);
|
||||||
/// This assumes that all variables in \a f are known from dict.
|
/// This assumes that all variables in \a f are known from dict.
|
||||||
void add_conditions(transition* t, bdd f);
|
void add_conditions(transition* t, bdd f);
|
||||||
void declare_accepting_condition(const ltl::formula* f);
|
void declare_acceptance_condition(const ltl::formula* f);
|
||||||
bool has_accepting_condition(const ltl::formula* f) const;
|
bool has_acceptance_condition(const ltl::formula* f) const;
|
||||||
void add_accepting_condition(transition* t, const ltl::formula* f);
|
void add_acceptance_condition(transition* t, const ltl::formula* f);
|
||||||
/// This assumes that all accepting conditions in \a f are known from dict.
|
/// This assumes that all acceptance conditions in \a f are known from dict.
|
||||||
void add_accepting_conditions(transition* t, bdd f);
|
void add_acceptance_conditions(transition* t, bdd f);
|
||||||
void complement_all_accepting_conditions();
|
void complement_all_acceptance_conditions();
|
||||||
|
|
||||||
// tgba interface
|
// tgba interface
|
||||||
virtual ~tgba_explicit();
|
virtual ~tgba_explicit();
|
||||||
|
|
@ -76,8 +76,8 @@ namespace spot
|
||||||
virtual bdd_dict* get_dict() const;
|
virtual bdd_dict* get_dict() const;
|
||||||
virtual std::string format_state(const spot::state* state) const;
|
virtual std::string format_state(const spot::state* state) const;
|
||||||
|
|
||||||
virtual bdd all_accepting_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_accepting_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const spot::state* state) const;
|
virtual bdd compute_support_conditions(const spot::state* state) const;
|
||||||
|
|
@ -85,7 +85,7 @@ namespace spot
|
||||||
|
|
||||||
state* add_state(const std::string& name);
|
state* add_state(const std::string& name);
|
||||||
bdd get_condition(const ltl::formula* f);
|
bdd get_condition(const ltl::formula* f);
|
||||||
bdd get_accepting_condition(const ltl::formula* f);
|
bdd get_acceptance_condition(const ltl::formula* f);
|
||||||
|
|
||||||
typedef Sgi::hash_map<const std::string, tgba_explicit::state*,
|
typedef Sgi::hash_map<const std::string, tgba_explicit::state*,
|
||||||
string_hash> ns_map;
|
string_hash> ns_map;
|
||||||
|
|
@ -95,9 +95,9 @@ namespace spot
|
||||||
sn_map state_name_map_;
|
sn_map state_name_map_;
|
||||||
bdd_dict* dict_;
|
bdd_dict* dict_;
|
||||||
tgba_explicit::state* init_;
|
tgba_explicit::state* init_;
|
||||||
mutable bdd all_accepting_conditions_;
|
mutable bdd all_acceptance_conditions_;
|
||||||
bdd neg_accepting_conditions_;
|
bdd neg_acceptance_conditions_;
|
||||||
mutable bool all_accepting_conditions_computed_;
|
mutable bool all_acceptance_conditions_computed_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disallow copy.
|
// Disallow copy.
|
||||||
|
|
@ -146,12 +146,12 @@ namespace spot
|
||||||
|
|
||||||
virtual state_explicit* current_state() const;
|
virtual state_explicit* current_state() const;
|
||||||
virtual bdd current_condition() const;
|
virtual bdd current_condition() const;
|
||||||
virtual bdd current_accepting_conditions() const;
|
virtual bdd current_acceptance_conditions() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const tgba_explicit::state* s_;
|
const tgba_explicit::state* s_;
|
||||||
tgba_explicit::state::const_iterator i_;
|
tgba_explicit::state::const_iterator i_;
|
||||||
bdd all_accepting_conditions_;
|
bdd all_acceptance_conditions_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,10 +162,10 @@ namespace spot
|
||||||
return current_cond_;
|
return current_cond_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd tgba_succ_iterator_product::current_accepting_conditions() const
|
bdd tgba_succ_iterator_product::current_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return ((left_->current_accepting_conditions() & right_neg_)
|
return ((left_->current_acceptance_conditions() & right_neg_)
|
||||||
| (right_->current_accepting_conditions() & left_neg_));
|
| (right_->current_acceptance_conditions() & left_neg_));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
@ -176,16 +176,16 @@ namespace spot
|
||||||
{
|
{
|
||||||
assert(dict_ == right->get_dict());
|
assert(dict_ == right->get_dict());
|
||||||
|
|
||||||
bdd lna = left_->neg_accepting_conditions();
|
bdd lna = left_->neg_acceptance_conditions();
|
||||||
bdd rna = right_->neg_accepting_conditions();
|
bdd rna = right_->neg_acceptance_conditions();
|
||||||
left_acc_complement_ = bdd_exist(lna, bdd_support(rna));
|
left_acc_complement_ = bdd_exist(lna, bdd_support(rna));
|
||||||
right_acc_complement_ = bdd_exist(rna, bdd_support(lna));
|
right_acc_complement_ = bdd_exist(rna, bdd_support(lna));
|
||||||
|
|
||||||
all_accepting_conditions_ = ((left_->all_accepting_conditions()
|
all_acceptance_conditions_ = ((left_->all_acceptance_conditions()
|
||||||
& right_acc_complement_)
|
& right_acc_complement_)
|
||||||
| (right_->all_accepting_conditions()
|
| (right_->all_acceptance_conditions()
|
||||||
& left_acc_complement_));
|
& left_acc_complement_));
|
||||||
neg_accepting_conditions_ = lna & rna;
|
neg_acceptance_conditions_ = lna & rna;
|
||||||
|
|
||||||
dict_->register_all_variables_of(&left_, this);
|
dict_->register_all_variables_of(&left_, this);
|
||||||
dict_->register_all_variables_of(&right_, this);
|
dict_->register_all_variables_of(&right_, this);
|
||||||
|
|
@ -279,15 +279,15 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_product::all_accepting_conditions() const
|
tgba_product::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return all_accepting_conditions_;
|
return all_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_product::neg_accepting_conditions() const
|
tgba_product::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return neg_accepting_conditions_;
|
return neg_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ namespace spot
|
||||||
// inspection
|
// inspection
|
||||||
state_product* current_state() const;
|
state_product* current_state() const;
|
||||||
bdd current_condition() const;
|
bdd current_condition() const;
|
||||||
bdd current_accepting_conditions() const;
|
bdd current_acceptance_conditions() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//@{
|
//@{
|
||||||
|
|
@ -133,8 +133,8 @@ namespace spot
|
||||||
|
|
||||||
virtual state* project_state(const state* s, const tgba* t) const;
|
virtual state* project_state(const state* s, const tgba* t) const;
|
||||||
|
|
||||||
virtual bdd all_accepting_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_accepting_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const state* state) const;
|
virtual bdd compute_support_conditions(const state* state) const;
|
||||||
|
|
@ -146,8 +146,8 @@ namespace spot
|
||||||
const tgba* right_;
|
const tgba* right_;
|
||||||
bdd left_acc_complement_;
|
bdd left_acc_complement_;
|
||||||
bdd right_acc_complement_;
|
bdd right_acc_complement_;
|
||||||
bdd all_accepting_conditions_;
|
bdd all_acceptance_conditions_;
|
||||||
bdd neg_accepting_conditions_;
|
bdd neg_acceptance_conditions_;
|
||||||
// Disallow copy.
|
// Disallow copy.
|
||||||
tgba_product(const tgba_product&);
|
tgba_product(const tgba_product&);
|
||||||
tgba_product& tgba_product::operator=(const tgba_product&);
|
tgba_product& tgba_product::operator=(const tgba_product&);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace spot
|
||||||
/// \brief A state for spot::tgba_tba_proxy.
|
/// \brief A state for spot::tgba_tba_proxy.
|
||||||
///
|
///
|
||||||
/// This state is in fact a pair of state: the state from the tgba
|
/// This state is in fact a pair of state: the state from the tgba
|
||||||
/// automaton, and the "counter" (we use the accepting set
|
/// automaton, and the "counter" (we use the acceptance set
|
||||||
/// BDD variable instead of an integer counter).
|
/// BDD variable instead of an integer counter).
|
||||||
class state_tba_proxy : public state
|
class state_tba_proxy : public state
|
||||||
{
|
{
|
||||||
|
|
@ -44,7 +44,7 @@ namespace spot
|
||||||
state_tba_proxy(const state_tba_proxy& o)
|
state_tba_proxy(const state_tba_proxy& o)
|
||||||
: state(),
|
: state(),
|
||||||
s_(o.real_state()->clone()),
|
s_(o.real_state()->clone()),
|
||||||
acc_(o.accepting_cond())
|
acc_(o.acceptance_cond())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
accepting_cond() const
|
acceptance_cond() const
|
||||||
{
|
{
|
||||||
return acc_;
|
return acc_;
|
||||||
}
|
}
|
||||||
|
|
@ -74,14 +74,14 @@ namespace spot
|
||||||
int res = s_->compare(o->real_state());
|
int res = s_->compare(o->real_state());
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return res;
|
return res;
|
||||||
return acc_.id() - o->accepting_cond().id();
|
return acc_.id() - o->acceptance_cond().id();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual size_t
|
virtual size_t
|
||||||
hash() const
|
hash() const
|
||||||
{
|
{
|
||||||
// We expect to have many more state than accepting conditions.
|
// We expect to have many more state than acceptance conditions.
|
||||||
// Hence we keep only 8 bits for accepting conditions.
|
// Hence we keep only 8 bits for acceptance conditions.
|
||||||
return (s_->hash() << 8) + (acc_.id() & 0xFF);
|
return (s_->hash() << 8) + (acc_.id() & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -103,9 +103,9 @@ namespace spot
|
||||||
public:
|
public:
|
||||||
tgba_tba_proxy_succ_iterator(tgba_succ_iterator* it,
|
tgba_tba_proxy_succ_iterator(tgba_succ_iterator* it,
|
||||||
bdd acc, bdd next_acc,
|
bdd acc, bdd next_acc,
|
||||||
bdd the_accepting_cond)
|
bdd the_acceptance_cond)
|
||||||
: it_(it), acc_(acc), next_acc_(next_acc),
|
: it_(it), acc_(acc), next_acc_(next_acc),
|
||||||
the_accepting_cond_(the_accepting_cond)
|
the_acceptance_cond_(the_acceptance_cond)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,10 +142,10 @@ namespace spot
|
||||||
{
|
{
|
||||||
state* s = it_->current_state();
|
state* s = it_->current_state();
|
||||||
bdd acc;
|
bdd acc;
|
||||||
// Transition in the ACC_ accepting set should be directed
|
// Transition in the ACC_ acceptance set should be directed
|
||||||
// to the NEXT_ACC_ accepting set.
|
// to the NEXT_ACC_ acceptance set.
|
||||||
if (acc_ == bddtrue
|
if (acc_ == bddtrue
|
||||||
|| (acc_ & it_->current_accepting_conditions()) == acc_)
|
|| (acc_ & it_->current_acceptance_conditions()) == acc_)
|
||||||
acc = next_acc_;
|
acc = next_acc_;
|
||||||
else
|
else
|
||||||
acc = acc_;
|
acc = acc_;
|
||||||
|
|
@ -159,31 +159,31 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
current_accepting_conditions() const
|
current_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return the_accepting_cond_;
|
return the_acceptance_cond_;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
tgba_succ_iterator* it_;
|
tgba_succ_iterator* it_;
|
||||||
bdd acc_;
|
bdd acc_;
|
||||||
bdd next_acc_;
|
bdd next_acc_;
|
||||||
bdd the_accepting_cond_;
|
bdd the_acceptance_cond_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
tgba_tba_proxy::tgba_tba_proxy(const tgba* a)
|
tgba_tba_proxy::tgba_tba_proxy(const tgba* a)
|
||||||
: a_(a)
|
: a_(a)
|
||||||
{
|
{
|
||||||
bdd all = a_->all_accepting_conditions();
|
bdd all = a_->all_acceptance_conditions();
|
||||||
|
|
||||||
// We will use one accepting condition for this automata.
|
// We will use one acceptance condition for this automata.
|
||||||
// Let's call it Acc[True].
|
// Let's call it Acc[True].
|
||||||
int v = get_dict()
|
int v = get_dict()
|
||||||
->register_accepting_variable(ltl::constant::true_instance(), this);
|
->register_acceptance_variable(ltl::constant::true_instance(), this);
|
||||||
the_accepting_cond_ = bdd_ithvar(v);
|
the_acceptance_cond_ = bdd_ithvar(v);
|
||||||
|
|
||||||
// Now build the "cycle" of accepting conditions.
|
// Now build the "cycle" of acceptance conditions.
|
||||||
|
|
||||||
bdd last = bdd_satone(all);
|
bdd last = bdd_satone(all);
|
||||||
all -= last;
|
all -= last;
|
||||||
|
|
@ -225,13 +225,13 @@ namespace spot
|
||||||
|
|
||||||
tgba_succ_iterator* it = a_->succ_iter(s->real_state(),
|
tgba_succ_iterator* it = a_->succ_iter(s->real_state(),
|
||||||
global_state, global_automaton);
|
global_state, global_automaton);
|
||||||
bdd acc = s->accepting_cond();
|
bdd acc = s->acceptance_cond();
|
||||||
cycle_map::const_iterator i = acc_cycle_.find(acc);
|
cycle_map::const_iterator i = acc_cycle_.find(acc);
|
||||||
assert(i != acc_cycle_.end());
|
assert(i != acc_cycle_.end());
|
||||||
return
|
return
|
||||||
new tgba_tba_proxy_succ_iterator(it, acc, i->second,
|
new tgba_tba_proxy_succ_iterator(it, acc, i->second,
|
||||||
(acc == bddtrue)
|
(acc == bddtrue)
|
||||||
? the_accepting_cond_ : bddfalse);
|
? the_acceptance_cond_ : bddfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd_dict*
|
bdd_dict*
|
||||||
|
|
@ -246,7 +246,7 @@ namespace spot
|
||||||
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);
|
assert(s);
|
||||||
return a_->format_state(s->real_state()) + "("
|
return a_->format_state(s->real_state()) + "("
|
||||||
+ bdd_format_set(get_dict(), s->accepting_cond()) + ")";
|
+ bdd_format_set(get_dict(), s->acceptance_cond()) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
state*
|
state*
|
||||||
|
|
@ -261,15 +261,15 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_tba_proxy::all_accepting_conditions() const
|
tgba_tba_proxy::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return the_accepting_cond_;
|
return the_acceptance_cond_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
tgba_tba_proxy::neg_accepting_conditions() const
|
tgba_tba_proxy::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return !the_accepting_cond_;
|
return !the_acceptance_cond_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -278,7 +278,7 @@ namespace spot
|
||||||
const state_tba_proxy* s =
|
const state_tba_proxy* s =
|
||||||
dynamic_cast<const state_tba_proxy*>(state);
|
dynamic_cast<const state_tba_proxy*>(state);
|
||||||
assert(s);
|
assert(s);
|
||||||
return bddtrue == s->accepting_cond();
|
return bddtrue == s->acceptance_cond();
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,14 @@ namespace spot
|
||||||
/// be degeneralized on the fly.
|
/// be degeneralized on the fly.
|
||||||
///
|
///
|
||||||
/// This automaton is a spot::tgba, but it will always have exactly
|
/// This automaton is a spot::tgba, but it will always have exactly
|
||||||
/// one accepting condition.
|
/// one acceptance condition.
|
||||||
///
|
///
|
||||||
/// The degeneralization is done by synchronizing the input
|
/// The degeneralization is done by synchronizing the input
|
||||||
/// automaton with a "counter" automaton such as the one shown in
|
/// automaton with a "counter" automaton such as the one shown in
|
||||||
/// "On-the-fly Verification of Linear Temporal Logic" (Jean-Michel
|
/// "On-the-fly Verification of Linear Temporal Logic" (Jean-Michel
|
||||||
/// Couveur, FME99).
|
/// Couveur, FME99).
|
||||||
///
|
///
|
||||||
/// If the input automaton uses N accepting conditions, the output
|
/// If the input automaton uses N acceptance conditions, the output
|
||||||
/// automaton can have at most max(N,1)+1 times more states and
|
/// automaton can have at most max(N,1)+1 times more states and
|
||||||
/// transitions.
|
/// transitions.
|
||||||
class tgba_tba_proxy : public tgba
|
class tgba_tba_proxy : public tgba
|
||||||
|
|
@ -65,8 +65,8 @@ namespace spot
|
||||||
|
|
||||||
virtual state* project_state(const state* s, const tgba* t) const;
|
virtual state* project_state(const state* s, const tgba* t) const;
|
||||||
|
|
||||||
virtual bdd all_accepting_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_accepting_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
|
|
||||||
bool state_is_accepting(const state* state) const;
|
bool state_is_accepting(const state* state) const;
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace spot
|
||||||
const tgba* a_;
|
const tgba* a_;
|
||||||
typedef std::map<bdd, bdd, bdd_less_than> cycle_map;
|
typedef std::map<bdd, bdd, bdd_less_than> cycle_map;
|
||||||
cycle_map acc_cycle_;
|
cycle_map acc_cycle_;
|
||||||
bdd the_accepting_cond_;
|
bdd the_acceptance_cond_;
|
||||||
// Disallow copy.
|
// Disallow copy.
|
||||||
tgba_tba_proxy(const tgba_tba_proxy&);
|
tgba_tba_proxy(const tgba_tba_proxy&);
|
||||||
tgba_tba_proxy& tgba_tba_proxy::operator=(const tgba_tba_proxy&);
|
tgba_tba_proxy& tgba_tba_proxy::operator=(const tgba_tba_proxy&);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace spot
|
||||||
bdd_print_formula(os_, automata_->get_dict(),
|
bdd_print_formula(os_, automata_->get_dict(),
|
||||||
si->current_condition()) << "\\n";
|
si->current_condition()) << "\\n";
|
||||||
bdd_print_accset(os_, automata_->get_dict(),
|
bdd_print_accset(os_, automata_->get_dict(),
|
||||||
si->current_accepting_conditions()) << "\"]"
|
si->current_acceptance_conditions()) << "\"]"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace spot {
|
||||||
tgba_explicit::transition* t =
|
tgba_explicit::transition* t =
|
||||||
out_->create_transition(name_[in], name_[out]);
|
out_->create_transition(name_[in], name_[out]);
|
||||||
out_->add_conditions(t, si->current_condition());
|
out_->add_conditions(t, si->current_condition());
|
||||||
out_->add_accepting_conditions(t, si->current_accepting_conditions());
|
out_->add_acceptance_conditions(t, si->current_acceptance_conditions());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ namespace spot
|
||||||
// (destination state, acceptance conditions of the arc)
|
// (destination state, acceptance conditions of the arc)
|
||||||
// we are interested in...
|
// we are interested in...
|
||||||
const state* dest = succ->current_state();
|
const state* dest = succ->current_state();
|
||||||
bdd acc = succ->current_accepting_conditions();
|
bdd acc = succ->current_acceptance_conditions();
|
||||||
// ... and point the iterator to the next successor, for
|
// ... and point the iterator to the next successor, for
|
||||||
// the next iteration.
|
// the next iteration.
|
||||||
succ->next();
|
succ->next();
|
||||||
|
|
@ -242,7 +242,7 @@ namespace spot
|
||||||
// Accumulate all acceptance conditions into the merged SCC.
|
// Accumulate all acceptance conditions into the merged SCC.
|
||||||
root.top().condition |= acc;
|
root.top().condition |= acc;
|
||||||
|
|
||||||
if (root.top().condition == aut_->all_accepting_conditions())
|
if (root.top().condition == aut_->all_acceptance_conditions())
|
||||||
{
|
{
|
||||||
// We have found an accepting SCC.
|
// We have found an accepting SCC.
|
||||||
// Release all iterators in TODO.
|
// Release all iterators in TODO.
|
||||||
|
|
@ -559,7 +559,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
dest = h_filt(dest);
|
dest = h_filt(dest);
|
||||||
bdd acc = iter->current_accepting_conditions() | todo.top().acc;
|
bdd acc = iter->current_acceptance_conditions() | todo.top().acc;
|
||||||
path.push_back(state_proposition(dest, iter->current_condition()));
|
path.push_back(state_proposition(dest, iter->current_condition()));
|
||||||
|
|
||||||
// Advance iterator for next step.
|
// Advance iterator for next step.
|
||||||
|
|
@ -604,7 +604,7 @@ namespace spot
|
||||||
// acceptance conditions of acc_restrict.
|
// acceptance conditions of acc_restrict.
|
||||||
//
|
//
|
||||||
// FIXME: It would be better to count the number
|
// FIXME: It would be better to count the number
|
||||||
// of accepting conditions.
|
// of acceptance conditions.
|
||||||
if (bddtrue != (best_acc_restrict >> acc_restrict))
|
if (bddtrue != (best_acc_restrict >> acc_restrict))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ namespace spot
|
||||||
connected_component(int index = -1);
|
connected_component(int index = -1);
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
/// The bdd condition is the union of all accepting condition of
|
/// The bdd condition is the union of all acceptance conditions of
|
||||||
/// transitions which connect the states of the connected component.
|
/// transitions which connect the states of the connected component.
|
||||||
bdd condition;
|
bdd condition;
|
||||||
};
|
};
|
||||||
|
|
@ -121,7 +121,7 @@ namespace spot
|
||||||
void remove_component(const state* start_delete);
|
void remove_component(const state* start_delete);
|
||||||
|
|
||||||
/// Called by counter_example to find a path which traverses all
|
/// Called by counter_example to find a path which traverses all
|
||||||
/// accepting conditions in the accepted SCC.
|
/// acceptance conditions in the accepted SCC.
|
||||||
void accepting_path (const connected_component_set& scc,
|
void accepting_path (const connected_component_set& scc,
|
||||||
const state* start, bdd acc_to_traverse);
|
const state* start, bdd acc_to_traverse);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,14 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
// At some point we'll need to print an accepting set into LBTT's
|
// At some point we'll need to print an acceptance set into LBTT's
|
||||||
// format. LBTT expects numbered accepting sets, so first we'll
|
// format. LBTT expects numbered acceptance sets, so first we'll
|
||||||
// number each accepting condition, and latter when we have to print
|
// number each acceptance condition, and latter when we have to print
|
||||||
// them we'll just have to look up each of them.
|
// them we'll just have to look up each of them.
|
||||||
class accepting_cond_splitter
|
class acceptance_cond_splitter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
accepting_cond_splitter(bdd all_acc)
|
acceptance_cond_splitter(bdd all_acc)
|
||||||
{
|
{
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
while (all_acc != bddfalse)
|
while (all_acc != bddfalse)
|
||||||
|
|
@ -105,7 +105,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each state in the produced automata corresponds to
|
// Each state in the produced automata corresponds to
|
||||||
// a (state, accepting set) pair for the source automata.
|
// a (state, acceptance set) pair for the source automata.
|
||||||
|
|
||||||
typedef std::pair<state*, bdd> state_acc_pair;
|
typedef std::pair<state*, bdd> state_acc_pair;
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ namespace spot
|
||||||
bool
|
bool
|
||||||
operator()(const state_acc_pair& that) const
|
operator()(const state_acc_pair& that) const
|
||||||
{
|
{
|
||||||
// We assume there will be far more states than accepting conditions.
|
// We assume there will be far more states than acceptance conditions.
|
||||||
// Hence we keep only 8 bits for the latter.
|
// Hence we keep only 8 bits for the latter.
|
||||||
return (that.first->hash() << 8) + (that.second.id() & 0xFF);
|
return (that.first->hash() << 8) + (that.second.id() & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
@ -173,18 +173,18 @@ namespace spot
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Browse the successors of STATE to gather accepting
|
// Browse the successors of STATE to gather acceptance
|
||||||
// conditions of outgoing transitions.
|
// conditions of outgoing transitions.
|
||||||
bdd_set acc_seen;
|
bdd_set acc_seen;
|
||||||
tgba_succ_iterator* si = g->succ_iter(state);
|
tgba_succ_iterator* si = g->succ_iter(state);
|
||||||
for (si->first(); !si->done(); si->next())
|
for (si->first(); !si->done(); si->next())
|
||||||
{
|
{
|
||||||
acc_seen.insert(si->current_accepting_conditions());
|
acc_seen.insert(si->current_acceptance_conditions());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order the creation of the supplementary initial state if needed.
|
// Order the creation of the supplementary initial state if needed.
|
||||||
// Use bddtrue as accepting condition because it cannot conflict
|
// Use bddtrue as acceptance condition because it cannot conflict
|
||||||
// with other (state, accepting cond) pairs in the maps.
|
// with other (state, acceptance cond) pairs in the maps.
|
||||||
if (init && acc_seen.size() > 1)
|
if (init && acc_seen.size() > 1)
|
||||||
{
|
{
|
||||||
state_acc_pair p(state, bddtrue);
|
state_acc_pair p(state, bddtrue);
|
||||||
|
|
@ -219,7 +219,7 @@ namespace spot
|
||||||
|
|
||||||
fill_todo(todo, seen, acp_seen,
|
fill_todo(todo, seen, acp_seen,
|
||||||
g->get_init_state(), g, mmp, state_number, true);
|
g->get_init_state(), g, mmp, state_number, true);
|
||||||
accepting_cond_splitter acs(g->all_accepting_conditions());
|
acceptance_cond_splitter acs(g->all_acceptance_conditions());
|
||||||
|
|
||||||
while(! todo.empty())
|
while(! todo.empty())
|
||||||
{
|
{
|
||||||
|
|
@ -227,12 +227,12 @@ namespace spot
|
||||||
todo.erase(todo.begin());
|
todo.erase(todo.begin());
|
||||||
unsigned number = acp_seen[sap];
|
unsigned number = acp_seen[sap];
|
||||||
|
|
||||||
// number == 0 is the initial state. bddtrue as an accepting
|
// number == 0 is the initial state. bddtrue as an acceptance
|
||||||
// conditions indicates a "fake" initial state introduced
|
// conditions indicates a "fake" initial state introduced
|
||||||
// because the original initial state was split into many
|
// because the original initial state was split into many
|
||||||
// states (with different accepting conditions).
|
// states (with different acceptance conditions).
|
||||||
// As this "fake" state has no input transitions, there is
|
// As this "fake" state has no input transitions, there is
|
||||||
// no point in computing any accepting conditions.
|
// no point in computing any acceptance conditions.
|
||||||
body << number << (number ? " 0 " : " 1 ");
|
body << number << (number ? " 0 " : " 1 ");
|
||||||
if (sap.second != bddtrue)
|
if (sap.second != bddtrue)
|
||||||
acs.split(body, sap.second);
|
acs.split(body, sap.second);
|
||||||
|
|
@ -241,12 +241,12 @@ namespace spot
|
||||||
tgba_succ_iterator* si = g->succ_iter(sap.first);
|
tgba_succ_iterator* si = g->succ_iter(sap.first);
|
||||||
for (si->first(); !si->done(); si->next())
|
for (si->first(); !si->done(); si->next())
|
||||||
{
|
{
|
||||||
// We have put the accepting conditions on the state,
|
// We have put the acceptance conditions on the state,
|
||||||
// so draw only outgoing transition with these accepting
|
// so draw only outgoing transition with these acceptance
|
||||||
// conditions.
|
// conditions.
|
||||||
|
|
||||||
if (sap.second != bddtrue
|
if (sap.second != bddtrue
|
||||||
&& si->current_accepting_conditions() != sap.second)
|
&& si->current_acceptance_conditions() != sap.second)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
minmax_pair destrange;
|
minmax_pair destrange;
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,17 @@ namespace spot
|
||||||
///
|
///
|
||||||
/// Note that LBTT expects an automaton with transition
|
/// Note that LBTT expects an automaton with transition
|
||||||
/// labeled by propositional formulae, and generalized
|
/// labeled by propositional formulae, and generalized
|
||||||
/// Büchi accepting conditions on \b states. This
|
/// Büchi acceptance conditions on \b states. This
|
||||||
/// is unlike our spot::tgba automata which put
|
/// is unlike our spot::tgba automata which put
|
||||||
/// both generalized accepting conditions and propositional
|
/// both generalized acceptance conditions and propositional
|
||||||
/// formulae) on \b transitions.
|
/// formulae) on \b transitions.
|
||||||
///
|
///
|
||||||
/// This algorithm will therefore produce an automata where
|
/// This algorithm will therefore produce an automata where
|
||||||
/// accepting conditions have been moved from each transition to
|
/// acceptance conditions have been moved from each transition to
|
||||||
/// previous state. In the worst case, doing so will multiply the
|
/// previous state. In the worst case, doing so will multiply the
|
||||||
/// number of states and transitions of the automata by
|
/// number of states and transitions of the automata by
|
||||||
/// <code>2^|Acc|</code>. where <code>|Acc|</code> is the number of
|
/// <code>2^|Acc|</code>. where <code>|Acc|</code> is the number of
|
||||||
/// accepting conditions used by the automata. (It can be a bit
|
/// acceptance conditions used by the automata. (It can be a bit
|
||||||
/// more because LBTT allows only for one initial state:
|
/// more because LBTT allows only for one initial state:
|
||||||
/// lbtt_reachable() may also have to create an additional state in
|
/// lbtt_reachable() may also have to create an additional state in
|
||||||
/// case the source initial state had to be split.) You have been
|
/// case the source initial state had to be split.) You have been
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ namespace spot
|
||||||
register_a_variable(const formula* f)
|
register_a_variable(const formula* f)
|
||||||
{
|
{
|
||||||
int num;
|
int num;
|
||||||
// Do not build an accepting variable that already exists.
|
// Do not build an acceptance variable that already exists.
|
||||||
fv_map::iterator sii = a_map.find(f);
|
fv_map::iterator sii = a_map.find(f);
|
||||||
if (sii != a_map.end())
|
if (sii != a_map.end())
|
||||||
{
|
{
|
||||||
|
|
@ -243,16 +243,16 @@ namespace spot
|
||||||
bdd high = bdd_high(b);
|
bdd high = bdd_high(b);
|
||||||
if (high == bddfalse)
|
if (high == bddfalse)
|
||||||
{
|
{
|
||||||
// Simply ignore negated accepting variables.
|
// Simply ignore negated acceptance variables.
|
||||||
b = bdd_low(b);
|
b = bdd_low(b);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
formula* ac = var_to_formula(var);
|
formula* ac = var_to_formula(var);
|
||||||
|
|
||||||
if (! a->has_accepting_condition(ac))
|
if (! a->has_acceptance_condition(ac))
|
||||||
a->declare_accepting_condition(clone(ac));
|
a->declare_acceptance_condition(clone(ac));
|
||||||
a->add_accepting_condition(t, ac);
|
a->add_acceptance_condition(t, ac);
|
||||||
|
|
||||||
atomic_prop::instance_count();
|
atomic_prop::instance_count();
|
||||||
b = high;
|
b = high;
|
||||||
|
|
@ -501,8 +501,8 @@ namespace spot
|
||||||
i != formulae_seen.end(); ++i)
|
i != formulae_seen.end(); ++i)
|
||||||
destroy(*i);
|
destroy(*i);
|
||||||
|
|
||||||
// Turn all promises into real accepting conditions.
|
// Turn all promises into real acceptance conditions.
|
||||||
a->complement_all_accepting_conditions();
|
a->complement_all_acceptance_conditions();
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,12 +98,12 @@ namespace spot
|
||||||
/*
|
/*
|
||||||
`x | next', doesn't actually encode the fact that x
|
`x | next', doesn't actually encode the fact that x
|
||||||
should be fulfilled eventually. We ensure this by
|
should be fulfilled eventually. We ensure this by
|
||||||
creating a new generalized Büchi accepting set, Acc[x],
|
creating a new generalized Büchi acceptance set, Acc[x],
|
||||||
and leave out of this set any transition going off NOW
|
and leave out of this set any transition going off NOW
|
||||||
without checking X. Such accepting conditions are
|
without checking X. Such acceptance conditions are
|
||||||
checked for during the emptiness check.
|
checked for during the emptiness check.
|
||||||
*/
|
*/
|
||||||
fact_.declare_accepting_condition(x | !now, node->child());
|
fact_.declare_acceptance_condition(x | !now, node->child());
|
||||||
res_ = now;
|
res_ = now;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -181,10 +181,10 @@ namespace spot
|
||||||
/*
|
/*
|
||||||
The rightmost conjunction, f1 & next, doesn't actually
|
The rightmost conjunction, f1 & next, doesn't actually
|
||||||
encode the fact that f2 should be fulfilled eventually.
|
encode the fact that f2 should be fulfilled eventually.
|
||||||
We declare an accepting condition for this purpose (see
|
We declare an acceptance condition for this purpose (see
|
||||||
the comment in the unop::F case).
|
the comment in the unop::F case).
|
||||||
*/
|
*/
|
||||||
fact_.declare_accepting_condition(f2 | !now, node->second());
|
fact_.declare_acceptance_condition(f2 | !now, node->second());
|
||||||
res_ = now;
|
res_ = now;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace spot
|
||||||
const bdd_dict* d = automata_->get_dict();
|
const bdd_dict* d = automata_->get_dict();
|
||||||
os_ << "acc =";
|
os_ << "acc =";
|
||||||
|
|
||||||
bdd acc = automata_->all_accepting_conditions();
|
bdd acc = automata_->all_acceptance_conditions();
|
||||||
while (acc != bddfalse)
|
while (acc != bddfalse)
|
||||||
{
|
{
|
||||||
bdd cube = bdd_satone(acc);
|
bdd cube = bdd_satone(acc);
|
||||||
|
|
@ -79,7 +79,7 @@ namespace spot
|
||||||
os_ << "\"" << cur << "\", \""
|
os_ << "\"" << cur << "\", \""
|
||||||
<< automata_->format_state(dest) << "\", \"";
|
<< automata_->format_state(dest) << "\", \"";
|
||||||
bdd_print_formula(os_, d, si->current_condition()) << "\",";
|
bdd_print_formula(os_, d, si->current_condition()) << "\",";
|
||||||
bdd_print_acc(os_, d, si->current_accepting_conditions());
|
bdd_print_acc(os_, d, si->current_acceptance_conditions());
|
||||||
os_ << ";" << std::endl;
|
os_ << ";" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,9 @@ typedef std::pair<bool, spot::ltl::formula*> pair;
|
||||||
%token ACC_DEF
|
%token ACC_DEF
|
||||||
|
|
||||||
%%
|
%%
|
||||||
tgba: accepting_decl lines | lines;
|
tgba: acceptance_decl lines | lines;
|
||||||
|
|
||||||
accepting_decl: ACC_DEF acc_decl ';'
|
acceptance_decl: ACC_DEF acc_decl ';'
|
||||||
|
|
||||||
/* At least one line. */
|
/* At least one line. */
|
||||||
lines: line
|
lines: line
|
||||||
|
|
@ -85,7 +85,7 @@ line: strident ',' strident ',' cond_list ',' acc_list ';'
|
||||||
result->add_condition(t, i->second);
|
result->add_condition(t, i->second);
|
||||||
std::list<formula*>::iterator i2;
|
std::list<formula*>::iterator i2;
|
||||||
for (i2 = $7->begin(); i2 != $7->end(); ++i2)
|
for (i2 = $7->begin(); i2 != $7->end(); ++i2)
|
||||||
result->add_accepting_condition(t, *i2);
|
result->add_acceptance_condition(t, *i2);
|
||||||
delete $1;
|
delete $1;
|
||||||
delete $3;
|
delete $3;
|
||||||
delete $5;
|
delete $5;
|
||||||
|
|
@ -152,10 +152,10 @@ acc_list:
|
||||||
else if (*$2 != "" && *$2 != "false")
|
else if (*$2 != "" && *$2 != "false")
|
||||||
{
|
{
|
||||||
formula* f = parse_environment.require(*$2);
|
formula* f = parse_environment.require(*$2);
|
||||||
if (! result->has_accepting_condition(f))
|
if (! result->has_acceptance_condition(f))
|
||||||
{
|
{
|
||||||
error_list.push_back(spot::tgba_parse_error(@2,
|
error_list.push_back(spot::tgba_parse_error(@2,
|
||||||
"undeclared accepting condition"));
|
"undeclared acceptance condition"));
|
||||||
destroy(f);
|
destroy(f);
|
||||||
delete $2;
|
delete $2;
|
||||||
YYERROR;
|
YYERROR;
|
||||||
|
|
@ -172,7 +172,7 @@ acc_decl:
|
||||||
| acc_decl strident
|
| acc_decl strident
|
||||||
{
|
{
|
||||||
formula* f = parse_environment.require(*$2);
|
formula* f = parse_environment.require(*$2);
|
||||||
result->declare_accepting_condition(f);
|
result->declare_acceptance_condition(f);
|
||||||
delete $2;
|
delete $2;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,12 @@ main()
|
||||||
a->add_condition(t2, e.require("a"));
|
a->add_condition(t2, e.require("a"));
|
||||||
a->add_condition(t3, e.require("b"));
|
a->add_condition(t3, e.require("b"));
|
||||||
a->add_condition(t3, e.require("c"));
|
a->add_condition(t3, e.require("c"));
|
||||||
a->declare_accepting_condition(e.require("p"));
|
a->declare_acceptance_condition(e.require("p"));
|
||||||
a->declare_accepting_condition(e.require("q"));
|
a->declare_acceptance_condition(e.require("q"));
|
||||||
a->declare_accepting_condition(e.require("r"));
|
a->declare_acceptance_condition(e.require("r"));
|
||||||
a->add_accepting_condition(t1, e.require("p"));
|
a->add_acceptance_condition(t1, e.require("p"));
|
||||||
a->add_accepting_condition(t1, e.require("q"));
|
a->add_acceptance_condition(t1, e.require("q"));
|
||||||
a->add_accepting_condition(t2, e.require("r"));
|
a->add_acceptance_condition(t2, e.require("r"));
|
||||||
|
|
||||||
spot::dotty_reachable(std::cout, a);
|
spot::dotty_reachable(std::cout, a);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ syntax(char* prog)
|
||||||
<< " "<< prog << " -X [OPTIONS...] file" << std::endl
|
<< " "<< prog << " -X [OPTIONS...] file" << std::endl
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "Options:" << std::endl
|
<< "Options:" << std::endl
|
||||||
<< " -a display the accepting_conditions BDD, not the "
|
<< " -a display the acceptance_conditions BDD, not the "
|
||||||
<< "reachability graph"
|
<< "reachability graph"
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< " -A same as -a, but as a set" << std::endl
|
<< " -A same as -a, but as a set" << std::endl
|
||||||
|
|
@ -262,7 +262,7 @@ main(int argc, char** argv)
|
||||||
if (concrete)
|
if (concrete)
|
||||||
spot::bdd_print_dot(std::cout, concrete->get_dict(),
|
spot::bdd_print_dot(std::cout, concrete->get_dict(),
|
||||||
concrete->
|
concrete->
|
||||||
get_core_data().accepting_conditions);
|
get_core_data().acceptance_conditions);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (concrete)
|
if (concrete)
|
||||||
|
|
@ -273,7 +273,7 @@ main(int argc, char** argv)
|
||||||
if (concrete)
|
if (concrete)
|
||||||
spot::bdd_print_set(std::cout, concrete->get_dict(),
|
spot::bdd_print_set(std::cout, concrete->get_dict(),
|
||||||
concrete->
|
concrete->
|
||||||
get_core_data().accepting_conditions);
|
get_core_data().acceptance_conditions);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
a->get_dict()->dump(std::cout);
|
a->get_dict()->dump(std::cout);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ def usage(prog):
|
||||||
print "Usage: ", prog, """ [OPTIONS...] formula
|
print "Usage: ", prog, """ [OPTIONS...] formula
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-a display the accepting_conditions BDD, not the reachability graph
|
-a display the acceptance_conditions BDD, not the reachability graph
|
||||||
-A same as -a, but as a set
|
-A same as -a, but as a set
|
||||||
-d turn on traces during parsing
|
-d turn on traces during parsing
|
||||||
-D degeneralize the automaton
|
-D degeneralize the automaton
|
||||||
|
|
@ -115,7 +115,7 @@ if f:
|
||||||
elif output == 2:
|
elif output == 2:
|
||||||
if concrete:
|
if concrete:
|
||||||
spot.bdd_print_dot(cout, concrete.get_dict(),
|
spot.bdd_print_dot(cout, concrete.get_dict(),
|
||||||
concrete.get_core_data().accepting_conditions)
|
concrete.get_core_data().acceptance_conditions)
|
||||||
elif output == 3:
|
elif output == 3:
|
||||||
if concrete:
|
if concrete:
|
||||||
spot.bdd_print_set(cout, concrete.get_dict(),
|
spot.bdd_print_set(cout, concrete.get_dict(),
|
||||||
|
|
@ -124,7 +124,7 @@ if f:
|
||||||
elif output == 4:
|
elif output == 4:
|
||||||
if concrete:
|
if concrete:
|
||||||
spot.bdd_print_set(cout, concrete.get_dict(),
|
spot.bdd_print_set(cout, concrete.get_dict(),
|
||||||
concrete.get_core_data().accepting_conditions)
|
concrete.get_core_data().acceptance_conditions)
|
||||||
print
|
print
|
||||||
elif output == 5:
|
elif output == 5:
|
||||||
a.get_dict().dump(cout)
|
a.get_dict().dump(cout)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue