Commit 17b295e1 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

python: SVG display of word as signals

Fixes #309.

* python/spot/__init__.py (twa_word.as_svg, twa_word.show): New
  methods.
* tests/python/word.ipynb: Use them.
* NEWS: Mention them.
parent 678446f1
......@@ -227,6 +227,10 @@ New in spot 2.4.4.dev (net yet released)
- The "product-states" property of automata is now accessible via
spot.twa.get_product_states() and spot.set.get_product_states().
- twa_word instances can be displayed as SVG pictures, with one
signal per atomic proposition. For some examples, see the use of
the show() method in https://spot.lrde.epita.fr/ipynb/word.html
Deprecation notices:
(These functions still work but compilers emit warnings.)
......
......@@ -1010,3 +1010,92 @@ def show_mp_hierarchy(cl):
return SVG(mp_hierarchy_svg(cl))
formula.show_mp_hierarchy = show_mp_hierarchy
@_extend(twa_word)
class twa_word:
def as_svg(self):
"""
Build an SVG picture representing the word as a collection of
signals for each atomic proposition.
"""
# Get the list of atomic proposition used
sup = buddy.bddtrue
for cond in list(self.prefix) + list(self.cycle):
sup = sup & buddy.bdd_support(cond)
ap = []
while sup != buddy.bddtrue:
a = buddy.bdd_var(sup)
ap.append(a)
sup = buddy.bdd_high(sup)
# Prepare canvas
psize = len(self.prefix)
csize = len(self.cycle)
d = {
'endprefix': 50 * psize,
'endcycle': 50 * (psize + csize),
'w': 50 * (psize + csize * 2),
'height': 50 * len(ap),
'height2': 50 * len(ap) + 10,
'h3': 50 * len(ap) + 12,
'bgcolor': '#f4f4f4',
'bgl': 'stroke="white" stroke-width="4"',
'bgt': 'stroke="white" stroke-width="1"',
'txt': 'text-anchor="start" font-size="20"',
'red': 'stroke="#ff0000" stroke-width="2"',
'sml': 'text-anchor="start" font-size="10"'
}
txt = '''
<svg height="{h3}" width="{w}" xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="0" y="0" width="{w}" height="{height}" fill="{bgcolor}"/>
<line x1="{endprefix}" y1="0" x2="{endprefix}" y2="{height}"
stroke="white" stroke-width="4"/>
<line x1="{endcycle}" y1="0" x2="{endcycle}" y2="{height}"
stroke="white" stroke-width="4"/>
'''.format(**d)
# Iterate over all used atomic propositions, and fill each line
l = list(self.prefix) + list(self.cycle) + list(self.cycle)
bd = self.get_dict()
for ypos, a in enumerate(ap):
pa = buddy.bdd_ithvar(a)
na = buddy.bdd_nithvar(a)
name = bdd_format_formula(bd, pa)
# Whether the last state was down (-1), up (1), or unknown (0)
last = 0
txt += ('<line x1="0" y1="{y}" x2="{w}" y2="{y}" {bgl}/>'
.format(y=ypos*50, **d))
txt += ('<text x="{x}" y="{y}" {txt}>{name}</text>'
.format(x=3, y=ypos*50+30, name=name, **d))
for xpos, step in enumerate(l):
if buddy.bdd_implies(step, pa):
cur = 1
elif buddy.bdd_implies(step, na):
cur = -1
else:
cur = 0
txt += ('<line x1="{x}" y1="{y1}" x2="{x}" y2="{y2}" {bgt}/>'
.format(x=(xpos+1)*50, y1=ypos*50, y2=ypos*50+50, **d))
if cur != 0:
if last == -cur:
txt += \
('<line x1="{x}" y1="{y1}" x2="{x}" y2="{y2}" {red}/>'
.format(x=xpos*50, y1=ypos*50+5,
y2=ypos*50+45, **d))
txt += \
('<line x1="{x1}" y1="{y}" x2="{x2}" y2="{y}" {red}/>'
.format(x1=xpos*50, x2=(xpos+1)*50,
y=ypos*50+25-20*cur, **d))
last = cur
if psize > 0:
txt += '<text x="0" y="{height2}" {sml}>prefix</text>'.format(**d)
txt += '''<text x="{endprefix}" y="{height2}" {sml}>cycle</text>
<text x="{endcycle}" y="{height2}" {sml}>cycle</text>'''.format(**d)
return txt + '</svg>'
def show(self):
"""
Display the word as an SVG picture of signals.
"""
from IPython.display import SVG
return SVG(self.as_svg())
......@@ -15,7 +15,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
"version": "3.6.4"
},
"name": ""
},
......@@ -47,7 +47,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"aut = spot.translate('G(Fa <-> XXb)'); aut"
"aut = spot.translate('!a & G(Fa <-> XXb)'); aut"
],
"language": "python",
"metadata": {},
......@@ -63,150 +63,121 @@
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
" -->\n",
"<!-- Title: G Pages: 1 -->\n",
"<svg width=\"465pt\" height=\"215pt\"\n",
" viewBox=\"0.00 0.00 464.50 215.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 211)\">\n",
"<svg width=\"465pt\" height=\"166pt\"\n",
" viewBox=\"0.00 0.00 464.50 166.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 162)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-211 460.5,-211 460.5,4 -4,4\"/>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-162 460.5,-162 460.5,4 -4,4\"/>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-55\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"56\" y=\"-51.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"56\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-55C2.79388,-55 17.1543,-55 30.6317,-55\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-55 30.9419,-58.1501 34.4419,-55 30.9419,-55.0001 30.9419,-55.0001 30.9419,-55.0001 34.4419,-55 30.9418,-51.8501 37.9419,-55 37.9419,-55\"/>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-18C2.79388,-18 17.1543,-18 30.6317,-18\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-18 30.9419,-21.1501 34.4419,-18 30.9419,-18.0001 30.9419,-18.0001 30.9419,-18.0001 34.4419,-18 30.9418,-14.8501 37.9419,-18 37.9419,-18\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"139\" cy=\"-86\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"139\" y=\"-82.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"139\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"139\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M73.003,-61.1246C85.0955,-65.7526 101.855,-72.1668 115.327,-77.3227\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"122.03,-79.8881 114.367,-80.3279 118.761,-78.6371 115.493,-77.386 115.493,-77.386 115.493,-77.386 118.761,-78.6371 116.619,-74.4441 122.03,-79.8881 122.03,-79.8881\"/>\n",
"<text text-anchor=\"start\" x=\"94\" y=\"-75.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M74.178,-18C85.6688,-18 100.959,-18 113.693,-18\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"120.847,-18 113.847,-21.1501 117.347,-18 113.847,-18.0001 113.847,-18.0001 113.847,-18.0001 117.347,-18 113.847,-14.8501 120.847,-18 120.847,-18\"/>\n",
"<text text-anchor=\"start\" x=\"92\" y=\"-21.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g id=\"node4\" class=\"node\"><title>2</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"139\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"139\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"218\" cy=\"-79\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"218\" y=\"-75.3\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>0&#45;&gt;2</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M72.6176,-47.866C84.9439,-42.2355 102.291,-34.3117 116.019,-28.0406\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"122.43,-25.1121 117.372,-30.8858 119.247,-26.5663 116.063,-28.0206 116.063,-28.0206 116.063,-28.0206 119.247,-26.5663 114.754,-25.1554 122.43,-25.1121 122.43,-25.1121\"/>\n",
"<text text-anchor=\"start\" x=\"92\" y=\"-41.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>1&#45;&gt;2</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M153.766,-28.9056C166.03,-38.6209 184.099,-52.936 197.786,-63.7783\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"203.353,-68.1888 195.91,-66.3112 200.61,-66.0154 197.866,-63.8421 197.866,-63.8421 197.866,-63.8421 200.61,-66.0154 199.822,-61.373 203.353,-68.1888 203.353,-68.1888\"/>\n",
"<text text-anchor=\"start\" x=\"175\" y=\"-53.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g id=\"node5\" class=\"node\"><title>3</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"218\" cy=\"-107\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"218\" y=\"-103.3\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"327\" cy=\"-51\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"327\" y=\"-47.3\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>1&#45;&gt;3</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M156.708,-90.5567C167.403,-93.4737 181.445,-97.3031 193.286,-100.533\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"200.325,-102.452 192.743,-103.649 196.948,-101.531 193.571,-100.61 193.571,-100.61 193.571,-100.61 196.948,-101.531 194.4,-97.5713 200.325,-102.452 200.325,-102.452\"/>\n",
"<text text-anchor=\"start\" x=\"175\" y=\"-100.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M157.272,-20.511C185.389,-24.6769 242.767,-33.504 291,-43 294.652,-43.719 298.505,-44.538 302.266,-45.371\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"309.309,-46.9679 301.786,-48.492 305.896,-46.194 302.483,-45.42 302.483,-45.42 302.483,-45.42 305.896,-46.194 303.179,-42.348 309.309,-46.9679 309.309,-46.9679\"/>\n",
"<text text-anchor=\"start\" x=\"212.5\" y=\"-35.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g id=\"node6\" class=\"node\"><title>4</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"327\" cy=\"-71\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"327\" y=\"-67.3\" font-family=\"Lato\" font-size=\"14.00\">4</text>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"436\" cy=\"-22\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"436\" y=\"-18.3\" font-family=\"Lato\" font-size=\"14.00\">4</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;4 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;4</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M155.656,-78.8828C167.543,-73.8869 184.441,-67.6441 200,-65 235.174,-59.0223 276.609,-63.083 302.091,-66.8263\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"309.149,-67.9155 301.75,-69.9609 305.69,-67.3817 302.231,-66.8478 302.231,-66.8478 302.231,-66.8478 305.69,-67.3817 302.711,-63.7347 309.149,-67.9155 309.149,-67.9155\"/>\n",
"<text text-anchor=\"start\" x=\"212.5\" y=\"-68.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"</g>\n",
"<!-- 5 -->\n",
"<g id=\"node7\" class=\"node\"><title>5</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"327\" cy=\"-179\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"327\" y=\"-175.3\" font-family=\"Lato\" font-size=\"14.00\">5</text>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M157.382,-17.8002C179.736,-17.5541 219.759,-17.1502 254,-17 270.444,-16.9279 274.558,-16.7146 291,-17 333.016,-17.7292 381.897,-19.6544 410.541,-20.892\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"417.716,-21.2059 410.585,-24.0468 414.219,-21.0529 410.722,-20.8998 410.722,-20.8998 410.722,-20.8998 414.219,-21.0529 410.86,-17.7529 417.716,-21.2059 417.716,-21.2059\"/>\n",
"<text text-anchor=\"start\" x=\"267\" y=\"-20.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;5 -->\n",
"<g id=\"edge6\" class=\"edge\"><title>1&#45;&gt;5</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M145.052,-103.353C152.731,-126.145 169.745,-165.231 200,-182 232.013,-199.743 275.986,-193.018 302.622,-186.225\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"309.65,-184.328 303.713,-189.194 306.271,-185.24 302.892,-186.153 302.892,-186.153 302.892,-186.153 306.271,-185.24 302.071,-183.111 309.65,-184.328 309.65,-184.328\"/>\n",
"<text text-anchor=\"start\" x=\"212.5\" y=\"-195.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g id=\"edge6\" class=\"edge\"><title>2&#45;&gt;2</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M211.266,-96.0373C209.892,-105.858 212.137,-115 218,-115 222.397,-115 224.759,-109.858 225.086,-103.143\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"224.734,-96.0373 228.226,-102.873 224.907,-99.533 225.08,-103.029 225.08,-103.029 225.08,-103.029 224.907,-99.533 221.934,-103.185 224.734,-96.0373 224.734,-96.0373\"/>\n",
"<text text-anchor=\"start\" x=\"201\" y=\"-133.8\" font-family=\"Lato\" font-size=\"14.00\">a &amp; b</text>\n",
"<text text-anchor=\"start\" x=\"210\" y=\"-118.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">\u24ff</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g id=\"edge7\" class=\"edge\"><title>2&#45;&gt;3</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M151.362,-31.1323C164.441,-46.2502 186.023,-71.1956 200.846,-88.3285\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"205.592,-93.8139 198.63,-90.5811 203.302,-91.167 201.012,-88.5201 201.012,-88.5201 201.012,-88.5201 203.302,-91.167 203.394,-86.4591 205.592,-93.8139 205.592,-93.8139\"/>\n",
"<text text-anchor=\"start\" x=\"175\" y=\"-68.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g id=\"edge8\" class=\"edge\"><title>2&#45;&gt;4</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M156.924,-21.8749C185.025,-28.4443 242.977,-42.5668 291,-58 295.032,-59.2959 299.287,-60.7772 303.387,-62.2649\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"310.075,-64.7429 302.417,-65.2646 306.793,-63.5269 303.511,-62.3108 303.511,-62.3108 303.511,-62.3108 306.793,-63.5269 304.605,-59.3571 310.075,-64.7429 310.075,-64.7429\"/>\n",
"<text text-anchor=\"start\" x=\"212.5\" y=\"-44.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M231.092,-66.5202C237.345,-60.9508 245.449,-54.9814 254,-52 269.38,-46.6377 287.754,-46.4746 302.091,-47.6074\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"309.184,-48.2973 301.912,-50.7547 305.7,-47.9584 302.217,-47.6195 302.217,-47.6195 302.217,-47.6195 305.7,-47.9584 302.522,-44.4843 309.184,-48.2973 309.184,-48.2973\"/>\n",
"<text text-anchor=\"start\" x=\"254\" y=\"-55.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 6 -->\n",
"<g id=\"node8\" class=\"node\"><title>6</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"436\" cy=\"-22\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"436\" y=\"-18.3\" font-family=\"Lato\" font-size=\"14.00\">6</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;6 -->\n",
"<g id=\"edge9\" class=\"edge\"><title>2&#45;&gt;6</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M157.136,-18.2323C207.034,-18.9089 352.372,-20.8796 410.528,-21.6682\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"417.817,-21.767 410.775,-24.8217 414.317,-21.7195 410.818,-21.672 410.818,-21.672 410.818,-21.672 414.317,-21.7195 410.861,-18.5223 417.817,-21.767 417.817,-21.767\"/>\n",
"<text text-anchor=\"start\" x=\"267\" y=\"-24.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<!-- 5 -->\n",
"<g id=\"node7\" class=\"node\"><title>5</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"327\" cy=\"-140\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"327\" y=\"-136.3\" font-family=\"Lato\" font-size=\"14.00\">5</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;5 -->\n",
"<g id=\"edge8\" class=\"edge\"><title>2&#45;&gt;5</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M231.561,-91.398C237.925,-97.2386 245.987,-104.003 254,-109 269.382,-118.592 288.25,-126.595 302.812,-132.066\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"309.58,-134.544 301.924,-135.095 306.293,-133.341 303.007,-132.137 303.007,-132.137 303.007,-132.137 306.293,-133.341 304.09,-129.179 309.58,-134.544 309.58,-134.544\"/>\n",
"<text text-anchor=\"start\" x=\"254\" y=\"-130.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;2 -->\n",
"<g id=\"edge9\" class=\"edge\"><title>3&#45;&gt;2</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M310.663,-59.0732C304.666,-61.9449 297.644,-64.9668 291,-67 275.418,-71.7682 257.324,-74.7739 243.173,-76.5847\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"236.167,-77.4257 242.741,-73.4638 239.642,-77.0085 243.117,-76.5914 243.117,-76.5914 243.117,-76.5914 239.642,-77.0085 243.492,-79.7189 236.167,-77.4257 236.167,-77.4257\"/>\n",
"<text text-anchor=\"start\" x=\"255.5\" y=\"-93.8\" font-family=\"Lato\" font-size=\"14.00\">a &amp; b</text>\n",
"<text text-anchor=\"start\" x=\"264.5\" y=\"-78.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">\u24ff</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g id=\"edge10\" class=\"edge\"><title>3&#45;&gt;3</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M211.266,-124.037C209.892,-133.858 212.137,-143 218,-143 222.397,-143 224.759,-137.858 225.086,-131.143\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"224.734,-124.037 228.226,-130.873 224.907,-127.533 225.08,-131.029 225.08,-131.029 225.08,-131.029 224.907,-127.533 221.934,-131.185 224.734,-124.037 224.734,-124.037\"/>\n",
"<text text-anchor=\"start\" x=\"201\" y=\"-161.8\" font-family=\"Lato\" font-size=\"14.00\">a &amp; b</text>\n",
"<text text-anchor=\"start\" x=\"210\" y=\"-146.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">\u24ff</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g id=\"edge11\" class=\"edge\"><title>3&#45;&gt;4</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M234.442,-114.796C249.614,-121.291 273.039,-128.132 291,-119 301.558,-113.632 309.687,-103.42 315.441,-93.7909\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"318.882,-87.604 318.233,-95.2526 317.181,-90.6629 315.48,-93.7218 315.48,-93.7218 315.48,-93.7218 317.181,-90.6629 312.727,-92.1909 318.882,-87.604 318.882,-87.604\"/>\n",
"<text text-anchor=\"start\" x=\"254\" y=\"-126.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;5 -->\n",
"<g id=\"edge12\" class=\"edge\"><title>3&#45;&gt;5</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M230.453,-120.313C236.909,-127.314 245.39,-135.722 254,-142 269.46,-153.274 288.841,-163.021 303.599,-169.677\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"310.024,-172.512 302.348,-172.568 306.822,-171.099 303.62,-169.686 303.62,-169.686 303.62,-169.686 306.822,-171.099 304.891,-166.804 310.024,-172.512 310.024,-172.512\"/>\n",
"<text text-anchor=\"start\" x=\"254\" y=\"-166.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g id=\"edge13\" class=\"edge\"><title>4&#45;&gt;3</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M308.918,-72.5299C294.007,-74.2807 271.999,-77.8816 254,-85 248.953,-86.9961 243.833,-89.7328 239.124,-92.5982\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"233.003,-96.5281 237.192,-90.0954 235.949,-94.6371 238.894,-92.7462 238.894,-92.7462 238.894,-92.7462 235.949,-94.6371 240.596,-95.3969 233.003,-96.5281 233.003,-96.5281\"/>\n",
"<text text-anchor=\"start\" x=\"255.5\" y=\"-103.8\" font-family=\"Lato\" font-size=\"14.00\">a &amp; b</text>\n",
"<text text-anchor=\"start\" x=\"264.5\" y=\"-88.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">\u24ff</text>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M317.767,-66.5414C315.169,-76.9087 318.246,-87 327,-87 333.702,-87 337.077,-81.0847 337.124,-73.6591\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"336.233,-66.5414 340.229,-73.0955 336.668,-70.0143 337.103,-73.4871 337.103,-73.4871 337.103,-73.4871 336.668,-70.0143 333.977,-73.8788 336.233,-66.5414 336.233,-66.5414\"/>\n",
"<text text-anchor=\"start\" x=\"308.5\" y=\"-90.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g id=\"edge14\" class=\"edge\"><title>4&#45;&gt;4</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M317.767,-86.5414C315.169,-96.9087 318.246,-107 327,-107 333.702,-107 337.077,-101.085 337.124,-93.6591\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"336.233,-86.5414 340.229,-93.0955 336.668,-90.0143 337.103,-93.4871 337.103,-93.4871 337.103,-93.4871 336.668,-90.0143 333.977,-93.8788 336.233,-86.5414 336.233,-86.5414\"/>\n",
"<text text-anchor=\"start\" x=\"308.5\" y=\"-110.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 5&#45;&gt;6 -->\n",
"<g id=\"edge15\" class=\"edge\"><title>5&#45;&gt;6</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M337.875,-164.511C356.984,-136.471 399.072,-74.7167 421.037,-42.4872\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"425.149,-36.4538 423.81,-44.0122 423.178,-39.3459 421.207,-42.2381 421.207,-42.2381 421.207,-42.2381 423.178,-39.3459 418.604,-40.4641 425.149,-36.4538 425.149,-36.4538\"/>\n",
"<text text-anchor=\"start\" x=\"363\" y=\"-126.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"<!-- 6&#45;&gt;6 -->\n",
"<g id=\"edge16\" class=\"edge\"><title>6&#45;&gt;6</title>\n",
"<g id=\"edge11\" class=\"edge\"><title>4&#45;&gt;4</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M426.767,-37.5414C424.169,-47.9087 427.246,-58 436,-58 442.702,-58 446.077,-52.0847 446.124,-44.6591\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"445.233,-37.5414 449.229,-44.0955 445.668,-41.0143 446.103,-44.4871 446.103,-44.4871 446.103,-44.4871 445.668,-41.0143 442.977,-44.8788 445.233,-37.5414 445.233,-37.5414\"/>\n",
"<text text-anchor=\"start\" x=\"415.5\" y=\"-76.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; !b</text>\n",
"<text text-anchor=\"start\" x=\"428\" y=\"-61.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">\u24ff</text>\n",
"</g>\n",
"<!-- 5&#45;&gt;4 -->\n",
"<g id=\"edge12\" class=\"edge\"><title>5&#45;&gt;4</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M339.86,-126.921C358.901,-105.922 396.358,-64.6141 418.163,-40.5684\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"423.087,-35.1375 420.719,-42.439 420.736,-37.7303 418.385,-40.3231 418.385,-40.3231 418.385,-40.3231 420.736,-37.7303 416.052,-38.2071 423.087,-35.1375 423.087,-35.1375\"/>\n",
"<text text-anchor=\"start\" x=\"363\" y=\"-101.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fdf783f0510> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb74c39da80> >"
]
}
],
......@@ -235,11 +206,11 @@
"text": [
"Prefix:\n",
" 0\n",
" | a\n",
" | !a\n",
" 1\n",
" | a\n",
"Cycle:\n",
" 3\n",
" 2\n",
" | a & b\t{0}"
]
}
......@@ -267,7 +238,7 @@
"output_type": "stream",
"stream": "stdout",
"text": [
"a\n",
"!a\n",
"{0}\n"
]
}
......@@ -295,12 +266,47 @@
"output_type": "pyout",
"prompt_number": 5,
"text": [
"a; a; cycle{a & b}"
"!a; a; cycle{a & b}"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A word can be represented as a collection of signals (one for each atomic proposition). The cycle part is shown twice."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"word.show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 6,
"svg": [
"<svg height=\"112\" version=\"1.1\" width=\"200\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<rect fill=\"#f4f4f4\" height=\"100\" width=\"200\" x=\"0\" y=\"0\"/>\n",
"<line stroke=\"white\" stroke-width=\"4\" x1=\"100\" x2=\"100\" y1=\"0\" y2=\"100\"/>\n",
"<line stroke=\"white\" stroke-width=\"4\" x1=\"150\" x2=\"150\" y1=\"0\" y2=\"100\"/>\n",
"<line stroke=\"white\" stroke-width=\"4\" x1=\"0\" x2=\"200\" y1=\"0\" y2=\"0\"/><text font-size=\"20\" text-anchor=\"start\" x=\"3\" y=\"30\">a</text><line stroke=\"white\" stroke-width=\"1\" x1=\"50\" x2=\"50\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"0\" x2=\"50\" y1=\"45\" y2=\"45\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"100\" x2=\"100\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"50\" x2=\"50\" y1=\"5\" y2=\"45\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"50\" x2=\"100\" y1=\"5\" y2=\"5\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"150\" x2=\"150\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"100\" x2=\"150\" y1=\"5\" y2=\"5\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"200\" x2=\"200\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"150\" x2=\"200\" y1=\"5\" y2=\"5\"/><line stroke=\"white\" stroke-width=\"4\" x1=\"0\" x2=\"200\" y1=\"50\" y2=\"50\"/><text font-size=\"20\" text-anchor=\"start\" x=\"3\" y=\"80\">b</text><line stroke=\"white\" stroke-width=\"1\" x1=\"50\" x2=\"50\" y1=\"50\" y2=\"100\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"100\" x2=\"100\" y1=\"50\" y2=\"100\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"150\" x2=\"150\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"100\" x2=\"150\" y1=\"55\" y2=\"55\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"200\" x2=\"200\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"150\" x2=\"200\" y1=\"55\" y2=\"55\"/><text font-size=\"10\" text-anchor=\"start\" x=\"0\" y=\"110\">prefix</text><text font-size=\"10\" text-anchor=\"start\" x=\"100\" y=\"110\">cycle</text>\n",
"<text font-size=\"10\" text-anchor=\"start\" x=\"150\" y=\"110\">cycle</text></svg>"
],
"text": [
"<IPython.core.display.SVG object>"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -323,13 +329,13 @@
"output_type": "stream",
"stream": "stdout",
"text": [
"a\n",
"!a\n",
"a\n",
"a & b\n"
]
}
],
"prompt_number": 6
"prompt_number": 7
},
{
"cell_type": "markdown",
......@@ -351,13 +357,13 @@
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 7,
"prompt_number": 8,
"text": [
"cycle{a & b}"
"!a; cycle{a & b}"
]
}
],
"prompt_number": 7
"prompt_number": 8
},
{
"cell_type": "markdown",
......@@ -378,13 +384,13 @@
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 8,
"prompt_number": 9,
"text": [
"cycle{a & b}"
"!a; cycle{a & b}"
]
}
],
"prompt_number": 8
"prompt_number": 9
},
{
"cell_type": "markdown",
......@@ -414,14 +420,14 @@
]
}
],
"prompt_number": 9
"prompt_number": 10
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# make sure that we can parse a word back after it has been printed\n",
"spot.parse_word(str(spot.parse_word('a;b&a;cycle{!a&!b}')))"
"w = spot.parse_word(str(spot.parse_word('a;b&a;cycle{!a&!b;!a&b}'))); w"
],
"language": "python",
"metadata": {},
......@@ -429,13 +435,41 @@
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 10,
"prompt_number": 11,
"text": [
"a; a & b; cycle{!a & !b}"
"a; a & b; cycle{!a & !b; !a & b}"
]
}
],
"prompt_number": 10
"prompt_number": 11
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"w.show()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 12,
"svg": [
"<svg height=\"112\" version=\"1.1\" width=\"300\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<rect fill=\"#f4f4f4\" height=\"100\" width=\"300\" x=\"0\" y=\"0\"/>\n",
"<line stroke=\"white\" stroke-width=\"4\" x1=\"100\" x2=\"100\" y1=\"0\" y2=\"100\"/>\n",
"<line stroke=\"white\" stroke-width=\"4\" x1=\"200\" x2=\"200\" y1=\"0\" y2=\"100\"/>\n",
"<line stroke=\"white\" stroke-width=\"4\" x1=\"0\" x2=\"300\" y1=\"0\" y2=\"0\"/><text font-size=\"20\" text-anchor=\"start\" x=\"3\" y=\"30\">a</text><line stroke=\"white\" stroke-width=\"1\" x1=\"50\" x2=\"50\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"0\" x2=\"50\" y1=\"5\" y2=\"5\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"100\" x2=\"100\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"50\" x2=\"100\" y1=\"5\" y2=\"5\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"150\" x2=\"150\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"100\" x2=\"100\" y1=\"5\" y2=\"45\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"100\" x2=\"150\" y1=\"45\" y2=\"45\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"200\" x2=\"200\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"150\" x2=\"200\" y1=\"45\" y2=\"45\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"250\" x2=\"250\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"200\" x2=\"250\" y1=\"45\" y2=\"45\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"300\" x2=\"300\" y1=\"0\" y2=\"50\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"250\" x2=\"300\" y1=\"45\" y2=\"45\"/><line stroke=\"white\" stroke-width=\"4\" x1=\"0\" x2=\"300\" y1=\"50\" y2=\"50\"/><text font-size=\"20\" text-anchor=\"start\" x=\"3\" y=\"80\">b</text><line stroke=\"white\" stroke-width=\"1\" x1=\"50\" x2=\"50\" y1=\"50\" y2=\"100\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"100\" x2=\"100\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"50\" x2=\"100\" y1=\"55\" y2=\"55\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"150\" x2=\"150\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"100\" x2=\"100\" y1=\"55\" y2=\"95\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"100\" x2=\"150\" y1=\"95\" y2=\"95\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"200\" x2=\"200\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"150\" x2=\"150\" y1=\"55\" y2=\"95\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"150\" x2=\"200\" y1=\"55\" y2=\"55\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"250\" x2=\"250\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"200\" x2=\"200\" y1=\"55\" y2=\"95\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"200\" x2=\"250\" y1=\"95\" y2=\"95\"/><line stroke=\"white\" stroke-width=\"1\" x1=\"300\" x2=\"300\" y1=\"50\" y2=\"100\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"250\" x2=\"250\" y1=\"55\" y2=\"95\"/><line stroke=\"#ff0000\" stroke-width=\"2\" x1=\"250\" x2=\"300\" y1=\"55\" y2=\"55\"/><text font-size=\"10\" text-anchor=\"start\" x=\"0\" y=\"110\">prefix</text><text font-size=\"10\" text-anchor=\"start\" x=\"100\" y=\"110\">cycle</text>\n",
"<text font-size=\"10\" text-anchor=\"start\" x=\"200\" y=\"110\">cycle</text></svg>"
],
"text": [
"<IPython.core.display.SVG object>"
]
}
],
"prompt_number": 12
},
{
"cell_type": "markdown",
......@@ -453,7 +487,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 11
"prompt_number": 13
},
{
"cell_type": "code",
......@@ -467,7 +501,7 @@
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 12,
"prompt_number": 14,
"svg": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
......@@ -545,17 +579,17 @@
"</svg>\n"
],
"text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fdf783f0e40> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb74c39d990> >"
]
}
],
"prompt_number": 12
"prompt_number": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The rest of this pages tests some syntax errors, you (humans) may skip it, but the test suite will not."
"The rest of this page tests some syntax errors, you (humans) may skip it, but the test suite will not."
]
},
{
......@@ -576,7 +610,7 @@
]
}
],
"prompt_number": 13
"prompt_number": 15
},
{
"cell_type": "code",
......@@ -596,7 +630,7 @@
]
}
],
"prompt_number": 14
"prompt_number": 16
},
{
"cell_type": "code",
......@@ -616,7 +650,7 @@
]
}
],
"prompt_number": 15
"prompt_number": 17
},
{
"cell_type": "code",
......@@ -636,7 +670,7 @@
]
}
],
"prompt_number": 16
"prompt_number": 18
},
{
"cell_type": "code",
......@@ -648,7 +682,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 17
"prompt_number": 19
},
{
"cell_type": "code",
......@@ -667,13 +701,13 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-18-971829bb8f5f>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# ... as long as this word is not printed.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/home/adl/git/spot/python/spot/impl.py\u001b[0m in \u001b[0;36m__str__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 4160\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4161\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__str__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;34m\"std::string\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 4162\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_impl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtwa_word___str__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4163\u001b[0m \u001b[0mtwa_word_swigregister\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_impl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtwa_word_swigregister\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4164\u001b[0m \u001b[0mtwa_word_swigregister\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtwa_word\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m<ipython-input-20-9968db49e707>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# ... as long as this word is not printed.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/home/adl/git/spot/python/spot/impl.py\u001b[0m in \u001b[0;36m__str__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 4922\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4923\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__str__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;34m\"std::string\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 4924\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_impl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtwa_word___str__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4925\u001b[0m \u001b[0mtwa_word_swigregister\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_impl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtwa_word_swigregister\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4926\u001b[0m \u001b[0mtwa_word_swigregister\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtwa_word\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mRuntimeError\u001b[0m: a twa_word may not have an empty cycle"
]
}
],
"prompt_number": 18
"prompt_number": 20
}
],
"metadata": {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment