* 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:
Alexandre Duret-Lutz 2003-11-28 16:34:42 +00:00
parent 334ae6e757
commit e341cc9ab6
37 changed files with 312 additions and 272 deletions

View file

@ -102,11 +102,11 @@ namespace spot
}
int
bdd_dict::register_accepting_variable(const ltl::formula* f,
bdd_dict::register_acceptance_variable(const ltl::formula* f,
const void* for_me)
{
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);
if (sii != acc_map.end())
{
@ -124,7 +124,7 @@ namespace spot
}
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)
return;
@ -133,8 +133,8 @@ namespace spot
assert(i != acc_formula_map.end());
var_refs[i->first].insert(for_me);
register_accepting_variables(bdd_high(f), for_me);
register_accepting_variables(bdd_low(f), for_me);
register_acceptance_variables(bdd_high(f), for_me);
register_acceptance_variables(bdd_low(f), for_me);
}
@ -231,7 +231,7 @@ namespace spot
}
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)
{
fv_map::iterator fi = acc_map.find(f);

View file

@ -51,8 +51,8 @@ namespace spot
vf_map now_formula_map; ///< Maps "Now" BDD variables to formulae
fv_map var_map; ///< Maps atomic propositions to BDD variables
vf_map var_formula_map; ///< Maps BDD variables to atomic propositions
fv_map acc_map; ///< Maps accepting conditions to BDD variables
vf_map acc_formula_map; ///< Maps BDD variables to accepting conditions
fv_map acc_map; ///< Maps acceptance conditions to BDD variables
vf_map acc_formula_map; ///< Maps BDD variables to acceptance conditions
/// \brief Map Next variables to Now variables.
///
@ -100,23 +100,23 @@ namespace spot
/// \brief Register an atomic proposition.
///
/// 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,
/// this is used for reference counting. It is perfectly safe to
/// call this function several time with the same arguments.
///
/// \return The variable number. Use bdd_ithvar() or bdd_nithvar()
/// 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
/// used by \a for_me. This assumes that these accepting variables
/// Register all variables occurring in \a f as acceptance variables
/// used by \a for_me. This assumes that these acceptance variables
/// 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).
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.
///
@ -135,7 +135,7 @@ namespace spot
/// 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_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);
/// @}

View file

@ -47,7 +47,7 @@ namespace spot
/// \return The BDD formated as a string.
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.
/// \param os The output stream.
@ -57,7 +57,7 @@ namespace spot
std::ostream& bdd_print_acc(std::ostream& os,
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.
/// \param os The output stream.

View file

@ -32,7 +32,7 @@ namespace spot
/// This class provides the basic functionalities required to
/// iterate over the successors of a state, as well as querying
/// 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.
class tgba_succ_iterator
{
@ -90,9 +90,9 @@ namespace spot
///
/// This is a boolean function of atomic propositions.
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.
virtual bdd current_accepting_conditions() const = 0;
virtual bdd current_acceptance_conditions() const = 0;
//@}
};

View file

@ -70,10 +70,10 @@ namespace spot
// (a + b) & Next[a] & Next[b]
// a & b & Next[a] & !Next[b]
// 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
// accepting conditions.
// Let's label transitions with hypothetic accepting sets:
// acceptance conditions.
// Let's label transitions with hypothetic acceptance sets:
// a & b & Next[a] & Next[b] ; Acc[1]
// !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...
current_ = succ_set_left_ & dest;
// ... and compute their accepting sets.
bdd as = data_.accepting_conditions & current_;
// ... and compute their acceptance sets.
bdd as = data_.acceptance_conditions & current_;
// 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)
{
// Otherwise, we have accepting sets, and we should
// Otherwise, we have acceptance sets, and we should
// restrict current_ to a subset sharing the same
// accepting conditions.
// same accepting set.
// acceptance conditions.
// same acceptance set.
as = bdd_exist(as, data_.nownext_set);
// as = (a | (!a)&b) & (Acc[a] | Acc[b]) + (!a & Acc[b])
@ -125,7 +125,7 @@ namespace spot
// current_acc_ = (Acc[a] | Acc[b])
assert(current_acc_ != bddfalse);
// 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
// !p.!Acc[g].Acc[f] + p.!Acc[g].Acc[f] + p.Acc[g].!Acc[f]
// 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
// only !Acc[g].Acc[f].
// 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 as_fout = as - fout;
// Then, pick the remaining term that are exactly in all
// required accepting sets.
// required acceptance sets.
bdd all = bddtrue;
bdd acc = current_acc_;
do
@ -188,7 +188,7 @@ namespace spot
}
bdd
tgba_succ_iterator_concrete::current_accepting_conditions() const
tgba_succ_iterator_concrete::current_acceptance_conditions() const
{
assert(!done());
return current_acc_;

View file

@ -35,13 +35,13 @@ namespace spot
/// \brief Build a spot::tgba_succ_iterator_concrete.
///
/// \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
/// 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.
/// 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);
virtual ~tgba_succ_iterator_concrete();
@ -53,7 +53,7 @@ namespace spot
// inspection
state_bdd* current_state() const;
bdd current_condition() const;
bdd current_accepting_conditions() const;
bdd current_acceptance_conditions() const;
private:
const tgba_bdd_core_data& data_; ///< Core data of the automaton.

View file

@ -37,7 +37,7 @@ namespace spot
///
/// TGBAs are transition-based, meanings their labels are put
/// 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
/// at least one transition of each set infinitely often.
///
@ -153,7 +153,7 @@ namespace spot
/// deleted by the caller.
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.
///
/// 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 the acceptiong conditions of all transition in
/// 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.
///
/// 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 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.
virtual bdd neg_accepting_conditions() const = 0;
virtual bdd neg_acceptance_conditions() const = 0;
protected:
/// Do the actual computation of tgba::support_conditions().

View file

@ -147,13 +147,13 @@ namespace spot
}
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
tgba_bdd_concrete::neg_accepting_conditions() const
tgba_bdd_concrete::neg_acceptance_conditions() const
{
return data_.negacc_set;
}

View file

@ -76,8 +76,8 @@ namespace spot
/// rules, etc.
const tgba_bdd_core_data& get_core_data() const;
virtual bdd all_accepting_conditions() const;
virtual bdd neg_accepting_conditions() const;
virtual bdd all_acceptance_conditions() const;
virtual bdd neg_acceptance_conditions() const;
protected:
virtual bdd compute_support_conditions(const state* state) const;

View file

@ -58,7 +58,7 @@ namespace spot
}
void
tgba_bdd_concrete_factory::declare_accepting_condition(bdd b,
tgba_bdd_concrete_factory::declare_acceptance_condition(bdd b,
const ltl::formula* a)
{
// Maintain a conjunction of BDDs associated to A. We will latter
@ -82,27 +82,27 @@ namespace spot
acc_map_::iterator ai;
for (ai = acc_.begin(); ai != acc_.end(); ++ai)
{
// Register a BDD variable for this accepting condition.
int num = get_dict()->register_accepting_variable(ai->first, this);
// Keep track of all accepting conditions for easy
// Register a BDD variable for this acceptance condition.
int num = get_dict()->register_acceptance_variable(ai->first, this);
// Keep track of all acceptance conditions for easy
// existential quantification.
data_.declare_accepting_condition(bdd_ithvar(num));
data_.declare_acceptance_condition(bdd_ithvar(num));
}
for (ai = acc_.begin(); ai != acc_.end(); ++ai)
{
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);
// Any state matching the BDD formulae registered is part
// of this accepting set.
data_.accepting_conditions |= ai->second & acc;
// of this acceptance set.
data_.acceptance_conditions |= ai->second & acc;
// Keep track of all accepting conditions, so that we can
// easily check whether a transition satisfies all accepting
// Keep track of all acceptance conditions, so that we can
// easily check whether a transition satisfies all acceptance
// conditions.
data_.all_accepting_conditions |= acc;
data_.all_acceptance_conditions |= acc;
}
// Any constraint between Now variables also exist between Next

View file

@ -56,18 +56,18 @@ namespace spot
/// can be turned into BDD using ithvar().
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
/// that 'g' will be fulfilled eventually. So once
/// one of this formula has been translated into a BDD,
/// we use declare_accepting_condition() to associate
/// all other states to the accepting set of 'g'.
/// we use declare_acceptance_condition() to associate
/// all other states to the acceptance set of 'g'.
///
/// \param b a BDD indicating which variables are in the
/// accepting set
/// acceptance set
/// \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;
bdd_dict* get_dict() const;
@ -78,7 +78,7 @@ namespace spot
/// \brief Perfom final computations before the relation can be used.
///
/// 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().
void finish();
@ -87,7 +87,7 @@ namespace spot
typedef Sgi::hash_map<const ltl::formula*, bdd,
ptr_hash<ltl::formula> > acc_map_;
acc_map_ acc_; ///< BDD associated to each accepting condition
acc_map_ acc_; ///< BDD associated to each acceptance condition
};
}

View file

@ -26,8 +26,8 @@ namespace spot
{
tgba_bdd_core_data::tgba_bdd_core_data(bdd_dict* dict)
: relation(bddtrue),
accepting_conditions(bddfalse),
all_accepting_conditions(bddfalse),
acceptance_conditions(bddfalse),
all_acceptance_conditions(bddfalse),
now_set(bddtrue),
next_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)
: relation(copy.relation),
accepting_conditions(copy.accepting_conditions),
all_accepting_conditions(copy.all_accepting_conditions),
acceptance_conditions(copy.acceptance_conditions),
all_acceptance_conditions(copy.all_acceptance_conditions),
now_set(copy.now_set),
next_set(copy.next_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,
const tgba_bdd_core_data& right)
: relation(left.relation & right.relation),
accepting_conditions(left.accepting_conditions
| right.accepting_conditions),
all_accepting_conditions(left.all_accepting_conditions
| right.all_accepting_conditions),
acceptance_conditions(left.acceptance_conditions
| right.acceptance_conditions),
all_acceptance_conditions(left.all_acceptance_conditions
| right.all_acceptance_conditions),
now_set(left.now_set & right.now_set),
next_set(left.next_set & right.next_set),
nownext_set(left.nownext_set & right.nownext_set),
@ -122,7 +122,7 @@ namespace spot
}
void
tgba_bdd_core_data::declare_accepting_condition(bdd acc)
tgba_bdd_core_data::declare_acceptance_condition(bdd acc)
{
notnow_set &= acc;
notnext_set &= acc;

View file

@ -39,21 +39,21 @@ namespace spot
/// to the next state
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
/// 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
/// 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>.)
///
/// The spot::succ_iter::current_accepting_conditions() method
/// will return the \c Acc[x] variables of the accepting sets
/// The spot::succ_iter::current_acceptance_conditions() method
/// will return the \c Acc[x] variables of the acceptance sets
/// 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>
/// 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
@ -66,22 +66,22 @@ namespace spot
/// check for `b' and have a destination of the form <tt>a U 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:
/// \li "Next" variables, that encode the destination state,
/// \li atomic propositions, which are things to verify before going on
/// to the next state,
/// \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
/// a strongly connected component walks through each
/// of these acceptiong conditions. I.e., the union
/// of the acceptiong conditions of all transition in
/// 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.
bdd now_set;
@ -105,12 +105,12 @@ namespace spot
/// and atomic propositions.
bdd varandnext_set;
/// \brief The (positive) conjunction of all variables which are
/// accepting conditions.
/// acceptance conditions.
bdd acc_set;
/// \brief The (positive) conjunction of all variables which are not
/// accepting conditions.
/// acceptance conditions.
bdd notacc_set;
/// \brief The negative conjunction of all variables which are accepting
/// \brief The negative conjunction of all variables which are acceptance
/// conditions.
bdd negacc_set;
@ -139,9 +139,9 @@ namespace spot
/// \brief Update the variable sets to take a new automic proposition into
/// account.
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.
void declare_accepting_condition(bdd prom);
void declare_acceptance_condition(bdd prom);
};
}

View file

@ -34,7 +34,7 @@ namespace spot
tgba_explicit_succ_iterator::tgba_explicit_succ_iterator
(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
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)
: dict_(dict), init_(0), all_accepting_conditions_(bddfalse),
neg_accepting_conditions_(bddtrue),
all_accepting_conditions_computed_(false)
: dict_(dict), init_(0), all_acceptance_conditions_(bddfalse),
neg_acceptance_conditions_(bddtrue),
all_acceptance_conditions_computed_(false)
{
}
@ -166,7 +166,7 @@ namespace spot
transition* t = new transition;
t->dest = d;
t->condition = bddtrue;
t->accepting_conditions = bddfalse;
t->acceptance_conditions = bddfalse;
s->push_back(t);
return t;
}
@ -201,12 +201,12 @@ namespace spot
}
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);
bdd neg = bdd_nithvar(v);
neg_accepting_conditions_ &= neg;
neg_acceptance_conditions_ &= neg;
// Append neg to all acceptance conditions.
ns_map::iterator i;
@ -214,35 +214,35 @@ namespace spot
{
tgba_explicit::state::iterator 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
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;
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
{
tgba_explicit::state::iterator 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
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
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);
if (c)
@ -258,34 +258,34 @@ namespace spot
assert(0);
}
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,
things are badly broken. This has already happened. */
assert(i != dict_->acc_map.end());
ltl::destroy(f);
bdd v = bdd_ithvar(i->second);
v &= bdd_exist(neg_accepting_conditions_, v);
v &= bdd_exist(neg_acceptance_conditions_, v);
return v;
}
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);
t->accepting_conditions |= c;
bdd c = get_acceptance_condition(f);
t->acceptance_conditions |= c;
}
void
tgba_explicit::add_accepting_conditions(transition* t, bdd f)
tgba_explicit::add_acceptance_conditions(transition* t, bdd f)
{
bdd sup = bdd_support(f);
dict_->register_accepting_variables(sup, this);
dict_->register_acceptance_variables(sup, this);
while (sup != bddtrue)
{
neg_accepting_conditions_ &= bdd_nithvar(bdd_var(sup));
neg_acceptance_conditions_ &= bdd_nithvar(bdd_var(sup));
sup = bdd_high(sup);
}
t->accepting_conditions |= f;
t->acceptance_conditions |= f;
}
state*
@ -307,7 +307,7 @@ namespace spot
(void) global_state;
(void) global_automaton;
return new tgba_explicit_succ_iterator(s->get_state(),
all_accepting_conditions());
all_acceptance_conditions());
}
bdd
@ -355,38 +355,38 @@ namespace spot
}
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;
// Build all_accepting_conditions_ from neg_accepting_conditions_
// Build all_acceptance_conditions_ from neg_acceptance_conditions_
// I.e., transform !A & !B & !C into
// A & !B & !C
// + !A & B & !C
// + !A & !B & C
bdd cur = neg_accepting_conditions_;
bdd cur = neg_acceptance_conditions_;
while (cur != bddtrue)
{
assert(cur != bddfalse);
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);
cur = bdd_low(cur);
}
all_accepting_conditions_ = all;
all_accepting_conditions_computed_ = true;
all_acceptance_conditions_ = all;
all_acceptance_conditions_computed_ = true;
}
return all_accepting_conditions_;
return all_acceptance_conditions_;
}
bdd
tgba_explicit::neg_accepting_conditions() const
tgba_explicit::neg_acceptance_conditions() const
{
return neg_accepting_conditions_;
return neg_acceptance_conditions_;
}
}

View file

@ -46,7 +46,7 @@ namespace spot
struct transition
{
bdd condition;
bdd accepting_conditions;
bdd acceptance_conditions;
state* dest;
};
@ -59,12 +59,12 @@ namespace spot
void add_neg_condition(transition* t, const ltl::formula* f);
/// This assumes that all variables in \a f are known from dict.
void add_conditions(transition* t, bdd f);
void declare_accepting_condition(const ltl::formula* f);
bool has_accepting_condition(const ltl::formula* f) const;
void add_accepting_condition(transition* t, const ltl::formula* f);
/// This assumes that all accepting conditions in \a f are known from dict.
void add_accepting_conditions(transition* t, bdd f);
void complement_all_accepting_conditions();
void declare_acceptance_condition(const ltl::formula* f);
bool has_acceptance_condition(const ltl::formula* f) const;
void add_acceptance_condition(transition* t, const ltl::formula* f);
/// This assumes that all acceptance conditions in \a f are known from dict.
void add_acceptance_conditions(transition* t, bdd f);
void complement_all_acceptance_conditions();
// tgba interface
virtual ~tgba_explicit();
@ -76,8 +76,8 @@ namespace spot
virtual bdd_dict* get_dict() const;
virtual std::string format_state(const spot::state* state) const;
virtual bdd all_accepting_conditions() const;
virtual bdd neg_accepting_conditions() const;
virtual bdd all_acceptance_conditions() const;
virtual bdd neg_acceptance_conditions() const;
protected:
virtual bdd compute_support_conditions(const spot::state* state) const;
@ -85,7 +85,7 @@ namespace spot
state* add_state(const std::string& name);
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*,
string_hash> ns_map;
@ -95,9 +95,9 @@ namespace spot
sn_map state_name_map_;
bdd_dict* dict_;
tgba_explicit::state* init_;
mutable bdd all_accepting_conditions_;
bdd neg_accepting_conditions_;
mutable bool all_accepting_conditions_computed_;
mutable bdd all_acceptance_conditions_;
bdd neg_acceptance_conditions_;
mutable bool all_acceptance_conditions_computed_;
private:
// Disallow copy.
@ -146,12 +146,12 @@ namespace spot
virtual state_explicit* current_state() const;
virtual bdd current_condition() const;
virtual bdd current_accepting_conditions() const;
virtual bdd current_acceptance_conditions() const;
private:
const tgba_explicit::state* s_;
tgba_explicit::state::const_iterator i_;
bdd all_accepting_conditions_;
bdd all_acceptance_conditions_;
};
}

View file

@ -162,10 +162,10 @@ namespace spot
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_)
| (right_->current_accepting_conditions() & left_neg_));
return ((left_->current_acceptance_conditions() & right_neg_)
| (right_->current_acceptance_conditions() & left_neg_));
}
////////////////////////////////////////////////////////////
@ -176,16 +176,16 @@ namespace spot
{
assert(dict_ == right->get_dict());
bdd lna = left_->neg_accepting_conditions();
bdd rna = right_->neg_accepting_conditions();
bdd lna = left_->neg_acceptance_conditions();
bdd rna = right_->neg_acceptance_conditions();
left_acc_complement_ = bdd_exist(lna, bdd_support(rna));
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_->all_accepting_conditions()
| (right_->all_acceptance_conditions()
& 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(&right_, this);
@ -279,15 +279,15 @@ namespace spot
}
bdd
tgba_product::all_accepting_conditions() const
tgba_product::all_acceptance_conditions() const
{
return all_accepting_conditions_;
return all_acceptance_conditions_;
}
bdd
tgba_product::neg_accepting_conditions() const
tgba_product::neg_acceptance_conditions() const
{
return neg_accepting_conditions_;
return neg_acceptance_conditions_;
}
}

View file

@ -91,7 +91,7 @@ namespace spot
// inspection
state_product* current_state() const;
bdd current_condition() const;
bdd current_accepting_conditions() const;
bdd current_acceptance_conditions() const;
private:
//@{
@ -133,8 +133,8 @@ namespace spot
virtual state* project_state(const state* s, const tgba* t) const;
virtual bdd all_accepting_conditions() const;
virtual bdd neg_accepting_conditions() const;
virtual bdd all_acceptance_conditions() const;
virtual bdd neg_acceptance_conditions() const;
protected:
virtual bdd compute_support_conditions(const state* state) const;
@ -146,8 +146,8 @@ namespace spot
const tgba* right_;
bdd left_acc_complement_;
bdd right_acc_complement_;
bdd all_accepting_conditions_;
bdd neg_accepting_conditions_;
bdd all_acceptance_conditions_;
bdd neg_acceptance_conditions_;
// Disallow copy.
tgba_product(const tgba_product&);
tgba_product& tgba_product::operator=(const tgba_product&);

View file

@ -30,7 +30,7 @@ namespace spot
/// \brief A state for spot::tgba_tba_proxy.
///
/// 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).
class state_tba_proxy : public state
{
@ -44,7 +44,7 @@ namespace spot
state_tba_proxy(const state_tba_proxy& o)
: state(),
s_(o.real_state()->clone()),
acc_(o.accepting_cond())
acc_(o.acceptance_cond())
{
}
@ -61,7 +61,7 @@ namespace spot
}
bdd
accepting_cond() const
acceptance_cond() const
{
return acc_;
}
@ -74,14 +74,14 @@ namespace spot
int res = s_->compare(o->real_state());
if (res != 0)
return res;
return acc_.id() - o->accepting_cond().id();
return acc_.id() - o->acceptance_cond().id();
}
virtual size_t
hash() const
{
// We expect to have many more state than accepting conditions.
// Hence we keep only 8 bits for accepting conditions.
// We expect to have many more state than acceptance conditions.
// Hence we keep only 8 bits for acceptance conditions.
return (s_->hash() << 8) + (acc_.id() & 0xFF);
}
@ -103,9 +103,9 @@ namespace spot
public:
tgba_tba_proxy_succ_iterator(tgba_succ_iterator* it,
bdd acc, bdd next_acc,
bdd the_accepting_cond)
bdd the_acceptance_cond)
: 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();
bdd acc;
// Transition in the ACC_ accepting set should be directed
// to the NEXT_ACC_ accepting set.
// Transition in the ACC_ acceptance set should be directed
// to the NEXT_ACC_ acceptance set.
if (acc_ == bddtrue
|| (acc_ & it_->current_accepting_conditions()) == acc_)
|| (acc_ & it_->current_acceptance_conditions()) == acc_)
acc = next_acc_;
else
acc = acc_;
@ -159,31 +159,31 @@ namespace spot
}
bdd
current_accepting_conditions() const
current_acceptance_conditions() const
{
return the_accepting_cond_;
return the_acceptance_cond_;
}
protected:
tgba_succ_iterator* it_;
bdd acc_;
bdd next_acc_;
bdd the_accepting_cond_;
bdd the_acceptance_cond_;
};
tgba_tba_proxy::tgba_tba_proxy(const tgba* 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].
int v = get_dict()
->register_accepting_variable(ltl::constant::true_instance(), this);
the_accepting_cond_ = bdd_ithvar(v);
->register_acceptance_variable(ltl::constant::true_instance(), this);
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);
all -= last;
@ -225,13 +225,13 @@ namespace spot
tgba_succ_iterator* it = a_->succ_iter(s->real_state(),
global_state, global_automaton);
bdd acc = s->accepting_cond();
bdd acc = s->acceptance_cond();
cycle_map::const_iterator i = acc_cycle_.find(acc);
assert(i != acc_cycle_.end());
return
new tgba_tba_proxy_succ_iterator(it, acc, i->second,
(acc == bddtrue)
? the_accepting_cond_ : bddfalse);
? the_acceptance_cond_ : bddfalse);
}
bdd_dict*
@ -246,7 +246,7 @@ namespace spot
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()) + ")";
+ bdd_format_set(get_dict(), s->acceptance_cond()) + ")";
}
state*
@ -261,15 +261,15 @@ namespace spot
bdd
tgba_tba_proxy::all_accepting_conditions() const
tgba_tba_proxy::all_acceptance_conditions() const
{
return the_accepting_cond_;
return the_acceptance_cond_;
}
bdd
tgba_tba_proxy::neg_accepting_conditions() const
tgba_tba_proxy::neg_acceptance_conditions() const
{
return !the_accepting_cond_;
return !the_acceptance_cond_;
}
bool
@ -278,7 +278,7 @@ namespace spot
const state_tba_proxy* s =
dynamic_cast<const state_tba_proxy*>(state);
assert(s);
return bddtrue == s->accepting_cond();
return bddtrue == s->acceptance_cond();
}
bdd

View file

@ -35,14 +35,14 @@ namespace spot
/// be degeneralized on the fly.
///
/// 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
/// automaton with a "counter" automaton such as the one shown in
/// "On-the-fly Verification of Linear Temporal Logic" (Jean-Michel
/// 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
/// transitions.
class tgba_tba_proxy : public tgba
@ -65,8 +65,8 @@ namespace spot
virtual state* project_state(const state* s, const tgba* t) const;
virtual bdd all_accepting_conditions() const;
virtual bdd neg_accepting_conditions() const;
virtual bdd all_acceptance_conditions() const;
virtual bdd neg_acceptance_conditions() const;
bool state_is_accepting(const state* state) const;
@ -78,7 +78,7 @@ namespace spot
const tgba* a_;
typedef std::map<bdd, bdd, bdd_less_than> cycle_map;
cycle_map acc_cycle_;
bdd the_accepting_cond_;
bdd the_acceptance_cond_;
// Disallow copy.
tgba_tba_proxy(const tgba_tba_proxy&);
tgba_tba_proxy& tgba_tba_proxy::operator=(const tgba_tba_proxy&);