acc_cond::mark_t now relies on bitset
This allows to represent more than 32 acceptance marks. * configure.ac: add an option to specify the number of marks * spot/twa/acc.hh: implement it * tests/python/acc_cond.ipynb, tests/core/acc.cc, tests/core/ltlcross3.test: update tests * NEWS: document it * bin/randltl.cc: fix an include
This commit is contained in:
parent
d77d046d26
commit
d7ee23ed2f
7 changed files with 51 additions and 172 deletions
|
|
@ -245,72 +245,6 @@
|
|||
"x << 2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"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."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{0,2,5}\n",
|
||||
"37\n",
|
||||
"0b100101\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(x)\n",
|
||||
"print(x.id)\n",
|
||||
"print(bin(x.id))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"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,))`.\n",
|
||||
"\n",
|
||||
"As the underlying implementation of `mark_t` may change in the future, it is not recommended to rely on this interface."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{5}\n",
|
||||
"{0,2}\n",
|
||||
"{0,2,4}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# compare\n",
|
||||
"print(spot.mark_t([5]))\n",
|
||||
"# with\n",
|
||||
"print(spot.mark_t(5))\n",
|
||||
"print(spot.mark_t(0b10101))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue