Commit 5bb9c87d authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

python: fix return of is_rabin_like() and is_streett_like()

* python/spot/impl.i: Fix instantiation of vector_rs_pairs.
* tests/python/setacc.py: Add test cases.
* NEWS: Mention the bugs.
parent 266581b2
Pipeline #4479 passed with stages
in 140 minutes and 18 seconds
......@@ -78,7 +78,9 @@ New in spot 2.6.3.dev (not yet released)
Bugs fixed:
- The pair of acc_cond::mark_t returned by
acc_code::used_inf_fin_sets() was not usable in Python.
acc_code::used_inf_fin_sets(), and the pair (bool,
vector_rs_pairs) by acc_cond::is_rabin_like() and
acc_cond::is_streett_like() were not usable in Python.
New in spot 2.6.3 (2018-10-17)
......
......@@ -475,7 +475,9 @@ namespace std {
%feature("flatnested") spot::acc_cond::acc_code;
%feature("flatnested") spot::acc_cond::rs_pair;
%apply bool* OUTPUT {bool& max, bool& odd};
%template(vector_rs_pair) std::vector<spot::acc_cond::rs_pair>;
namespace std {
%template(vector_rs_pair) vector<spot::acc_cond::rs_pair>;
}
%apply std::vector<spot::acc_cond::rs_pair> &OUTPUT {std::vector<spot::acc_cond::rs_pair>& pairs}
%include <spot/twa/acc.hh>
%template(pair_bool_mark) std::pair<bool, spot::acc_cond::mark_t>;
......
......@@ -36,3 +36,22 @@ assert fin == [0]
(inf, fin) = spot.acc_code("(Fin(0)|Inf(1))&Fin(2)&Inf(0)").used_inf_fin_sets()
assert inf == [0,1]
assert fin == [0,2]
# is_rabin_like() returns (bool, [(inf, fin), ...])
(b, v) = spot.acc_cond("(Fin(0)&Inf(1))|(Fin(2)&Inf(0))").is_rabin_like()
assert b == True
assert len(v) == 2
assert v[0].fin == [0]
assert v[0].inf == [1]
assert v[1].fin == [2]
assert v[1].inf == [0]
(b, v) = spot.acc_cond("(Fin(0)|Inf(1))&(Fin(2)|Inf(0))").is_rabin_like()
assert b == False
assert len(v) == 0
(b, v) = spot.acc_cond("(Fin(0)|Inf(1))&(Fin(2)|Inf(0))").is_streett_like()
assert b == True
assert len(v) == 2
assert v[0].fin == [0]
assert v[0].inf == [1]
assert v[1].fin == [2]
assert v[1].inf == [0]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment