* src/ltltest/Makefile.am (AM_CXXFLAGS): New variable.
* tgba/bdddict.hh (bdd_dict::register_propositions, bdd_dict::register_accepting_variables): New methods. * src/bdddict.cc: Likewise. * tgba/tgbaexplicit.cc (tgba_explicit::add_conditions, tgba_explicit::add_accepting_conditions): New methods. (tgba_explicit::get_init_state): Add an "empty" initial state to empty automata. * tgba/tgbaexplicit.hh: (tgba_explicit::add_conditions, tgba_explicit::add_accepting_conditions): New methods. * tgbaalgos/Makefiles.am (tgbaalgos_HEADERS, libtgbaalgos_la_SOURCES): Add dupexp.hh and dupexp.cc. * tgbaalgos/dupexp.hh, tgbaalgos/dupexp.cc: New files. * tgbatest/Makefile.am (AM_CXXFLAGS): New variable. (check_SCRIPTS): Add dupexp.test. (CLEANFILES): Add output1 and output2. * tgbatest/dupexp.test: New file. * tgbatest/ltl2tgba.cc: Handle -s and -S. * tgbatest/tgbaread.cc: Remove unused variable exit_code.
This commit is contained in:
parent
51ff9f8dda
commit
982c5efc6c
13 changed files with 271 additions and 8 deletions
|
|
@ -41,6 +41,20 @@ namespace spot
|
|||
return num;
|
||||
}
|
||||
|
||||
void
|
||||
bdd_dict::register_propositions(bdd f, const void* for_me)
|
||||
{
|
||||
if (f == bddtrue || f == bddfalse)
|
||||
return;
|
||||
|
||||
vf_map::iterator i = var_formula_map.find(bdd_var(f));
|
||||
assert(i != var_formula_map.end());
|
||||
var_refs[i->first].insert(for_me);
|
||||
|
||||
register_propositions(bdd_high(f), for_me);
|
||||
register_propositions(bdd_low(f), for_me);
|
||||
}
|
||||
|
||||
int
|
||||
bdd_dict::register_state(const ltl::formula* f, const void* for_me)
|
||||
{
|
||||
|
|
@ -88,6 +102,21 @@ namespace spot
|
|||
return num;
|
||||
}
|
||||
|
||||
void
|
||||
bdd_dict::register_accepting_variables(bdd f, const void* for_me)
|
||||
{
|
||||
if (f == bddtrue || f == bddfalse)
|
||||
return;
|
||||
|
||||
vf_map::iterator i = acc_formula_map.find(bdd_var(f));
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
bdd_dict::register_all_variables_of(const void* from_other,
|
||||
const void* for_me)
|
||||
|
|
|
|||
|
|
@ -54,6 +54,15 @@ namespace spot
|
|||
/// to convert this to a BDD.
|
||||
int register_proposition(const ltl::formula* f, const void* for_me);
|
||||
|
||||
/// \brief Register BDD variables as atomic propositions.
|
||||
///
|
||||
/// Register all variables occurring in \a f as atomic propositions
|
||||
/// used by \a for_me. This assumes that these atomic propositions
|
||||
/// are already known from the dictionary (i.e., they have already
|
||||
/// been registered by register_proposition() for another
|
||||
/// automaton).
|
||||
void register_propositions(bdd f, const void* for_me);
|
||||
|
||||
/// \brief Register a couple of Now/Next variables
|
||||
///
|
||||
/// Return (and maybe allocate) two BDD variables for a state
|
||||
|
|
@ -79,6 +88,15 @@ namespace spot
|
|||
/// to convert this to a BDD.
|
||||
int register_accepting_variable(const ltl::formula* f, const void* for_me);
|
||||
|
||||
/// \brief Register BDD variables as accepting variables.
|
||||
///
|
||||
/// Register all variables occurring in \a f as accepting variables
|
||||
/// used by \a for_me. This assumes that these accepting variables
|
||||
/// are already known from the dictionary (i.e., they have already
|
||||
/// been registered by register_accepting_variable() for another
|
||||
/// automaton).
|
||||
void register_accepting_variables(bdd f, const void* for_me);
|
||||
|
||||
/// \brief Duplicate the variable usage of another object.
|
||||
///
|
||||
/// This tells this dictionary that the \a for_me object
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ namespace spot
|
|||
|
||||
// The first state we add is the inititial state.
|
||||
// It can also be overridden with set_init_state().
|
||||
if (! init_)
|
||||
if (!init_)
|
||||
init_ = s;
|
||||
|
||||
return s;
|
||||
|
|
@ -170,6 +170,13 @@ namespace spot
|
|||
t->condition -= get_condition(f);
|
||||
}
|
||||
|
||||
void
|
||||
tgba_explicit::add_conditions(transition* t, bdd f)
|
||||
{
|
||||
dict_->register_propositions(f, this);
|
||||
t->condition &= f;
|
||||
}
|
||||
|
||||
void
|
||||
tgba_explicit::declare_accepting_condition(ltl::formula* f)
|
||||
{
|
||||
|
|
@ -245,9 +252,25 @@ namespace spot
|
|||
t->accepting_conditions |= c;
|
||||
}
|
||||
|
||||
void
|
||||
tgba_explicit::add_accepting_conditions(transition* t, bdd f)
|
||||
{
|
||||
bdd sup = bdd_support(f);
|
||||
dict_->register_accepting_variables(sup, this);
|
||||
while (sup != bddtrue)
|
||||
{
|
||||
neg_accepting_conditions_ &= bdd_nithvar(bdd_var(sup));
|
||||
sup = bdd_high(sup);
|
||||
}
|
||||
t->accepting_conditions |= f;
|
||||
}
|
||||
|
||||
state*
|
||||
tgba_explicit::get_init_state() const
|
||||
{
|
||||
// Fix empty automata by adding a lone initial state.
|
||||
if (!init_)
|
||||
const_cast<tgba_explicit*>(this)->add_state("empty");
|
||||
return new state_explicit(init_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,13 @@ namespace spot
|
|||
|
||||
void add_condition(transition* t, ltl::formula* f);
|
||||
void add_neg_condition(transition* t, 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(ltl::formula* f);
|
||||
bool has_accepting_condition(ltl::formula* f) const;
|
||||
void add_accepting_condition(transition* t, 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();
|
||||
|
||||
// tgba interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue