python: more conventional __repr__ for several types

* NEWS: Mention the change.
* python/spot/__init__.py: Add _repr_latex_ for twa_word, and
remove __repr__ and __str__ for atomic_prop_set.
* python/spot/impl.i: Implement __repr__ and __str__ for
atomic_prop_set.  Fix __repr__ for trival, acc_code, acc_cond,
mark_t.  Remove __repr__ for twa_run and twa_word.
* tests/python/acc_cond.ipynb, tests/python/accparse.ipynb,
tests/python/atva16-fig2a.ipynb, tests/python/automata.ipynb,
tests/python/bdditer.py, tests/python/contains.ipynb,
tests/python/gen.ipynb, tests/python/highlighting.ipynb,
tests/python/ltlsimple.py, tests/python/ltsmin-dve.ipynb,
tests/python/product.ipynb, tests/python/relabel.py,
tests/python/satmin.ipynb tests/python/stutter-inv.ipynb,
tests/python/word.ipynb: Adjust test cases.
* tests/python/formulas.ipynb: Add test for atomic_prop_set.
This commit is contained in:
Alexandre Duret-Lutz 2018-11-02 17:18:42 +01:00
parent c3b7a691e4
commit 60296317c7
19 changed files with 686 additions and 700 deletions

View file

@ -436,7 +436,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.kripke; proxy of <Swig Object of type 'std::shared_ptr< spot::kripke > *' at 0x7f306034fb70> >"
"<spot.impl.kripke; proxy of <Swig Object of type 'std::shared_ptr< spot::kripke > *' at 0x7f0f044132a0> >"
]
},
"execution_count": 9,
@ -1265,7 +1265,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f30602ddba0> >"
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0f04381d50> >"
]
},
"execution_count": 12,
@ -1453,7 +1453,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_product; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_product > *' at 0x7f306034f9c0> >"
"<spot.impl.twa_product; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_product > *' at 0x7f0f04381b10> >"
]
},
"execution_count": 13,
@ -1483,7 +1483,7 @@
"$\\{\\unicode{x201C}\\mathit{a < 2}\\unicode{x201D}, \\unicode{x201C}\\mathit{b == 1}\\unicode{x201D}\\}$"
],
"text/plain": [
"{\"a < 2\", \"b == 1\"}"
"spot.atomic_prop_set([spot.formula(\"\\\"a < 2\\\"\"), spot.formula(\"\\\"b == 1\\\"\")])"
]
},
"execution_count": 14,
@ -1548,31 +1548,29 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Prefix:\n",
" a=0, b=0, Q=0\n",
" | \"a<1\" & !\"b > 1\" & !dead\n",
" a=1, b=0, Q=0\n",
" | !\"a<1\" & !\"b > 1\" & !dead\n",
" a=2, b=0, Q=0\n",
" | !\"a<1\" & !\"b > 1\" & !dead\n",
"Cycle:\n",
" a=3, b=0, Q=0\n",
" | !\"a<1\" & !\"b > 1\" & dead"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
"name": "stdout",
"output_type": "stream",
"text": [
"Prefix:\n",
" a=0, b=0, Q=0\n",
" | \"a<1\" & !\"b > 1\" & !dead\n",
" a=1, b=0, Q=0\n",
" | !\"a<1\" & !\"b > 1\" & !dead\n",
" a=2, b=0, Q=0\n",
" | !\"a<1\" & !\"b > 1\" & !dead\n",
"Cycle:\n",
" a=3, b=0, Q=0\n",
" | !\"a<1\" & !\"b > 1\" & dead\n",
"\n"
]
}
],
"source": [
"run = model_debug('\"a<1\" R \"b > 1\"', m); run"
"run = model_debug('\"a<1\" R \"b > 1\"', m); print(run)"
]
},
{
@ -1584,7 +1582,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"outputs": [
{
@ -1665,10 +1663,10 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f30602dded0> >"
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0f04392d80> >"
]
},
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
@ -1676,6 +1674,13 @@
"source": [
"run.as_twa(True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
@ -1694,7 +1699,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.6.7"
}
},
"nbformat": 4,