Commit 69b687ab authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

dot: preserve highlights for <N output

* spot/twa/twagraph.hh (twa_graph::edge_number): New method.
* spot/twaalgos/copy.cc: Copy the highlights if requested.
* tests/python/highlighting.ipynb: More tests.
parent 014a9dbd
...@@ -318,10 +318,15 @@ namespace spot ...@@ -318,10 +318,15 @@ namespace spot
return format_state(state_number(st)); return format_state(state_number(st));
} }
twa_graph_edge_data& edge_data(const twa_succ_iterator* it) unsigned edge_number(const twa_succ_iterator* it) const
{ {
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it); auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it);
return g_.edge_data(i->pos()); return i->pos();
}
twa_graph_edge_data& edge_data(const twa_succ_iterator* it)
{
return g_.edge_data(edge_number(it));
} }
twa_graph_edge_data& edge_data(unsigned t) twa_graph_edge_data& edge_data(unsigned t)
...@@ -331,8 +336,7 @@ namespace spot ...@@ -331,8 +336,7 @@ namespace spot
const twa_graph_edge_data& edge_data(const twa_succ_iterator* it) const const twa_graph_edge_data& edge_data(const twa_succ_iterator* it) const
{ {
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it); return g_.edge_data(edge_number(it));
return g_.edge_data(i->pos());
} }
const twa_graph_edge_data& edge_data(unsigned t) const const twa_graph_edge_data& edge_data(unsigned t) const
...@@ -342,8 +346,7 @@ namespace spot ...@@ -342,8 +346,7 @@ namespace spot
edge_storage_t& edge_storage(const twa_succ_iterator* it) edge_storage_t& edge_storage(const twa_succ_iterator* it)
{ {
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it); return g_.edge_storage(edge_number(it));
return g_.edge_storage(i->pos());
} }
edge_storage_t& edge_storage(unsigned t) edge_storage_t& edge_storage(unsigned t)
...@@ -354,8 +357,7 @@ namespace spot ...@@ -354,8 +357,7 @@ namespace spot
const edge_storage_t const edge_storage_t
edge_storage(const twa_succ_iterator* it) const edge_storage(const twa_succ_iterator* it) const
{ {
auto* i = down_cast<const twa_graph_succ_iterator<graph_t>*>(it); return g_.edge_storage(edge_number(it));
return g_.edge_storage(i->pos());
} }
const edge_storage_t edge_storage(unsigned t) const const edge_storage_t edge_storage(unsigned t) const
......
...@@ -34,12 +34,36 @@ namespace spot ...@@ -34,12 +34,36 @@ namespace spot
out->copy_acceptance_of(aut); out->copy_acceptance_of(aut);
out->copy_ap_of(aut); out->copy_ap_of(aut);
out->prop_copy(aut, p); out->prop_copy(aut, p);
std::vector<std::string>* names = nullptr; std::vector<std::string>* names = nullptr;
std::set<unsigned>* incomplete = nullptr; std::set<unsigned>* incomplete = nullptr;
// Old highlighting maps
typedef std::map<unsigned, unsigned> hmap;
hmap* ohstates = nullptr;
hmap* ohedges = nullptr;
const_twa_graph_ptr aut_g = nullptr;
// New highlighting maps
hmap* nhstates = nullptr;
hmap* nhedges = nullptr;
if (preserve_names) if (preserve_names)
{ {
names = new std::vector<std::string>; names = new std::vector<std::string>;
out->set_named_prop("state-names", names); out->set_named_prop("state-names", names);
// If the input is a twa_graph and we were asked to preserve
// names, also preserve highlights.
aut_g = std::dynamic_pointer_cast<const twa_graph>(aut);
if (aut_g)
{
ohstates = aut->get_named_prop<hmap>("highlight-states");
if (ohstates)
nhstates = out->get_or_set_named_prop<hmap>("highlight-states");
ohedges = aut->get_named_prop<hmap>("highlight-edges");
if (ohedges)
nhedges = out->get_or_set_named_prop<hmap>("highlight-edges");
}
} }
// States already seen. // States already seen.
...@@ -56,6 +80,12 @@ namespace spot ...@@ -56,6 +80,12 @@ namespace spot
todo.push_back(p.first); todo.push_back(p.first);
if (names) if (names)
names->push_back(aut->format_state(s)); names->push_back(aut->format_state(s));
if (ohstates)
{
auto q = ohstates->find(aut_g->state_number(s));
if (q != ohstates->end())
nhstates->emplace(p.first->second, q->second);
}
} }
else else
{ {
...@@ -73,6 +103,7 @@ namespace spot ...@@ -73,6 +103,7 @@ namespace spot
todo.pop_front(); todo.pop_front();
for (auto* t: aut->succ(src1)) for (auto* t: aut->succ(src1))
{ {
unsigned edgenum = 0;
if (SPOT_UNLIKELY(max_states < out->num_states())) if (SPOT_UNLIKELY(max_states < out->num_states()))
{ {
// If we have reached the max number of state, never try // If we have reached the max number of state, never try
...@@ -85,11 +116,18 @@ namespace spot ...@@ -85,11 +116,18 @@ namespace spot
incomplete->insert(src2); incomplete->insert(src2);
continue; continue;
} }
out->new_edge(src2, i->second, t->cond(), t->acc()); edgenum = out->new_edge(src2, i->second, t->cond(), t->acc());
} }
else else
{ {
out->new_edge(src2, new_state(t->dst()), t->cond(), t->acc()); edgenum =
out->new_edge(src2, new_state(t->dst()), t->cond(), t->acc());
}
if (ohedges)
{
auto q = ohedges->find(aut_g->edge_number(t));
if (q != ohedges->end())
nhedges->emplace(edgenum, q->second);
} }
} }
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"version": "3.4.3+" "version": "3.4.3+"
}, },
"name": "", "name": "",
"signature": "sha256:f8755e90b26b56799cf6192d76999196f60eefa8307d0d104b73f476904754cc" "signature": "sha256:024df96495fac2f6862d63f78750ad9279a60f4e73ad02643779e5dc6a1f1982"
}, },
"nbformat": 3, "nbformat": 3,
"nbformat_minor": 0, "nbformat_minor": 0,
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
"</svg>" "</svg>"
], ],
"text": [ "text": [
"<IPython.core.display.SVG at 0x7f859c2ba588>" "<IPython.core.display.SVG at 0x7fe2a411c588>"
] ]
} }
], ],
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f859c0838a0> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a40ed8a0> >"
] ]
} }
], ],
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.twa; proxy of <Swig Object of type 'std::shared_ptr< spot::twa > *' at 0x7f8595d88f60> >" "<spot.twa; proxy of <Swig Object of type 'std::shared_ptr< spot::twa > *' at 0x7fe2a4061f90> >"
] ]
} }
], ],
...@@ -367,7 +367,7 @@ ...@@ -367,7 +367,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Saving the HOA 1.1\n", "# Saving to HOA 1.1\n",
"\n", "\n",
"When saving to HOA format, the highlighting is only output if version 1.1 of the format is selected, because the headers `spot.highlight.edges` and `spot.highlight.states` contain dots, which are disallowed in version 1. Compare these two outputs:" "When saving to HOA format, the highlighting is only output if version 1.1 of the format is selected, because the headers `spot.highlight.edges` and `spot.highlight.states` contain dots, which are disallowed in version 1. Compare these two outputs:"
] ]
...@@ -572,7 +572,7 @@ ...@@ -572,7 +572,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f8595d88fc0> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf0f0> >"
] ]
} }
], ],
...@@ -751,7 +751,7 @@ ...@@ -751,7 +751,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f8595d88fc0> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf0f0> >"
] ]
} }
], ],
...@@ -831,7 +831,7 @@ ...@@ -831,7 +831,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e090> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf090> >"
] ]
}, },
{ {
...@@ -877,7 +877,7 @@ ...@@ -877,7 +877,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e060> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf030> >"
] ]
} }
], ],
...@@ -963,7 +963,7 @@ ...@@ -963,7 +963,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f8595d88d20> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a4061fc0> >"
] ]
} }
], ],
...@@ -1088,7 +1088,7 @@ ...@@ -1088,7 +1088,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f8595d88d20> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a4061fc0> >"
] ]
}, },
{ {
...@@ -1145,7 +1145,7 @@ ...@@ -1145,7 +1145,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e090> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf090> >"
] ]
}, },
{ {
...@@ -1191,7 +1191,7 @@ ...@@ -1191,7 +1191,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e060> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf030> >"
] ]
} }
], ],
...@@ -1398,7 +1398,7 @@ ...@@ -1398,7 +1398,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_product; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_product > *' at 0x7f85a187e120> >" "<spot.impl.twa_product; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_product > *' at 0x7fe2a8edf150> >"
] ]
}, },
{ {
...@@ -1472,7 +1472,7 @@ ...@@ -1472,7 +1472,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e0f0> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf120> >"
] ]
}, },
{ {
...@@ -1556,7 +1556,7 @@ ...@@ -1556,7 +1556,7 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e150> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf180> >"
] ]
} }
], ],
...@@ -1702,11 +1702,186 @@ ...@@ -1702,11 +1702,186 @@
"</svg>\n" "</svg>\n"
], ],
"text": [ "text": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f85a187e240> >" "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2a8edf270> >"
] ]
} }
], ],
"prompt_number": 17 "prompt_number": 17
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Highlighting with partial output\n",
"\n",
"For simplicity, rendering of partial automata is actually implemented by copying the original automaton and marking some states as \"incomplete\". This also allows the same display code to work with automata generated on-the-fly. However since there is a copy, propagating the highlighting information requires extra work. Let's make sure it has been done:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"display(b.show('.<4'), b.show('.<2'))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"svg": [
"<svg height=\"302pt\" viewBox=\"0.00 0.00 276.50 301.50\" width=\"277pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 297.5)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-297.5 272.5,-297.5 272.5,4 -4,4\" stroke=\"none\"/>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"56\" cy=\"-153\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56\" y=\"-149.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\"><title>I-&gt;0</title>\n",
"<path d=\"M1.15491,-153C2.79388,-153 17.1543,-153 30.6317,-153\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"37.9419,-153 30.9419,-156.15 34.4419,-153 30.9419,-153 30.9419,-153 30.9419,-153 34.4419,-153 30.9418,-149.85 37.9419,-153 37.9419,-153\" stroke=\"black\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"137\" cy=\"-153\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#f15854\" stroke-width=\"2\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"137\" y=\"-149.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\"><title>0-&gt;1</title>\n",
"<path d=\"M74.1418,-153C85.1153,-153 99.5214,-153 111.67,-153\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"118.892,-153 111.892,-156.15 115.392,-153 111.892,-153 111.892,-153 111.892,-153 115.392,-153 111.892,-149.85 118.892,-153 118.892,-153\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"96.5\" y=\"-156.8\">1</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\"><title>1-&gt;1</title>\n",
"<path d=\"M129.969,-169.664C128.406,-179.625 130.75,-189 137,-189 141.688,-189 144.178,-183.727 144.471,-176.888\" fill=\"none\" stroke=\"#60bd68\" stroke-width=\"2\"/>\n",
"<polygon fill=\"#60bd68\" points=\"144.031,-169.664 147.601,-176.46 144.743,-173.127 144.955,-176.621 144.456,-176.651 143.957,-176.682 143.745,-173.188 141.312,-176.842 144.031,-169.664 144.031,-169.664\" stroke=\"#60bd68\" stroke-width=\"2\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"123.5\" y=\"-192.8\">a | b</text>\n",
"</g>\n",
"<!-- u1 -->\n",
"<g class=\"node\" id=\"node4\"><title>u1</title>\n",
"<polygon fill=\"#ffffaa\" points=\"263,-293.5 237,-293.5 237,-270.5 263,-270.5 263,-293.5\" stroke=\"none\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250\" y=\"-278.3\">...</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;u1 -->\n",
"<g class=\"edge\" id=\"edge3\"><title>1-&gt;u1</title>\n",
"<path d=\"M149.461,-166.319C169.751,-189.899 211.956,-238.949 234.334,-264.956\" fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\"/>\n",
"<polygon fill=\"black\" points=\"239.053,-270.44 232.1,-267.189 236.77,-267.787 234.488,-265.134 234.488,-265.134 234.488,-265.134 236.77,-267.787 236.875,-263.08 239.053,-270.44 239.053,-270.44\" stroke=\"black\"/>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node5\"><title>2</title>\n",
"<ellipse cx=\"250\" cy=\"-153\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250\" y=\"-149.3\">2</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge5\"><title>1-&gt;2</title>\n",
"<path d=\"M155.344,-153C173.998,-153 203.797,-153 224.763,-153\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"231.778,-153 224.778,-156.15 228.278,-153 224.778,-153 224.778,-153 224.778,-153 228.278,-153 224.778,-149.85 231.778,-153 231.778,-153\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"173\" y=\"-156.8\">!a &amp; !b</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node6\"><title>3</title>\n",
"<ellipse cx=\"250\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250\" y=\"-14.3\">3</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge6\"><title>1-&gt;3</title>\n",
"<path d=\"M149.049,-139.562C168.81,-115.528 210.269,-65.1054 233.092,-37.3471\" fill=\"none\" stroke=\"#60bd68\" stroke-width=\"2\"/>\n",
"<polygon fill=\"#60bd68\" points=\"237.665,-31.7854 235.653,-39.193 235.829,-34.8065 233.606,-37.51 233.22,-37.1924 232.833,-36.8749 235.056,-34.1714 230.786,-35.1919 237.665,-31.7854 237.665,-31.7854\" stroke=\"#60bd68\" stroke-width=\"2\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"176.5\" y=\"-112.8\">a &amp; b</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge7\"><title>2-&gt;2</title>\n",
"<path d=\"M245.001,-170.41C244.068,-180.088 245.734,-189 250,-189 253.133,-189 254.863,-184.194 255.192,-177.807\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"254.999,-170.41 258.331,-177.325 255.09,-173.909 255.182,-177.408 255.182,-177.408 255.182,-177.408 255.09,-173.909 252.033,-177.49 254.999,-170.41 254.999,-170.41\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"245.5\" y=\"-192.8\">b</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge8\"><title>2-&gt;2</title>\n",
"<path d=\"M242.044,-169.308C236.903,-186.96 239.555,-207 250,-207 259.058,-207 262.256,-191.93 259.592,-176.415\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"257.956,-169.308 262.596,-175.423 258.742,-172.719 259.527,-176.13 259.527,-176.13 259.527,-176.13 258.742,-172.719 256.457,-176.837 257.956,-169.308 257.956,-169.308\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"243.5\" y=\"-225.8\">!b</text>\n",
"<text fill=\"#5da5da\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"242\" y=\"-210.8\">\u24ff</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge9\"><title>3-&gt;3</title>\n",
"<path d=\"M245.001,-35.4099C244.068,-45.0879 245.734,-54 250,-54 253.133,-54 254.863,-49.1936 255.192,-42.8073\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"254.999,-35.4099 258.331,-42.3252 255.09,-38.9087 255.182,-42.4075 255.182,-42.4075 255.182,-42.4075 255.09,-38.9087 252.033,-42.4899 254.999,-35.4099 254.999,-35.4099\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"233\" y=\"-57.8\">a &amp; b</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\"><title>3-&gt;3</title>\n",
"<path d=\"M242.044,-34.3083C236.903,-51.9604 239.555,-72 250,-72 259.058,-72 262.256,-56.9299 259.592,-41.4154\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"257.956,-34.3083 262.596,-40.4232 258.742,-37.7191 259.527,-41.1299 259.527,-41.1299 259.527,-41.1299 258.742,-37.7191 256.457,-41.8366 257.956,-34.3083 257.956,-34.3083\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"231.5\" y=\"-90.8\">a &amp; !b</text>\n",
"<text fill=\"#5da5da\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"242\" y=\"-75.8\">\u24ff</text>\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x7fe2a4013240>"
]
},
{
"metadata": {},
"output_type": "display_data",
"svg": [
"<svg height=\"77pt\" viewBox=\"0.00 0.00 226.00 77.00\" width=\"226pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 73)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-73 222,-73 222,4 -4,4\" stroke=\"none\"/>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"56\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56\" y=\"-14.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\"><title>I-&gt;0</title>\n",
"<path d=\"M1.15491,-18C2.79388,-18 17.1543,-18 30.6317,-18\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"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\" stroke=\"black\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"137\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#f15854\" stroke-width=\"2\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"137\" y=\"-14.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\"><title>0-&gt;1</title>\n",
"<path d=\"M74.1418,-18C85.1153,-18 99.5214,-18 111.67,-18\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"118.892,-18 111.892,-21.1501 115.392,-18 111.892,-18.0001 111.892,-18.0001 111.892,-18.0001 115.392,-18 111.892,-14.8501 118.892,-18 118.892,-18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"96.5\" y=\"-21.8\">1</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\"><title>1-&gt;1</title>\n",
"<path d=\"M130.621,-35.0373C129.319,-44.8579 131.445,-54 137,-54 141.166,-54 143.404,-48.8576 143.713,-42.1433\" fill=\"none\" stroke=\"#60bd68\" stroke-width=\"2\"/>\n",
"<polygon fill=\"#60bd68\" points=\"143.379,-35.0373 146.854,-41.8818 144.043,-38.51 144.207,-42.0062 143.708,-42.0296 143.208,-42.0531 143.044,-38.5569 140.561,-42.1774 143.379,-35.0373 143.379,-35.0373\" stroke=\"#60bd68\" stroke-width=\"2\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"123.5\" y=\"-57.8\">a | b</text>\n",
"</g>\n",
"<!-- u1 -->\n",
"<g class=\"node\" id=\"node4\"><title>u1</title>\n",
"<polygon fill=\"#ffffaa\" points=\"218,-29.5 192,-29.5 192,-6.5 218,-6.5 218,-29.5\" stroke=\"none\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"205\" y=\"-14.3\">...</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;u1 -->\n",
"<g class=\"edge\" id=\"edge3\"><title>1-&gt;u1</title>\n",
"<path d=\"M155.341,-18C164.382,-18 175.464,-18 184.767,-18\" fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\"/>\n",
"<polygon fill=\"black\" points=\"191.774,-18 184.774,-21.1501 188.274,-18 184.774,-18.0001 184.774,-18.0001 184.774,-18.0001 188.274,-18 184.774,-14.8501 191.774,-18 191.774,-18\" stroke=\"black\"/>\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x7fe2a402f860>"
]
}
],
"prompt_number": 18
} }
], ],
"metadata": {} "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