Add the "don't care" simulation

* src/tgba/bddprint.cc, src/tgba/bddprint.hh: Add bdd_print_isop
that prints the bdd into a Irreductible Sum Of Product.
* src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh: Add a way to
know which states (in the input) is which (in the result).
* src/tgbaalgos/simulation.cc, src/tgbaalgos/simulation.hh: Add
the Don't Care Simulation and the Don't Care Iterated Simulation.
* src/tgbatest/ltl2tgba.cc, src/tgbatest/spotlbtt.test,
src/tgbatest/Makefile.am, src/tgbatest/sim.test: Test them.
* bench/ltl2tgba/algorithms, bench/ltl2tgba/README,
bench/ltl2tgba/algorithms: Add a way to bench the don't care
simulation.
This commit is contained in:
Thomas Badie 2012-09-27 16:45:40 +02:00 committed by Alexandre Duret-Lutz
parent 5796114e37
commit 08c77318ae
12 changed files with 1171 additions and 76 deletions

View file

@ -56,10 +56,31 @@ namespace spot
out_->add_acceptance_conditions(t, si->current_acceptance_conditions());
}
private:
protected:
tgba_explicit_number* out_;
};
template <typename T>
class dupexp_iter_save: public dupexp_iter<T>
{
public:
dupexp_iter_save(const tgba* a,
std::map<const state*,
const state*,
state_ptr_less_than>& relation)
: dupexp_iter<T>(a),
relation_(relation)
{
}
void process_state(const state* s, int n, tgba_succ_iterator*)
{
relation_[this->out_->add_state(n)] = const_cast<state*>(s);
}
std::map<const state*, const state*, state_ptr_less_than>& relation_;
};
} // anonymous
tgba_explicit_number*
@ -78,4 +99,25 @@ namespace spot
return di.result();
}
tgba_explicit_number*
tgba_dupexp_bfs(const tgba* aut,
std::map<const state*,
const state*, state_ptr_less_than>& rel)
{
dupexp_iter_save<tgba_reachable_iterator_breadth_first> di(aut,
rel);
di.run();
return di.result();
}
tgba_explicit_number*
tgba_dupexp_dfs(const tgba* aut,
std::map<const state*,
const state*, state_ptr_less_than>& rel)
{
dupexp_iter_save<tgba_reachable_iterator_depth_first> di(aut,
rel);
di.run();
return di.result();
}
}

View file

@ -35,6 +35,21 @@ namespace spot
/// numbering states in depth first order as they are processed.
/// \ingroup tgba_misc
tgba_explicit_number* tgba_dupexp_dfs(const tgba* aut);
/// \brief Build an explicit automata from all states of \a aut,
/// numbering states in bread first order as they are processed.
/// \ingroup tgba_misc
tgba_explicit_number*
tgba_dupexp_bfs(const tgba* aut,
std::map<const state*, const state*,
state_ptr_less_than>& relation);
/// \brief Build an explicit automata from all states of \a aut,
/// numbering states in depth first order as they are processed.
/// \ingroup tgba_misc
tgba_explicit_number*
tgba_dupexp_dfs(const tgba* aut,
std::map<const state*, const state*,
state_ptr_less_than>& relation);
}
#endif // SPOT_TGBAALGOS_DUPEXP_HH

File diff suppressed because it is too large Load diff

View file

@ -133,6 +133,13 @@ namespace spot
/// one
tgba* iterated_simulations(const tgba* automaton);
tgba* dont_care_simulation(const tgba* t, int limit = -1);
tgba*
dont_care_iterated_simulations(const tgba* t, int limit = -1);
/// @}
} // End namespace spot.