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

@ -41,7 +41,7 @@
"$\\mathsf{G} \\mathsf{F} p_{1} \\land \\mathsf{G} \\mathsf{F} p_{2} \\land \\mathsf{G} \\mathsf{F} p_{3}$"
],
"text/plain": [
"GFp1 & GFp2 & GFp3"
"spot.formula(\"GFp1 & GFp2 & GFp3\")"
]
},
"execution_count": 2,
@ -64,7 +64,7 @@
"$\\mathsf{F} (p \\land \\mathsf{X} p \\land \\mathsf{X} \\mathsf{X} p \\land \\mathsf{X} \\mathsf{X} \\mathsf{X} p) \\land \\mathsf{F} (q \\land \\mathsf{X} q \\land \\mathsf{X} \\mathsf{X} q \\land \\mathsf{X} \\mathsf{X} \\mathsf{X} q)$"
],
"text/plain": [
"F(p & Xp & XXp & XXXp) & F(q & Xq & XXq & XXXq)"
"spot.formula(\"F(p & Xp & XXp & XXXp) & F(q & Xq & XXq & XXXq)\")"
]
},
"execution_count": 3,
@ -103,7 +103,7 @@
"$(\\mathsf{G} \\mathsf{F} p_{1} \\lor \\mathsf{F} \\mathsf{G} p_{2}) \\land (\\mathsf{G} \\mathsf{F} p_{2} \\lor \\mathsf{F} \\mathsf{G} p_{3}) \\land (\\mathsf{G} \\mathsf{F} p_{3} \\lor \\mathsf{F} \\mathsf{G} p_{4})$"
],
"text/plain": [
"(GFp1 | FGp2) & (GFp2 | FGp3) & (GFp3 | FGp4)"
"spot.formula(\"(GFp1 | FGp2) & (GFp2 | FGp3) & (GFp3 | FGp4)\")"
]
},
"metadata": {},
@ -115,7 +115,7 @@
"$\\mathsf{F} \\mathsf{G} p_{1}$"
],
"text/plain": [
"FGp1"
"spot.formula(\"FGp1\")"
]
},
"metadata": {},
@ -127,7 +127,7 @@
"$\\mathsf{F} \\mathsf{G} p_{1} \\land \\mathsf{F} \\mathsf{G} p_{2}$"
],
"text/plain": [
"FGp1 & FGp2"
"spot.formula(\"FGp1 & FGp2\")"
]
},
"metadata": {},
@ -139,7 +139,7 @@
"$\\mathsf{F} \\mathsf{G} p_{1} \\land \\mathsf{F} \\mathsf{G} p_{2} \\land \\mathsf{F} \\mathsf{G} p_{3}$"
],
"text/plain": [
"FGp1 & FGp2 & FGp3"
"spot.formula(\"FGp1 & FGp2 & FGp3\")"
]
},
"metadata": {},
@ -151,7 +151,7 @@
"$p_{0} \\mathbin{\\mathsf{U}} (p_{1} \\land \\mathsf{G} p_{2})$"
],
"text/plain": [
"p0 U (p1 & Gp2)"
"spot.formula(\"p0 U (p1 & Gp2)\")"
]
},
"metadata": {},
@ -163,7 +163,7 @@
"$p_{0} \\mathbin{\\mathsf{U}} (p_{1} \\land \\mathsf{X} (p_{2} \\mathbin{\\mathsf{U}} p_{3}))$"
],
"text/plain": [
"p0 U (p1 & X(p2 U p3))"
"spot.formula(\"p0 U (p1 & X(p2 U p3))\")"
]
},
"metadata": {},
@ -175,7 +175,7 @@
"$p_{0} \\mathbin{\\mathsf{U}} (p_{1} \\land \\mathsf{X} (p_{2} \\land \\mathsf{F} (p_{3} \\land \\mathsf{X} \\mathsf{F} (p_{4} \\land \\mathsf{X} \\mathsf{F} (p_{5} \\land \\mathsf{X} \\mathsf{F} p_{6})))))$"
],
"text/plain": [
"p0 U (p1 & X(p2 & F(p3 & XF(p4 & XF(p5 & XFp6)))))"
"spot.formula(\"p0 U (p1 & X(p2 & F(p3 & XF(p4 & XF(p5 & XFp6)))))\")"
]
},
"metadata": {},
@ -187,7 +187,7 @@
"$\\mathsf{F} (p_{0} \\land \\mathsf{X} \\mathsf{G} p_{1})$"
],
"text/plain": [
"F(p0 & XGp1)"
"spot.formula(\"F(p0 & XGp1)\")"
]
},
"metadata": {},
@ -199,7 +199,7 @@
"$\\mathsf{F} (p_{0} \\land \\mathsf{X} (p_{1} \\land \\mathsf{X} \\mathsf{F} p_{2}))$"
],
"text/plain": [
"F(p0 & X(p1 & XFp2))"
"spot.formula(\"F(p0 & X(p1 & XFp2))\")"
]
},
"metadata": {},
@ -211,7 +211,7 @@
"$\\mathsf{F} (p_{0} \\land \\mathsf{X} (p_{1} \\mathbin{\\mathsf{U}} p_{2}))$"
],
"text/plain": [
"F(p0 & X(p1 U p2))"
"spot.formula(\"F(p0 & X(p1 U p2))\")"
]
},
"metadata": {},
@ -223,7 +223,7 @@
"$\\mathsf{G} \\mathsf{F} p_{0} \\lor \\mathsf{F} \\mathsf{G} p_{1}$"
],
"text/plain": [
"GFp0 | FGp1"
"spot.formula(\"GFp0 | FGp1\")"
]
},
"metadata": {},
@ -235,7 +235,7 @@
"$\\mathsf{G} (p_{0} \\rightarrow (p_{1} \\mathbin{\\mathsf{U}} p_{2}))$"
],
"text/plain": [
"G(p0 -> (p1 U p2))"
"spot.formula(\"G(p0 -> (p1 U p2))\")"
]
},
"metadata": {},
@ -247,7 +247,7 @@
"$\\mathsf{G} (p_{0} \\land \\mathsf{X} \\mathsf{F} (p_{1} \\land \\mathsf{X} \\mathsf{F} (p_{2} \\land \\mathsf{X} \\mathsf{F} p_{3})))$"
],
"text/plain": [
"G(p0 & XF(p1 & XF(p2 & XFp3)))"
"spot.formula(\"G(p0 & XF(p1 & XF(p2 & XFp3)))\")"
]
},
"metadata": {},
@ -259,7 +259,7 @@
"$\\mathsf{G} \\mathsf{F} p_{1} \\land \\mathsf{G} \\mathsf{F} p_{2} \\land \\mathsf{G} \\mathsf{F} p_{3} \\land \\mathsf{G} \\mathsf{F} p_{0} \\land \\mathsf{G} \\mathsf{F} p_{4}$"
],
"text/plain": [
"GFp1 & GFp2 & GFp3 & GFp0 & GFp4"
"spot.formula(\"GFp1 & GFp2 & GFp3 & GFp0 & GFp4\")"
]
},
"metadata": {},
@ -271,7 +271,7 @@
"$(p_{0} \\mathbin{\\mathsf{U}} (p_{1} \\mathbin{\\mathsf{U}} p_{2})) \\lor (p_{1} \\mathbin{\\mathsf{U}} (p_{2} \\mathbin{\\mathsf{U}} p_{0})) \\lor (p_{2} \\mathbin{\\mathsf{U}} (p_{0} \\mathbin{\\mathsf{U}} p_{1}))$"
],
"text/plain": [
"(p0 U (p1 U p2)) | (p1 U (p2 U p0)) | (p2 U (p0 U p1))"
"spot.formula(\"(p0 U (p1 U p2)) | (p1 U (p2 U p0)) | (p2 U (p0 U p1))\")"
]
},
"metadata": {},
@ -283,7 +283,7 @@
"$\\mathsf{G} (p_{0} \\rightarrow (p_{1} \\mathbin{\\mathsf{U}} (\\mathsf{G} p_{2} \\lor \\mathsf{G} p_{3})))$"
],
"text/plain": [
"G(p0 -> (p1 U (Gp2 | Gp3)))"
"spot.formula(\"G(p0 -> (p1 U (Gp2 | Gp3)))\")"
]
},
"metadata": {},
@ -317,7 +317,7 @@
"$\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} b)$"
],
"text/plain": [
"GFa1 U G(GFa0 U Xb)"
"spot.formula(\"GFa1 U G(GFa0 U Xb)\")"
]
},
"metadata": {},
@ -329,7 +329,7 @@
"$\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} b)$"
],
"text/plain": [
"GFa1 U G(GFa0 U XXb)"
"spot.formula(\"GFa1 U G(GFa0 U XXb)\")"
]
},
"metadata": {},
@ -341,7 +341,7 @@
"$\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} \\mathsf{X} b)$"
],
"text/plain": [
"GFa1 U G(GFa0 U XXXb)"
"spot.formula(\"GFa1 U G(GFa0 U XXXb)\")"
]
},
"metadata": {},
@ -353,7 +353,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U Xb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U Xb))\")"
]
},
"metadata": {},
@ -365,7 +365,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U XXb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U XXb))\")"
]
},
"metadata": {},
@ -377,7 +377,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U XXXb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U XXXb))\")"
]
},
"metadata": {},
@ -389,7 +389,7 @@
"$\\mathsf{G} \\mathsf{F} a_{3} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} b)))$"
],
"text/plain": [
"GFa3 U G(GFa2 U G(GFa1 U G(GFa0 U Xb)))"
"spot.formula(\"GFa3 U G(GFa2 U G(GFa1 U G(GFa0 U Xb)))\")"
]
},
"metadata": {},
@ -401,7 +401,7 @@
"$\\mathsf{G} \\mathsf{F} a_{3} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} b)))$"
],
"text/plain": [
"GFa3 U G(GFa2 U G(GFa1 U G(GFa0 U XXb)))"
"spot.formula(\"GFa3 U G(GFa2 U G(GFa1 U G(GFa0 U XXb)))\")"
]
},
"metadata": {},
@ -413,7 +413,7 @@
"$\\mathsf{G} \\mathsf{F} a_{3} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} \\mathsf{X} b)))$"
],
"text/plain": [
"GFa3 U G(GFa2 U G(GFa1 U G(GFa0 U XXXb)))"
"spot.formula(\"GFa3 U G(GFa2 U G(GFa1 U G(GFa0 U XXXb)))\")"
]
},
"metadata": {},
@ -436,7 +436,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U XXXb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U XXXb))\")"
]
},
"metadata": {},
@ -448,7 +448,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U XXb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U XXb))\")"
]
},
"metadata": {},
@ -460,7 +460,7 @@
"$\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} b)$"
],
"text/plain": [
"GFa1 U G(GFa0 U Xb)"
"spot.formula(\"GFa1 U G(GFa0 U Xb)\")"
]
},
"metadata": {},
@ -472,7 +472,7 @@
"$\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} b)$"
],
"text/plain": [
"GFa1 U G(GFa0 U XXb)"
"spot.formula(\"GFa1 U G(GFa0 U XXb)\")"
]
},
"metadata": {},
@ -484,7 +484,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U Xb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U Xb))\")"
]
},
"metadata": {},
@ -496,7 +496,7 @@
"$\\mathsf{G} \\mathsf{F} a_{2} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{1} \\mathbin{\\mathsf{U}} \\mathsf{G} (\\mathsf{G} \\mathsf{F} a_{0} \\mathbin{\\mathsf{U}} \\mathsf{X} \\mathsf{X} b))$"
],
"text/plain": [
"GFa2 U G(GFa1 U G(GFa0 U XXb))"
"spot.formula(\"GFa2 U G(GFa1 U G(GFa0 U XXb))\")"
]
},
"metadata": {},
@ -1232,7 +1232,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.6.7"
}
},
"nbformat": 4,