tgba_explicit: make the new class work with Swig.

* src/tgba/tgbaexplicit.hh (explicit_graph, tgba_explicit): Make the
transition type explicit.
(state_explicit_string::get_iterator): New method.
(explicit_graph::get_transition): Use it.
(tba): Rename as ...
(sba): ... this.
* wrap/python/spot.i: Instanciate explicit_graph and tgba_explicit
for all three types.
This commit is contained in:
Alexandre Duret-Lutz 2012-03-31 17:25:53 +02:00
parent a15aac2845
commit 603c5d603b
2 changed files with 22 additions and 6 deletions

View file

@ -56,10 +56,10 @@ namespace spot
}
};
class tba: public tgba
class sba: public tgba
{
public:
/// A State in a TBA (Transition based Buchi Automaton) is accepting
/// A State in an SBA (State-based Buchi Automaton) is accepting
/// iff all outgoing transitions are accepting.
virtual bool is_accepting(const spot::state* s) = 0;
};
@ -275,6 +275,12 @@ namespace spot
return it_->acceptance_conditions & all_acceptance_conditions_;
}
typename State::transitions_t::const_iterator
get_iterator() const
{
return it_;
}
private:
const State* start_;
typename State::transitions_t::const_iterator it_;
@ -291,9 +297,10 @@ namespace spot
typename State::label_hash_t> ls_map;
typedef Sgi::hash_map<const State*, typename State::Label_t,
ptr_hash<State> > sl_map;
typedef typename State::transition transition;
public:
typedef typename State::transition transition;
explicit_graph(bdd_dict* dict)
: ls_(),
sl_(),
@ -336,7 +343,7 @@ namespace spot
transition*
get_transition(const tgba_explicit_succ_iterator<State>* si)
{
return const_cast<transition*>(&(*(si->i_)));
return const_cast<transition*>(&(*(si->get_iterator())));
}
void add_condition(transition* t, const ltl::formula* f)
@ -537,9 +544,8 @@ namespace spot
template <typename State>
class tgba_explicit: public explicit_graph<State, tgba>
{
protected:
typedef typename State::transition transition;
public:
typedef typename State::transition transition;
typedef State state;
tgba_explicit(bdd_dict* dict):

View file

@ -203,6 +203,16 @@ using namespace spot;
%include "tgba/tgbaproduct.hh"
%include "tgba/tgbatba.hh"
%template(explicit_graph__string_tgba)
spot::explicit_graph<state_explicit_string, tgba>;
%template(explicit_graph__number_tgba)
spot::explicit_graph<state_explicit_number, tgba>;
%template(explicit_graph__formula_tgba)
spot::explicit_graph<state_explicit_formula, tgba>;
%template(tgba_explicit__string) spot::tgba_explicit<state_explicit_string>;
%template(tgba_explicit__number) spot::tgba_explicit<state_explicit_number>;
%template(tgba_explicit__formula) spot::tgba_explicit<state_explicit_formula>;
%include "tgbaalgos/dottydec.hh"
%include "tgbaalgos/dotty.hh"
%include "tgbaalgos/dupexp.hh"