acc_code: parse from the constructor

* spot/twa/acc.hh, spot/twa/acc.cc (parse_acc_code): Rename as...
(acc_cond::acc_code): ... this, making it a lot easier to build
acceptance conditions from strings.
* NEWS: Mention the change.
* spot/twaalgos/dtwasat.cc, spot/bin/randaut.cc, spot/tests/acc.cc:
Adjust.
* wrap/python/tests/acc_cond.ipynb, wrap/python/tests/accparse.ipynb,
wrap/python/tests/accparse2.py: Simplify, but not completely to exercise
all variants.
* wrap/python/spot_impl.i: Make acc_code's constructor implicit.
This commit is contained in:
Alexandre Duret-Lutz 2015-12-18 17:47:16 +01:00
parent d0b29051b2
commit df1ef302e8
10 changed files with 189 additions and 133 deletions

View file

@ -17,7 +17,8 @@
"pygments_lexer": "ipython3",
"version": "3.4.3+"
},
"name": ""
"name": "",
"signature": "sha256:1ee7951bed30652ae110a14b210541829221552eb944ff01f25236179673dd5b"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -40,7 +41,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"c = spot.parse_acc_code('Inf(0)&Fin(1)|Inf(2)&Fin(3)'); c"
"c = spot.acc_code('Inf(0)&Fin(1)|Inf(2)&Fin(3)'); c"
],
"language": "python",
"metadata": {},
@ -112,7 +113,7 @@
" 'parity min even 1', 'parity max odd 1', 'parity max even 1', 'parity min odd 1',\n",
" 'parity min even 0', 'parity max odd 0', 'parity max even 0', 'parity min odd 0',\n",
" ]:\n",
" print(acc, ': ', spot.parse_acc_code(acc), sep='')"
" print(acc, ': ', spot.acc_code(acc), sep='')"
],
"language": "python",
"metadata": {},
@ -159,6 +160,15 @@
}
],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
}
],
"metadata": {}