Clean the usage of spot::acc_cond::mark_t
spot::acc_cond::mark_t is implemented as a bit vector using a single unsigned, and implicit conversions between mark_t and unsigned may be confusing. We try to use the proper interface. * bin/autfilt.cc, bin/ltlsynt.cc, spot/kripke/kripke.cc, spot/misc/game.hh, spot/parseaut/parseaut.yy, spot/priv/accmap.hh, spot/ta/ta.cc, spot/ta/taexplicit.cc, spot/ta/taproduct.cc, spot/taalgos/emptinessta.cc, spot/taalgos/tgba2ta.cc, spot/twa/acc.cc, spot/twa/acc.hh, spot/twa/taatgba.cc, spot/twa/taatgba.hh, spot/twa/twagraph.hh, spot/twaalgos/alternation.cc, spot/twaalgos/cleanacc.cc, spot/twaalgos/cobuchi.cc, spot/twaalgos/complete.cc, spot/twaalgos/couvreurnew.cc, spot/twaalgos/degen.cc, spot/twaalgos/dot.cc, spot/twaalgos/dtwasat.cc, spot/twaalgos/dualize.cc, spot/twaalgos/emptiness.cc, spot/twaalgos/gtec/ce.cc, spot/twaalgos/gtec/gtec.cc, spot/twaalgos/gtec/sccstack.cc, spot/twaalgos/gv04.cc, spot/twaalgos/hoa.cc, spot/twaalgos/lbtt.cc, spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/magic.cc, spot/twaalgos/ndfs_result.hxx, spot/twaalgos/rabin2parity.cc, spot/twaalgos/randomgraph.cc, spot/twaalgos/remfin.cc, spot/twaalgos/sbacc.cc, spot/twaalgos/sccfilter.cc, spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh, spot/twaalgos/se05.cc, spot/twaalgos/sepsets.cc, spot/twaalgos/simulation.cc, spot/twaalgos/strength.cc, spot/twaalgos/stripacc.cc, spot/twaalgos/stutter.cc, spot/twaalgos/sum.cc, spot/twaalgos/tau03.cc, spot/twaalgos/tau03opt.cc, spot/twaalgos/totgba.cc, spot/twaalgos/toweak.cc, python/spot/impl.i, tests/core/acc.cc, tests/core/twagraph.cc: do not confuse mark_t and unsigned * tests/python/acc_cond.ipynb: warn about possible change of the API
This commit is contained in:
parent
cfcc18e680
commit
b09c293f1a
57 changed files with 333 additions and 308 deletions
|
|
@ -64,7 +64,7 @@ int main()
|
|||
auto m2 = spot::acc_cond::mark_t({0, 3});
|
||||
auto m3 = spot::acc_cond::mark_t({2, 1});
|
||||
|
||||
spot::acc_cond::mark_t m0 = 0U;
|
||||
spot::acc_cond::mark_t m0 = {};
|
||||
std::cout << m0.max_set() << ' ' << m0.min_set() << '\n';
|
||||
std::cout << m3.max_set() << ' ' << m3.min_set() << '\n';
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ int main()
|
|||
// {1}
|
||||
// {2, 3}
|
||||
std::cout << code3 << ' ' << "{0} true\n";
|
||||
spot::acc_cond::mark_t m = 0U;
|
||||
spot::acc_cond::mark_t m = {};
|
||||
m.set(0);
|
||||
print(code3.missing(m, true));
|
||||
std::cout << code3 << ' ' << "{0} false\n";
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ static void f1()
|
|||
auto s1 = tg->new_state();
|
||||
auto s2 = tg->new_state();
|
||||
auto s3 = tg->new_state();
|
||||
tg->new_edge(s1, s1, bddfalse, 0U);
|
||||
tg->new_edge(s1, s2, p1, 0U);
|
||||
tg->new_edge(s1, s1, bddfalse, {});
|
||||
tg->new_edge(s1, s2, p1, {});
|
||||
tg->new_edge(s1, s3, p2, tg->acc().mark(1));
|
||||
tg->new_edge(s2, s3, p1 & p2, tg->acc().mark(0));
|
||||
tg->new_edge(s3, s1, p1 | p2, spot::acc_cond::mark_t({0, 1}));
|
||||
tg->new_edge(s3, s2, p1 >> p2, 0U);
|
||||
tg->new_edge(s3, s2, p1 >> p2, {});
|
||||
tg->new_edge(s3, s3, bddtrue, spot::acc_cond::mark_t({0, 1}));
|
||||
|
||||
spot::print_dot(std::cout, tg);
|
||||
|
|
@ -66,7 +66,7 @@ static void f1()
|
|||
|
||||
spot::acc_cond::mark_t all({0, 1});
|
||||
tg->new_edge(s3, s1, p1 | p2, all);
|
||||
tg->new_edge(s3, s2, p1 >> p2, 0U);
|
||||
tg->new_edge(s3, s2, p1 >> p2, {});
|
||||
tg->new_edge(s3, s1, bddtrue, all);
|
||||
|
||||
std::cerr << tg->num_edges() << '\n';
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Internally, the `mark_t` stores the bit-vector as an integer. This also implies that we currently do not support more than 32 acceptance sets. The underlaying integer can be retrieved using `.id`."
|
||||
"Internally, the `mark_t` stores the bit-vector as an integer. This implies that we currently do not support more than 32 acceptance sets. The underlying integer can be retrieved using `.id`. Note that this implementation may evolve in the future, so relying on it is not recommended."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -281,7 +281,9 @@
|
|||
"source": [
|
||||
"`mark_t` can also be initialized using an integer: in that case the integer is interpreted as a bit vector.\n",
|
||||
"\n",
|
||||
"A frequent error is to use `mark_t(n)` when we really mean `mark_t([n])` or `mark_t((n,))`."
|
||||
"A frequent error is to use `mark_t(n)` when we really mean `mark_t([n])` or `mark_t((n,))`.\n",
|
||||
"\n",
|
||||
"As the underlying implementation of `mark_t` may change in the future, it is not recommended to rely on this interface."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -313,7 +315,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The different sets can be iterated over with the `sets()` method, that returns a tuble with the index of all bits set."
|
||||
"The different sets can be iterated over with the `sets()` method, that returns a tuple with the index of all bits set."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue