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:
parent
a15aac2845
commit
603c5d603b
2 changed files with 22 additions and 6 deletions
|
|
@ -56,10 +56,10 @@ namespace spot
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class tba: public tgba
|
class sba: public tgba
|
||||||
{
|
{
|
||||||
public:
|
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.
|
/// iff all outgoing transitions are accepting.
|
||||||
virtual bool is_accepting(const spot::state* s) = 0;
|
virtual bool is_accepting(const spot::state* s) = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -275,6 +275,12 @@ namespace spot
|
||||||
return it_->acceptance_conditions & all_acceptance_conditions_;
|
return it_->acceptance_conditions & all_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typename State::transitions_t::const_iterator
|
||||||
|
get_iterator() const
|
||||||
|
{
|
||||||
|
return it_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const State* start_;
|
const State* start_;
|
||||||
typename State::transitions_t::const_iterator it_;
|
typename State::transitions_t::const_iterator it_;
|
||||||
|
|
@ -291,9 +297,10 @@ namespace spot
|
||||||
typename State::label_hash_t> ls_map;
|
typename State::label_hash_t> ls_map;
|
||||||
typedef Sgi::hash_map<const State*, typename State::Label_t,
|
typedef Sgi::hash_map<const State*, typename State::Label_t,
|
||||||
ptr_hash<State> > sl_map;
|
ptr_hash<State> > sl_map;
|
||||||
typedef typename State::transition transition;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef typename State::transition transition;
|
||||||
|
|
||||||
explicit_graph(bdd_dict* dict)
|
explicit_graph(bdd_dict* dict)
|
||||||
: ls_(),
|
: ls_(),
|
||||||
sl_(),
|
sl_(),
|
||||||
|
|
@ -336,7 +343,7 @@ namespace spot
|
||||||
transition*
|
transition*
|
||||||
get_transition(const tgba_explicit_succ_iterator<State>* si)
|
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)
|
void add_condition(transition* t, const ltl::formula* f)
|
||||||
|
|
@ -537,9 +544,8 @@ namespace spot
|
||||||
template <typename State>
|
template <typename State>
|
||||||
class tgba_explicit: public explicit_graph<State, tgba>
|
class tgba_explicit: public explicit_graph<State, tgba>
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
typedef typename State::transition transition;
|
|
||||||
public:
|
public:
|
||||||
|
typedef typename State::transition transition;
|
||||||
typedef State state;
|
typedef State state;
|
||||||
|
|
||||||
tgba_explicit(bdd_dict* dict):
|
tgba_explicit(bdd_dict* dict):
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,16 @@ using namespace spot;
|
||||||
%include "tgba/tgbaproduct.hh"
|
%include "tgba/tgbaproduct.hh"
|
||||||
%include "tgba/tgbatba.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/dottydec.hh"
|
||||||
%include "tgbaalgos/dotty.hh"
|
%include "tgbaalgos/dotty.hh"
|
||||||
%include "tgbaalgos/dupexp.hh"
|
%include "tgbaalgos/dupexp.hh"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue