diff --git a/doc/org/tut24.org b/doc/org/tut24.org index 8768053e8..220ff2796 100644 --- a/doc/org/tut24.org +++ b/doc/org/tut24.org @@ -107,7 +107,7 @@ for (unsigned s = 0; s < n; ++s) #+RESULTS: nonalt-one #+begin_example -Initial state: 4294967292 +Initial state: 4294967295 State 0: edge(0 -> 0) label = a diff --git a/spot/parseaut/parseaut.yy b/spot/parseaut/parseaut.yy index 0ec23f95d..047ed40fc 100644 --- a/spot/parseaut/parseaut.yy +++ b/spot/parseaut/parseaut.yy @@ -2423,6 +2423,8 @@ namespace spot fix_acceptance(r); fix_initial_state(r); fix_properties(r); + if (r.h->aut && r.h->aut->is_alternating()) + r.h->aut->merge_univ_dests(); return r.h; }; diff --git a/spot/twa/twagraph.cc b/spot/twa/twagraph.cc index 018268def..4fcae4d31 100644 --- a/spot/twa/twagraph.cc +++ b/spot/twa/twagraph.cc @@ -43,10 +43,66 @@ namespace spot delete namer; } + /// \brief Merge universal destinations + /// + /// If several states have the same universal destination, merge + /// them all. Also remove unused destination, and any redundant + /// state in each destination. + void twa_graph::merge_univ_dests() + { + auto& g = get_graph(); + auto& dests = g.dests_vector(); + auto& edges = g.edge_vector(); + + std::vector old_dests; + std::swap(dests, old_dests); + std::vector seen(old_dests.size(), -1U); + std::map, unsigned> uniq; + + auto fixup = [&](unsigned& in_dst) + { + unsigned dst = in_dst; + if ((int) dst >= 0) // not a universal edge + return; + dst = ~dst; + unsigned& nd = seen[dst]; + if (nd == -1U) + { + std::vector + tmp(old_dests.data() + dst + 1, + old_dests.data() + dst + 1 + old_dests[dst]); + std::sort(tmp.begin(), tmp.end()); + tmp.erase(std::unique(tmp.begin(), tmp.end()), tmp.end()); + auto p = uniq.emplace(tmp, 0); + if (!p.second) + { + nd = p.first->second; + } + else + { + nd = g.new_univ_dests(tmp.begin(), tmp.end()); + p.first->second = nd; + } + } + in_dst = nd; + }; + + unsigned tend = edges.size(); + for (unsigned t = 1; t < tend; t++) + { + if (g.is_dead_edge(t)) + continue; + fixup(edges[t].dst); + } + fixup(init_number_); + } + void twa_graph::merge_edges() { set_named_prop("highlight-edges", nullptr); g_.remove_dead_edges_(); + if (is_alternating()) + merge_univ_dests(); typedef graph_t::edge_storage_t tr_t; g_.sort_edges_([](const tr_t& lhs, const tr_t& rhs) diff --git a/spot/twa/twagraph.hh b/spot/twa/twagraph.hh index 8df858da5..ccab488ab 100644 --- a/spot/twa/twagraph.hh +++ b/spot/twa/twagraph.hh @@ -521,6 +521,11 @@ namespace spot /// extremities and acceptance. void merge_edges(); + /// \brief marge common universal destination + /// + /// This is already called by merge_edges(). + void merge_univ_dests(); + /// \brief Remove all dead states /// /// Dead states are all the states that cannot be part of diff --git a/spot/twaalgos/dot.cc b/spot/twaalgos/dot.cc index aa808d97f..274fa9031 100644 --- a/spot/twaalgos/dot.cc +++ b/spot/twaalgos/dot.cc @@ -360,10 +360,14 @@ namespace spot return bdd_format_formula(aut_->get_dict(), label); } + std::set done; + void print_dst(int dst, const char* style = nullptr) { - os_ << " " << dst << " [label=<>,width=0,height=0,shape=none]\n"; + if (!done.emplace(dst).second) + return; + os_ << " " << dst << " [label=<>,shape=point]\n"; for (unsigned d: aut_->univ_dests(dst)) { os_ << " " << dst << " -> " << d; @@ -465,7 +469,7 @@ namespace spot } else { - os_ << " [dir=none]\n"; + os_ << " [arrowhead=onormal]\n"; print_dst(init); } } @@ -626,11 +630,10 @@ namespace spot os_ << ", " << highlight; } } - // No arrow tip of the common part of a universal transition - if ((int)t.dst < 0) - os_ << ", dir=none"; + if (aut_->is_univ_dest(t.dst)) + os_ << ", arrowhead=onormal"; os_ << "]\n"; - if ((int)t.dst < 0) // Universal destination + if (aut_->is_univ_dest(t.dst)) print_dst(t.dst, highlight.c_str()); } diff --git a/tests/core/alternating.test b/tests/core/alternating.test index 345dd7203..65343b2a4 100644 --- a/tests/core/alternating.test +++ b/tests/core/alternating.test @@ -61,34 +61,34 @@ digraph G { label="Fin(⓿)" labelloc="t" I [label="", style=invis, width=0] - I -> -11 [dir=none] - -11 [label=<>,width=0,height=0,shape=none] + I -> -11 [arrowhead=onormal] + -11 [label=<>,shape=point] -11 -> 0 -11 -> 2 subgraph cluster_0 { color=green label="" - 6 [label="t"] + 2 [label="G(a)"] } subgraph cluster_1 { color=red label="" - 4 [label="F(b)\n⓿"] + 1 [label="FG(a)\n⓿"] } subgraph cluster_2 { color=green label="" - 3 [label="GF(b)"] + 6 [label="t"] } subgraph cluster_3 { - color=green - label="" - 2 [label="G(a)"] - } - subgraph cluster_4 { color=red label="" - 1 [label="FG(a)\n⓿"] + 4 [label="F(b)\n⓿"] + } + subgraph cluster_4 { + color=green + label="" + 3 [label="GF(b)"] } subgraph cluster_5 { color=red @@ -100,23 +100,23 @@ digraph G { label="" 0 [label="((((a) U (b)) && GF(b)) && FG(a))"] } - 0 -> -1 [label="b", dir=none] - -1 [label=<>,width=0,height=0,shape=none] - -1 -> 3 + 0 -> -1 [label="b", arrowhead=onormal] + -1 [label=<>,shape=point] -1 -> 1 - 0 -> -4 [label="a & !b", style=bold, color="#F15854", dir=none] - -4 [label=<>,width=0,height=0,shape=none] - -4 -> 5 [style=bold, color="#F15854"] - -4 -> 3 [style=bold, color="#F15854"] + -1 -> 3 + 0 -> -4 [label="a & !b", style=bold, color="#F15854", arrowhead=onormal] + -4 [label=<>,shape=point] -4 -> 1 [style=bold, color="#F15854"] + -4 -> 3 [style=bold, color="#F15854"] + -4 -> 5 [style=bold, color="#F15854"] 1 -> 2 [label="a"] 1 -> 1 [label="1"] 2 -> 2 [label="a"] 3 -> 3 [label="b"] - 3 -> -8 [label="!b", style=bold, color="#FAA43A", dir=none] - -8 [label=<>,width=0,height=0,shape=none] - -8 -> 4 [style=bold, color="#FAA43A"] + 3 -> -8 [label="!b", style=bold, color="#FAA43A", arrowhead=onormal] + -8 [label=<>,shape=point] -8 -> 3 [style=bold, color="#FAA43A"] + -8 -> 4 [style=bold, color="#FAA43A"] 4 -> 6 [label="b"] 4 -> 4 [label="!b"] 5 -> 6 [label="b"] @@ -147,7 +147,7 @@ AP: 1 "a" properties: trans-labels explicit-labels state-acc univ-branch very-weak --BODY-- State: 0 "GF(a)" - [t] 1&0 + [t] 0&1 State: 1 "F(a)" {0} [(0)] 2 [t] 1 @@ -172,7 +172,7 @@ properties: univ-branch trans-labels explicit-labels state-acc complete properties: very-weak --BODY-- State: 0 {0} -[t] 1&0 +[t] 0&1 State: 1 [0] 2 [t] 1 diff --git a/tests/core/complete.test b/tests/core/complete.test index e69042b79..007e86747 100755 --- a/tests/core/complete.test +++ b/tests/core/complete.test @@ -203,7 +203,7 @@ properties: deterministic very-weak --BODY-- State: 0 [!0 | 1] 0 -[0&!1] 1&0 +[0&!1] 0&1 State: 1 {0} [0&!1] 1 [!0 | 1] 1 diff --git a/tests/core/parseaut.test b/tests/core/parseaut.test index 0cdf97ea6..270624432 100755 --- a/tests/core/parseaut.test +++ b/tests/core/parseaut.test @@ -1946,7 +1946,7 @@ State: 5 "F!((c2))" {0} [t] 5 State: 6 "GF!((c1))" [!1] 6 -[t] 7&6 +[t] 6&7 State: 7 "F!((c1))" {0} [!1] 11 [t] 7 @@ -1954,9 +1954,9 @@ State: 8 "((!((c1)) U (!((c1)) && !((p1)))) R F!((p2)))" [!0&!1&!2] 11 [!1&!2] 10 [!0&!1] 9 -[!1] 10&9 +[!1] 9&10 [!0] 8 -[t] 10&8 +[t] 8&10 State: 9 "(!((c1)) U (!((c1)) && !((p1))))" {0} [!1&!2] 11 [!1] 9 @@ -2407,8 +2407,8 @@ properties: univ-branch trans-labels explicit-labels state-acc properties: very-weak --BODY-- State: 0 "((((a) U (b)) && GF(b)) && FG(a))" -[0] 3&1 -[!0&1] 5&3&1 +[0] 1&3 +[!0&1] 1&3&5 State: 1 "FG(a)" {0} [1] 2 [t] 1 @@ -2416,7 +2416,7 @@ State: 2 "G(a)" [1] 2 State: 3 "GF(b)" [0] 3 -[!0] 4&3 +[!0] 3&4 State: 4 "F(b)" {0} [0] 6 [!0] 4 @@ -2438,18 +2438,18 @@ properties: deterministic State: 0 [!0&!1] 0&1 [0&!1] 1 -[!0&1] 0&2&1 +[!0&1] 0&1&2 [0&1] 0&1 State: 1 [!0&!1] 0&1 -[0&!1] 2&1 +[0&!1] 1&2 [!0&1] 2 -[0&1] 1&1 +[0&1] 1 State: 2 [!0&!1] 0&1 -[0&!1] 2&1 +[0&!1] 1&2 [!0&1] 2 -[0&1] 0&2&1 +[0&1] 0&1&2 --END-- EOF @@ -2613,8 +2613,8 @@ properties: univ-branch trans-labels explicit-labels state-acc properties: very-weak --BODY-- State: 0 "((((a) U (b)) && GF(b)) && FG(a))" -[0] 3&1 -[!0&1] 5&3&1 +[0] 1&3 +[!0&1] 1&3&5 State: 1 "FG(a)" {0} [1] 2 [t] 1 @@ -2622,7 +2622,7 @@ State: 2 "G(a)" [1] 2 State: 3 "GF(b)" [0] 3 -[!0] 4&3 +[!0] 3&4 State: 4 "F(b)" {0} [0] 6 [!0] 4 @@ -2644,18 +2644,18 @@ properties: deterministic State: 0 [!0&!1] 0&1 [0&!1] 1 -[!0&1] 0&2&1 +[!0&1] 0&1&2 [0&1] 0&1 State: 1 [!0&!1] 0&1 -[0&!1] 2&1 +[0&!1] 1&2 [!0&1] 2 -[0&1] 1&1 +[0&1] 1 State: 2 [!0&!1] 0&1 -[0&!1] 2&1 +[0&!1] 1&2 [!0&1] 2 -[0&1] 0&2&1 +[0&1] 0&1&2 --END-- EOF diff --git a/tests/python/_altscc.ipynb b/tests/python/_altscc.ipynb index d448119ef..1a5da1624 100644 --- a/tests/python/_altscc.ipynb +++ b/tests/python/_altscc.ipynb @@ -41,7 +41,7 @@ "language": "python", "metadata": {}, "outputs": [], - "prompt_number": 2 + "prompt_number": 1 }, { "cell_type": "code", @@ -69,7 +69,7 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 12, + "prompt_number": 2, "svg": [ "\n", "\n", "\n", - "\n", + "\n", "\n", "G\n", - "\n", - "Inf(\n", - "\u24ff\n", - ")\n", + "\n", + "Inf(\n", + "\u24ff\n", + ")\n", "cluster_0\n", - "\n", + "\n", "\n", "cluster_1\n", - "\n", + "\n", "\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "I->-1\n", - "\n", + "\n", + "\n", "\n", "\n", "0\n", - "\n", - "0\n", + "\n", + "0\n", "\n", "\n", "-1->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "1\n", - "\n", - "1\n", + "\n", + "1\n", "\n", "\n", "-1->1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "0->0\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "0->1\n", - "\n", - "\n", - "!a\n", + "\n", + "\n", + "!a\n", "\n", "\n", "1->1\n", - "\n", - "\n", - "b\n", - "\u24ff\n", + "\n", + "\n", + "b\n", + "\u24ff\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7f76dc5d7090> >" + " *' at 0x7f7620378330> >" ] } ], - "prompt_number": 12 + "prompt_number": 2 }, { "cell_type": "markdown", @@ -180,7 +181,7 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 17, + "prompt_number": 3, "svg": [ "\n", "\n", "\n", - "\n", + "\n", "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "cluster_0\n", - "\n", + "\n", "\n", "cluster_1\n", - "\n", + "\n", "\n", "\n", - "\n", - "-4\n", - "\n", + "\n", + "-1\n", + "\n", "\n", - "\n", - "I->-4\n", - "\n", + "\n", + "I->-1\n", + "\n", + "\n", "\n", "\n", "0\n", - "\n", - "0\n", + "\n", + "0\n", "\n", - "\n", - "-4->0\n", - "\n", - "\n", + "\n", + "-1->0\n", + "\n", + "\n", "\n", "\n", "1\n", - "\n", - "1\n", + "\n", + "1\n", "\n", - "\n", - "-4->1\n", - "\n", - "\n", - "\n", - "\n", - "-1\n", - "\n", + "\n", + "-1->1\n", + "\n", + "\n", "\n", "\n", "0->-1\n", - "\n", - "a\n", - "\u24ff\n", + "\n", + "\n", + "a\n", + "\u24ff\n", "\n", "\n", - "1->1\n", - "\n", - "\n", - "b\n", - "\n", - "\n", - "-1->0\n", - "\n", - "\n", - "\n", - "\n", - "-1->1\n", - "\n", - "\n", + "1->1\n", + "\n", + "\n", + "b\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7f76dc5d71b0> >" + " *' at 0x7f7620378870> >" ] } ], - "prompt_number": 17 + "prompt_number": 3 }, { "cell_type": "code", @@ -292,7 +281,7 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 16, + "prompt_number": 4, "svg": [ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "cluster_0\n", - "\n", + "\n", "\n", "\n", - "\n", - "-4\n", - "\n", + "\n", + "-1\n", + "\n", "\n", - "\n", - "I->-4\n", - "\n", + "\n", + "I->-1\n", + "\n", + "\n", "\n", "\n", "0\n", - "\n", - "0\n", + "\n", + "0\n", "\n", - "\n", - "-4->0\n", - "\n", - "\n", + "\n", + "-1->0\n", + "\n", + "\n", "\n", "\n", "1\n", - "\n", - "1\n", + "\n", + "1\n", "\n", - "\n", - "-4->1\n", - "\n", - "\n", + "\n", + "-1->1\n", + "\n", + "\n", "\n", "\n", "0->0\n", - "\n", - "\n", - "a\n", - "\u24ff\n", + "\n", + "\n", + "a\n", + "\u24ff\n", "\n", "\n", "0->1\n", - "\n", - "\n", - "!a\n", - "\n", - "\n", - "-1\n", - "\n", + "\n", + "\n", + "!a\n", "\n", "\n", "1->-1\n", - "\n", - "b\n", - "\n", - "\n", - "-1->0\n", - "\n", - "\n", - "\n", - "\n", - "-1->1\n", - "\n", - "\n", + "\n", + "\n", + "b\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7f76dc5d7180> >" + " *' at 0x7f7620378390> >" ] } ], - "prompt_number": 16 + "prompt_number": 4 }, { "cell_type": "code", @@ -407,7 +384,7 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 30, + "prompt_number": 5, "svg": [ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "cluster_0\n", - "\n", + "\n", "\n", "\n", "\n", "0\n", - "\n", - "0\n", + "\n", + "0\n", "\n", "\n", "I->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "0->0\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "1\n", - "\n", - "1\n", + "\n", + "1\n", "\n", "\n", "0->1\n", - "\n", - "\n", - "!a\n", - "\u24ff\n", + "\n", + "\n", + "!a\n", + "\u24ff\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "1->-1\n", - "\n", - "b\n", + "\n", + "\n", + "b\n", "\n", "\n", - "-1->0\n", - "\n", - "\n", + "-1->0\n", + "\n", + "\n", "\n", "\n", - "-1->1\n", - "\n", - "\n", + "-1->1\n", + "\n", + "\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7f76dc5d7de0> >" + " *' at 0x7f76203783c0> >" ] } ], - "prompt_number": 30 + "prompt_number": 5 }, { "cell_type": "code", @@ -509,7 +487,7 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 31, + "prompt_number": 6, "svg": [ "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "cluster_0\n", - "\n", + "\n", "\n", "\n", "\n", "0\n", - "\n", - "0\n", + "\n", + "0\n", "\n", "\n", "I->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "0->0\n", - "\n", - "\n", - "a\n", - "\u24ff\n", + "\n", + "\n", + "a\n", + "\u24ff\n", "\n", "\n", "1\n", - "\n", - "1\n", + "\n", + "1\n", "\n", "\n", "0->1\n", - "\n", - "\n", - "!a\n", + "\n", + "\n", + "!a\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "1->-1\n", - "\n", - "b\n", - "\u24ff\n", + "\n", + "\n", + "b\n", + "\u24ff\n", "\n", "\n", - "-1->0\n", - "\n", - "\n", + "-1->0\n", + "\n", + "\n", "\n", "\n", - "-1->1\n", - "\n", - "\n", + "-1->1\n", + "\n", + "\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7f76dc5d7f00> >" + " *' at 0x7f7620378360> >" ] } ], - "prompt_number": 31 + "prompt_number": 6 }, { "cell_type": "code", diff --git a/tests/python/alternating.py b/tests/python/alternating.py index a2ed3c7e5..d1bb47f9a 100755 --- a/tests/python/alternating.py +++ b/tests/python/alternating.py @@ -73,6 +73,11 @@ State: 2 aut2 = spot.automaton(h) h2 = aut2.to_str('hoa') print(h2) +assert h != h2 + +# This will sort destination groups +aut.merge_univ_dests() +h = aut.to_str('hoa') assert h == h2 aut2.set_univ_init_state([0, 1]) @@ -90,7 +95,7 @@ State: 0 [0] 1&2 {0} [1] 0&1 State: 1 -[0&1] 0&2&1 +[0&1] 0&1&2 State: 2 [0 | 1] 2 --END--""" @@ -121,7 +126,7 @@ State: 0 [0] 1&2 {0} [1] 0&1 State: 1 -[0&1] 0&2&1 +[0&1] 0&1&2 State: 2 [0 | 1] 2 State: 3 diff --git a/tests/python/alternation.ipynb b/tests/python/alternation.ipynb index ca231e52c..b9aea5adc 100644 --- a/tests/python/alternation.ipynb +++ b/tests/python/alternation.ipynb @@ -84,130 +84,132 @@ "output_type": "pyout", "prompt_number": 2, "svg": [ - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "\n", "\n", "0\n", - "\n", - "0\n", + "\n", + "0\n", "\n", "\n", "I->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "0->-1\n", - "\n", - "1\n", - "\n", - "\n", - "3\n", - "\n", - "3\n", - "\u24ff\n", - "\n", - "\n", - "-1->3\n", - "\n", - "\n", + "\n", + "\n", + "1\n", "\n", "\n", - "1\n", - "\n", - "1\n", + "1\n", + "\n", + "1\n", "\n", "\n", - "-1->1\n", - "\n", - "\n", + "-1->1\n", + "\n", + "\n", "\n", - "\n", - "3->3\n", - "\n", - "\n", - "1\n", + "\n", + "3\n", + "\n", + "3\n", + "\u24ff\n", "\n", - "\n", - "4\n", - "\n", - "4\n", - "\n", - "\n", - "3->4\n", - "\n", - "\n", - "a\n", + "\n", + "-1->3\n", + "\n", + "\n", "\n", "\n", "1->1\n", - "\n", - "\n", - "b\n", + "\n", + "\n", + "b\n", "\n", "\n", "-4\n", - "\n", + "\n", "\n", "\n", "1->-4\n", - "\n", - "!b\n", + "\n", + "\n", + "!b\n", + "\n", + "\n", + "3->3\n", + "\n", + "\n", + "1\n", + "\n", + "\n", + "4\n", + "\n", + "4\n", + "\n", + "\n", + "3->4\n", + "\n", + "\n", + "a\n", "\n", "\n", - "-4->1\n", - "\n", - "\n", + "-4->1\n", + "\n", + "\n", "\n", "\n", "2\n", - "\n", - "2\n", - "\u24ff\n", + "\n", + "2\n", + "\u24ff\n", "\n", "\n", - "-4->2\n", - "\n", - "\n", + "-4->2\n", + "\n", + "\n", "\n", "\n", "2->2\n", - "\n", - "\n", - "!b\n", + "\n", + "\n", + "!b\n", "\n", "\n", "5\n", - "\n", - "5\n", + "\n", + "5\n", "\n", "\n", "2->5\n", - "\n", - "\n", - "b\n", + "\n", + "\n", + "b\n", "\n", "\n", "5->5\n", - "\n", - "\n", - "1\n", + "\n", + "\n", + "1\n", "\n", "\n", "4->4\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "" @@ -278,7 +280,7 @@ "\n", "\n", "b\n", - "\u2776\n", + "\u24ff\n", "\n", "\n", "2\n", @@ -303,7 +305,7 @@ "\n", "\n", "!b\n", - "\u2776\n", + "\u24ff\n", "\n", "\n", "4\n", @@ -339,7 +341,7 @@ "\n", "\n", "b\n", - "\u2776\n", + "\u24ff\n", "\n", "\n", "3->2\n", @@ -360,7 +362,7 @@ "\n", "\n", "a & !b\n", - "\u24ff\n", + "\u2776\n", "\n", "\n", "4->2\n", @@ -375,13 +377,13 @@ "\n", "\n", "a & !b\n", - "\u24ff\n", + "\u2776\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7fd1684339f0> >" + " *' at 0x7f1dc4989a50> >" ] } ], @@ -531,7 +533,7 @@ "\n" ], "text": [ - " *' at 0x7fd16b5891e0> >" + " *' at 0x7f1dc4989b40> >" ] } ], @@ -571,36 +573,36 @@ "output_type": "pyout", "prompt_number": 5, "svg": [ - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "\n", "\n", "0\n", - "\n", - "0\n", - "\u24ff\n", + "\n", + "0\n", + "\u24ff\n", "\n", "\n", "I->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "1\n", - "\n", - "1\n", - "\u24ff\n", + "\n", + "1\n", + "\u24ff\n", "\n", "\n", "0->1\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "2\n", @@ -609,36 +611,37 @@ "\n", "\n", "0->2\n", - "\n", - "\n", - "!a\n", + "\n", + "\n", + "!a\n", "\n", "\n", "1->0\n", - "\n", - "\n", - "!a & b & p\n", + "\n", + "\n", + "!a & b & p\n", "\n", "\n", "1->1\n", - "\n", - "\n", - "!b & p\n", + "\n", + "\n", + "!b & p\n", "\n", "\n", "1->2\n", - "\n", - "\n", - "!a & !b\n", + "\n", + "\n", + "!a & !b\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "1->-1\n", - "\n", - "a & b & p\n", + "\n", + "\n", + "a & b & p\n", "\n", "\n", "2->2\n", @@ -648,13 +651,13 @@ "\n", "\n", "-1->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "-1->1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "" @@ -794,7 +797,7 @@ "\n" ], "text": [ - " *' at 0x7fd16843a2d0> >" + " *' at 0x7f1dc4989a80> >" ] } ], @@ -837,32 +840,33 @@ "output_type": "pyout", "prompt_number": 7, "svg": [ - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "\n", "\n", "3\n", - "\n", - "3\n", + "\n", + "3\n", "\n", "\n", "I->3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "-4\n", - "\n", + "\n", "\n", "\n", "3->-4\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "0\n", @@ -884,13 +888,13 @@ "\n", "\n", "2\n", - "\n", - "2\n", + "\n", + "2\n", "\n", "\n", "0->2\n", - "\n", - "\n", + "\n", + "\n", "!a\n", "\n", "\n", @@ -907,39 +911,40 @@ "\n", "\n", "1->2\n", - "\n", - "\n", + "\n", + "\n", "!a & !b\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "1->-1\n", - "\n", + "\n", + "\n", "a & b & p\n", "\n", "\n", "2->2\n", - "\n", - "\n", - "1\n", + "\n", + "\n", + "1\n", "\n", "\n", "-1->0\n", - "\n", + "\n", "\n", "\n", "\n", "-1->1\n", - "\n", + "\n", "\n", "\n", "\n", - "-4->0\n", - "\n", - "\n", + "-4->0\n", + "\n", + "\n", "\n", "\n", "4\n", @@ -947,14 +952,14 @@ "4\n", "\n", "\n", - "-4->4\n", - "\n", - "\n", + "-4->4\n", + "\n", + "\n", "\n", "\n", "4->3\n", - "\n", - "\n", + "\n", + "\n", "1\n", "\n", "\n", @@ -1140,7 +1145,7 @@ "\n" ], "text": [ - " *' at 0x7fd168433c90> >" + " *' at 0x7f1dc4989c90> >" ] } ], @@ -1187,162 +1192,165 @@ "output_type": "pyout", "prompt_number": 9, "svg": [ - "\n", - "\n", + "\n", + "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "\n", "\n", "-7\n", - "\n", + "\n", "\n", "\n", "I->-7\n", - "\n", + "\n", + "\n", "\n", "\n", "0\n", - "\n", - "0\n", - "\u24ff\n", + "\n", + "0\n", + "\u24ff\n", "\n", "\n", "-7->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "3\n", - "\n", - "3\n", + "\n", + "3\n", "\n", "\n", "-7->3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "1\n", - "\n", - "1\n", - "\u24ff\n", + "\n", + "1\n", + "\u24ff\n", "\n", "\n", "0->1\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "2\n", - "\n", - "2\n", + "\n", + "2\n", "\n", "\n", "0->2\n", - "\n", - "\n", - "!a\n", + "\n", + "\n", + "!a\n", "\n", "\n", "3->3\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "-4\n", - "\n", + "\n", "\n", "\n", "3->-4\n", - "\n", - "!a\n", + "\n", + "\n", + "!a\n", "\n", "\n", "1->0\n", - "\n", - "\n", - "!a & b & p\n", + "\n", + "\n", + "!a & b & p\n", "\n", "\n", "1->1\n", - "\n", - "\n", - "!b & p\n", + "\n", + "\n", + "!b & p\n", "\n", "\n", "1->2\n", - "\n", - "\n", - "!a & !b\n", + "\n", + "\n", + "!a & !b\n", "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "1->-1\n", - "\n", - "a & b & p\n", + "\n", + "\n", + "a & b & p\n", "\n", "\n", "2->2\n", - "\n", - "\n", - "1\n", + "\n", + "\n", + "1\n", "\n", "\n", "-1->0\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "-1->1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "-4->3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "4\n", - "\n", - "4\n", - "\u24ff\n", + "\n", + "4\n", + "\u24ff\n", "\n", "\n", "-4->4\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "4->4\n", - "\n", - "\n", - "!a\n", + "\n", + "\n", + "!a\n", "\n", "\n", "5\n", - "\n", - "5\n", + "\n", + "5\n", "\n", "\n", "4->5\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "5->5\n", - "\n", - "\n", - "1\n", + "\n", + "\n", + "1\n", "\n", "\n", "" @@ -1587,7 +1595,7 @@ "\n" ], "text": [ - " *' at 0x7fd1684d6420> >" + " *' at 0x7f1dc4989690> >" ] } ], @@ -1632,14 +1640,14 @@ "\n", "\n", - "\n", + "\n", "\n", "G\n", - "\n", - "Fin(\n", - "\u24ff\n", - ")\n", + "\n", + "Fin(\n", + "\u24ff\n", + ")\n", "\n", "\n", "0\n", @@ -1653,57 +1661,58 @@ "\n", "\n", "-1\n", - "\n", + "\n", "\n", "\n", "0->-1\n", - "\n", + "\n", + "\n", "1\n", "\n", "\n", - "-1->0\n", - "\n", - "\n", + "-1->0\n", + "\n", + "\n", "\n", "\n", "1\n", - "\n", - "F(a)\n", - "\u24ff\n", + "\n", + "F(a)\n", + "\u24ff\n", "\n", "\n", - "-1->1\n", - "\n", - "\n", + "-1->1\n", + "\n", + "\n", "\n", "\n", "1->1\n", - "\n", - "\n", - "1\n", + "\n", + "\n", + "1\n", "\n", "\n", "2\n", - "\n", - "t\n", + "\n", + "t\n", "\n", "\n", "1->2\n", - "\n", - "\n", - "a\n", + "\n", + "\n", + "a\n", "\n", "\n", "2->2\n", - "\n", - "\n", - "1\n", + "\n", + "\n", + "1\n", "\n", "\n", "\n" ], "text": [ - " *' at 0x7fd168433d50> >" + " *' at 0x7f1dc4989e10> >" ] } ], @@ -1777,20 +1786,11 @@ "\n" ], "text": [ - " *' at 0x7fd168433d20> >" + " *' at 0x7f1dc4989ba0> >" ] } ], "prompt_number": 12 - }, - { - "cell_type": "code", - "collapsed": true, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": null } ], "metadata": {}