sccinfo: adjust to work with alternating automata
* spot/twaalgos/sccinfo.cc: Consider universal edges as if they were existential edges. * spot/twaalgos/sccinfo.hh: Document that. * spot/twaalgos/dot.cc: Allow option 's' again, for easy testing. * tests/core/alternating.test: Adjust tests. * tests/python/_altscc.ipynb: New file (more tests). * tests/Makefile.am: Add it.
This commit is contained in:
parent
d2f471da06
commit
a4ce999402
6 changed files with 851 additions and 167 deletions
|
|
@ -699,12 +699,12 @@ namespace spot
|
|||
}
|
||||
}
|
||||
auto si =
|
||||
std::unique_ptr<scc_info>((opt_scc_ && !aut->is_alternating())
|
||||
? new scc_info(aut) : nullptr);
|
||||
std::unique_ptr<scc_info>(opt_scc_ ? new scc_info(aut) : nullptr);
|
||||
|
||||
start();
|
||||
if (si)
|
||||
{
|
||||
if (!aut->is_alternating())
|
||||
si->determine_unknown_acceptance();
|
||||
|
||||
unsigned sccs = si->scc_count();
|
||||
|
|
|
|||
|
|
@ -60,37 +60,43 @@ namespace spot
|
|||
// Values < 0 number states that are part of incomplete SCCs being
|
||||
// completed. 0 denotes non-visited states.
|
||||
|
||||
int num_; // Number of visited nodes, negated.
|
||||
int num_ = 0; // Number of visited nodes, negated.
|
||||
|
||||
typedef twa_graph::graph_t::const_iterator iterator;
|
||||
typedef std::pair<unsigned, iterator> pair_state_iter;
|
||||
std::stack<pair_state_iter> todo_; // DFS stack. Holds (STATE,
|
||||
// ITERATOR) pairs where
|
||||
// ITERATOR is an iterator over
|
||||
// the successors of STATE.
|
||||
// ITERATOR should always be
|
||||
// freed when TODO is popped,
|
||||
// but STATE should not because
|
||||
// it is used as a key in H.
|
||||
struct stack_item {
|
||||
unsigned src;
|
||||
unsigned out_edge;
|
||||
unsigned univ_pos;
|
||||
};
|
||||
// DFS stack. Holds (STATE, TRANS, UNIV_POS) pairs where TRANS is
|
||||
// the current outgoing transition of STATE, and UNIV_POS is used
|
||||
// when the transition is universal to iterate over all possible
|
||||
// destinations.
|
||||
std::stack<stack_item> todo_;
|
||||
auto& gr = aut->get_graph();
|
||||
|
||||
// Setup depth-first search from the initial state.
|
||||
unsigned init = aut->get_init_state_number();
|
||||
num_ = -1;
|
||||
h_[init] = num_;
|
||||
// Setup depth-first search from the initial state. But we may
|
||||
// have a conjunction of initial state in alternating automata.
|
||||
for (unsigned init: aut->univ_dests(aut->get_init_state_number()))
|
||||
{
|
||||
int spi = h_[init];
|
||||
if (spi > 0)
|
||||
continue;
|
||||
assert(spi == 0);
|
||||
h_[init] = --num_;
|
||||
root_.emplace_back(num_, 0U);
|
||||
todo_.emplace(init, aut->out(init).begin());
|
||||
todo_.emplace(stack_item{init, gr.state_storage(init).succ, 0});
|
||||
live.emplace_back(init);
|
||||
|
||||
while (!todo_.empty())
|
||||
{
|
||||
// We are looking at the next successor in SUCC.
|
||||
iterator succ = todo_.top().second;
|
||||
unsigned tr_succ = todo_.top().out_edge;
|
||||
|
||||
// If there is no more successor, backtrack.
|
||||
if (!succ)
|
||||
if (!tr_succ)
|
||||
{
|
||||
// We have explored all successors of state CURR.
|
||||
unsigned curr = todo_.top().first;
|
||||
unsigned curr = todo_.top().src;
|
||||
|
||||
// Backtrack TODO_.
|
||||
todo_.pop();
|
||||
|
|
@ -125,8 +131,9 @@ namespace spot
|
|||
// Gather all successor SCCs
|
||||
for (unsigned s: nbs)
|
||||
for (auto& t: aut->out(s))
|
||||
for (unsigned d: aut->univ_dests(t))
|
||||
{
|
||||
unsigned n = sccof_[t.dst];
|
||||
unsigned n = sccof_[d];
|
||||
assert(n != -1U);
|
||||
if (n == num)
|
||||
continue;
|
||||
|
|
@ -138,21 +145,31 @@ namespace spot
|
|||
node_.back().accepting_ = accept;
|
||||
bool reject = triv || !aut->acc().inf_satisfiable(acc);
|
||||
// If the SCC acceptance is indeterminate, but has
|
||||
// only one state and one transition, it is
|
||||
// only self-loops with the same mark, it is
|
||||
// necessarily rejecting, otherwise we would have
|
||||
// found it to be accepting.
|
||||
if (!accept && !reject && nbs.size() == 1)
|
||||
{
|
||||
unsigned selfloop = 0;
|
||||
acc_cond::mark_t selfacc = 0;
|
||||
bool first = true;
|
||||
reject = true;
|
||||
for (const auto& e: aut->out(nbs.front()))
|
||||
if (e.src == e.dst)
|
||||
for (unsigned d: aut->univ_dests(e))
|
||||
if (e.src == d)
|
||||
{
|
||||
++selfloop;
|
||||
if (selfloop > 1)
|
||||
break;
|
||||
if (first)
|
||||
{
|
||||
selfacc = e.acc;
|
||||
first = false;
|
||||
}
|
||||
reject = selfloop <= 1;
|
||||
else if (selfacc != e.acc)
|
||||
{
|
||||
reject = false;
|
||||
goto break2;
|
||||
}
|
||||
}
|
||||
}
|
||||
break2:
|
||||
node_.back().rejecting_ = reject;
|
||||
root_.pop_back();
|
||||
}
|
||||
|
|
@ -161,11 +178,32 @@ namespace spot
|
|||
|
||||
// We have a successor to look at.
|
||||
// Fetch the values we are interested in...
|
||||
unsigned dest = succ->dst;
|
||||
auto acc = succ->acc;
|
||||
++todo_.top().second;
|
||||
auto& e = gr.edge_storage(tr_succ);
|
||||
unsigned dest = e.dst;
|
||||
if ((int) dest < 0)
|
||||
{
|
||||
// Iterate over all destinations of an universal edge.
|
||||
if (todo_.top().univ_pos == 0)
|
||||
todo_.top().univ_pos = ~dest + 1;
|
||||
const auto& v = gr.dests_vector();
|
||||
dest = v[todo_.top().univ_pos];
|
||||
// Last universal destination?
|
||||
if (~e.dst + v[~e.dst] == todo_.top().univ_pos)
|
||||
{
|
||||
todo_.top().out_edge = e.next_succ;
|
||||
todo_.top().univ_pos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
++todo_.top().univ_pos;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
todo_.top().out_edge = e.next_succ;
|
||||
}
|
||||
|
||||
// We do not need SUCC from now on.
|
||||
auto acc = e.acc;
|
||||
|
||||
// Are we going to a new state?
|
||||
int spi = h_[dest];
|
||||
|
|
@ -175,7 +213,7 @@ namespace spot
|
|||
// for later processing.
|
||||
h_[dest] = --num_;
|
||||
root_.emplace_back(num_, acc);
|
||||
todo_.emplace(dest, aut->out(dest).begin());
|
||||
todo_.emplace(stack_item{dest, gr.state_storage(dest).succ, 0});
|
||||
live.emplace_back(dest);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -200,7 +238,7 @@ namespace spot
|
|||
int threshold = spi;
|
||||
bool is_accepting = false;
|
||||
// If this is a self-loop, check its acceptance alone.
|
||||
if (dest == succ->src)
|
||||
if (dest == e.src)
|
||||
is_accepting = aut->acc().accepting(acc);
|
||||
|
||||
assert(!root_.empty());
|
||||
|
|
@ -226,7 +264,7 @@ namespace spot
|
|||
// This SCC is no longer trivial.
|
||||
root_.back().trivial = false;
|
||||
}
|
||||
|
||||
}
|
||||
determine_usefulness();
|
||||
}
|
||||
|
||||
|
|
@ -315,6 +353,9 @@ namespace spot
|
|||
|
||||
void scc_info::determine_unknown_acceptance()
|
||||
{
|
||||
if (aut_->is_alternating())
|
||||
throw std::runtime_error("scc_info::determine_unknown_acceptance() "
|
||||
"does not support alternating automata");
|
||||
std::vector<bool> k;
|
||||
unsigned n = scc_count();
|
||||
bool changed = false;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,18 @@
|
|||
|
||||
namespace spot
|
||||
{
|
||||
/// \brief Compute an SCC map and gather assorted information.
|
||||
///
|
||||
/// This takes twa_graph as input and compute its SCCs. This
|
||||
/// class maps all input states to their SCCs, and vice-versa.
|
||||
/// It allows iterating over all SCCs of the automaton, and check
|
||||
/// their acceptance or non-acceptance.
|
||||
///
|
||||
/// Additionally this class can be used on alternating automata, but
|
||||
/// in this case, universal transitions are handled like existential
|
||||
/// transitions. It still make sense to check which states belong
|
||||
/// to the same SCC, but the acceptance information computed by
|
||||
/// this class is meaningless.
|
||||
class SPOT_API scc_info
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -323,6 +323,7 @@ TESTS_ipython = \
|
|||
# with a _.
|
||||
TESTS_python = \
|
||||
python/_aux.ipynb \
|
||||
python/_altscc.ipynb \
|
||||
python/accparse2.py \
|
||||
python/alarm.py \
|
||||
python/alternating.py \
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ State: 6 "t"
|
|||
--END--
|
||||
EOF
|
||||
|
||||
# The 's' option should be ignored for alternating automata
|
||||
autfilt --dot=bans alt.hoa >alt.dot
|
||||
|
||||
cat >expect.dot <<EOF
|
||||
|
|
@ -66,7 +65,41 @@ digraph G {
|
|||
-11 [label=<>,width=0,height=0,shape=none]
|
||||
-11 -> 0
|
||||
-11 -> 2
|
||||
subgraph cluster_0 {
|
||||
color=green
|
||||
label=""
|
||||
6 [label="t"]
|
||||
}
|
||||
subgraph cluster_1 {
|
||||
color=red
|
||||
label=""
|
||||
4 [label="F(b)\n⓿"]
|
||||
}
|
||||
subgraph cluster_2 {
|
||||
color=green
|
||||
label=""
|
||||
3 [label="GF(b)"]
|
||||
}
|
||||
subgraph cluster_3 {
|
||||
color=green
|
||||
label=""
|
||||
2 [label="G(a)"]
|
||||
}
|
||||
subgraph cluster_4 {
|
||||
color=red
|
||||
label=""
|
||||
1 [label="FG(a)\n⓿"]
|
||||
}
|
||||
subgraph cluster_5 {
|
||||
color=red
|
||||
label=""
|
||||
5 [label="((a) U (b))\n⓿"]
|
||||
}
|
||||
subgraph cluster_6 {
|
||||
color=black
|
||||
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
|
||||
|
|
@ -76,24 +109,18 @@ digraph G {
|
|||
-4 -> 5 [style=bold, color="#F15854"]
|
||||
-4 -> 3 [style=bold, color="#F15854"]
|
||||
-4 -> 1 [style=bold, color="#F15854"]
|
||||
1 [label="FG(a)\n⓿"]
|
||||
1 -> 2 [label="a"]
|
||||
1 -> 1 [label="1"]
|
||||
2 [label="G(a)"]
|
||||
2 -> 2 [label="a"]
|
||||
3 [label="GF(b)"]
|
||||
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"]
|
||||
-8 -> 3 [style=bold, color="#FAA43A"]
|
||||
4 [label="F(b)\n⓿"]
|
||||
4 -> 6 [label="b"]
|
||||
4 -> 4 [label="!b"]
|
||||
5 [label="((a) U (b))\n⓿"]
|
||||
5 -> 6 [label="b"]
|
||||
5 -> 5 [label="a & !b"]
|
||||
6 [label="t"]
|
||||
6 -> 6 [label="1"]
|
||||
}
|
||||
EOF
|
||||
|
|
|
|||
603
tests/python/_altscc.ipynb
Normal file
603
tests/python/_altscc.ipynb
Normal file
|
|
@ -0,0 +1,603 @@
|
|||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2+"
|
||||
},
|
||||
"name": ""
|
||||
},
|
||||
"nbformat": 3,
|
||||
"nbformat_minor": 0,
|
||||
"worksheets": [
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"These examples are tests for scc_info on alternating automata."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": true,
|
||||
"input": [
|
||||
"import spot\n",
|
||||
"spot.setup(show_default='.bas')"
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"prompt_number": 2
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": false,
|
||||
"input": [
|
||||
"spot.automaton('''\n",
|
||||
"HOA: v1\n",
|
||||
"States: 2\n",
|
||||
"Start: 0&1\n",
|
||||
"AP: 2 \"a\" \"b\"\n",
|
||||
"acc-name: Buchi\n",
|
||||
"Acceptance: 1 Inf(0)\n",
|
||||
"--BODY--\n",
|
||||
"State: 0\n",
|
||||
"[0] 0\n",
|
||||
"[!0] 1\n",
|
||||
"State: 1\n",
|
||||
"[1] 1 {0}\n",
|
||||
"--END--\n",
|
||||
"''')"
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"metadata": {},
|
||||
"output_type": "pyout",
|
||||
"prompt_number": 12,
|
||||
"svg": [
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
||||
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
||||
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
||||
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
||||
" -->\n",
|
||||
"<!-- Title: G Pages: 1 -->\n",
|
||||
"<svg width=\"219pt\" height=\"154pt\"\n",
|
||||
" viewBox=\"0.00 0.00 219.00 154.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 150)\">\n",
|
||||
"<title>G</title>\n",
|
||||
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-150 215,-150 215,4 -4,4\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"84.5\" y=\"-131.8\" font-family=\"Lato\" font-size=\"14.00\">Inf(</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"106.5\" y=\"-131.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"122.5\" y=\"-131.8\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
||||
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"green\" points=\"151,-8 151,-108 203,-108 203,-8 151,-8\"/>\n",
|
||||
"</g>\n",
|
||||
"<g id=\"clust2\" class=\"cluster\"><title>cluster_1</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"red\" points=\"68,-30 68,-115 120,-115 120,-30 68,-30\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I -->\n",
|
||||
"<!-- -1 -->\n",
|
||||
"<g id=\"node2\" class=\"node\"><title>-1</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"39,-27.5 38,-27.5 38,-26.5 39,-26.5 39,-27.5\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I->-1 -->\n",
|
||||
"<g id=\"edge1\" class=\"edge\"><title>I->-1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M1.10614,-27C3.20855,-27 35.8616,-27 37.9003,-27\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0 -->\n",
|
||||
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"94\" cy=\"-56\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"94\" y=\"-52.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->0 -->\n",
|
||||
"<g id=\"edge2\" class=\"edge\"><title>-1->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.1549,-27.0832C40.9145,-28.0282 57.3371,-36.8477 71.5878,-44.5008\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"77.9221,-47.9026 70.2648,-47.3658 74.8386,-46.2466 71.7551,-44.5907 71.7551,-44.5907 71.7551,-44.5907 74.8386,-46.2466 73.2455,-41.8155 77.9221,-47.9026 77.9221,-47.9026\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1 -->\n",
|
||||
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"177\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"177\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->1 -->\n",
|
||||
"<g id=\"edge3\" class=\"edge\"><title>-1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.0466,-26.9978C40.0034,-26.9519 55.5083,-26.2153 68,-26 91.1077,-25.6017 96.947,-24.3617 120,-26 130.461,-26.7434 141.938,-28.2585 151.763,-29.7722\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"158.911,-30.9167 151.501,-32.9203 155.455,-30.3633 151.999,-29.8099 151.999,-29.8099 151.999,-29.8099 155.455,-30.3633 152.497,-26.6995 158.911,-30.9167 158.911,-30.9167\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->0 -->\n",
|
||||
"<g id=\"edge4\" class=\"edge\"><title>0->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M87.6208,-73.0373C86.3189,-82.8579 88.4453,-92 94,-92 98.166,-92 100.404,-86.8576 100.713,-80.1433\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"100.379,-73.0373 103.854,-79.8818 100.543,-76.5335 100.708,-80.0296 100.708,-80.0296 100.708,-80.0296 100.543,-76.5335 97.561,-80.1774 100.379,-73.0373 100.379,-73.0373\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"90.5\" y=\"-95.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->1 -->\n",
|
||||
"<g id=\"edge5\" class=\"edge\"><title>0->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M111.783,-51.4416C123.591,-48.2346 139.551,-43.8996 152.606,-40.3538\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"159.515,-38.4773 153.586,-43.352 156.138,-39.3947 152.76,-40.3121 152.76,-40.3121 152.76,-40.3121 156.138,-39.3947 151.934,-37.2723 159.515,-38.4773 159.515,-38.4773\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"130\" y=\"-50.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->1 -->\n",
|
||||
"<g id=\"edge6\" class=\"edge\"><title>1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M169.969,-50.6641C168.406,-60.625 170.75,-70 177,-70 181.688,-70 184.178,-64.7266 184.471,-57.8876\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"184.031,-50.6641 187.601,-57.4598 184.244,-54.1576 184.456,-57.6511 184.456,-57.6511 184.456,-57.6511 184.244,-54.1576 181.312,-57.8425 184.031,-50.6641 184.031,-50.6641\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"172.5\" y=\"-88.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"169\" y=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</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 0x7f76dc5d7090> >"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 12
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"universal edges are handled as if they were many distinct existencial edges from the point of view of `scc_info`, so the acceptance / rejection status is not always meaningful."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": false,
|
||||
"input": [
|
||||
"spot.automaton('''\n",
|
||||
"HOA: v1\n",
|
||||
"States: 2\n",
|
||||
"Start: 0&1\n",
|
||||
"AP: 2 \"a\" \"b\"\n",
|
||||
"Acceptance: 1 Fin(0)\n",
|
||||
"--BODY--\n",
|
||||
"State: 0\n",
|
||||
"[0] 0&1 {0}\n",
|
||||
"State: 1\n",
|
||||
"[1] 1\n",
|
||||
"--END--\n",
|
||||
"''')"
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"metadata": {},
|
||||
"output_type": "pyout",
|
||||
"prompt_number": 17,
|
||||
"svg": [
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
||||
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
||||
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
||||
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
||||
" -->\n",
|
||||
"<!-- Title: G Pages: 1 -->\n",
|
||||
"<svg width=\"151pt\" height=\"192pt\"\n",
|
||||
" viewBox=\"0.00 0.00 151.00 192.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 188)\">\n",
|
||||
"<title>G</title>\n",
|
||||
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-188 147,-188 147,4 -4,4\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"49\" y=\"-169.8\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"74\" y=\"-169.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"90\" y=\"-169.8\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
||||
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"green\" points=\"83,-8 83,-93 135,-93 135,-8 83,-8\"/>\n",
|
||||
"</g>\n",
|
||||
"<g id=\"clust2\" class=\"cluster\"><title>cluster_1</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"red\" points=\"83,-101 83,-153 135,-153 135,-101 83,-101\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I -->\n",
|
||||
"<!-- -4 -->\n",
|
||||
"<g id=\"node2\" class=\"node\"><title>-4</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"39,-47.5 38,-47.5 38,-46.5 39,-46.5 39,-47.5\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I->-4 -->\n",
|
||||
"<g id=\"edge1\" class=\"edge\"><title>I->-4</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M1.10614,-47C3.20855,-47 35.8616,-47 37.9003,-47\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0 -->\n",
|
||||
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"109\" cy=\"-127\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"109\" y=\"-123.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -4->0 -->\n",
|
||||
"<g id=\"edge2\" class=\"edge\"><title>-4->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.05,-47.058C40.4721,-48.7067 71.8975,-85.142 91.8267,-108.248\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"96.6206,-113.806 89.6633,-110.563 94.3346,-111.156 92.0486,-108.506 92.0486,-108.506 92.0486,-108.506 94.3346,-111.156 94.434,-106.448 96.6206,-113.806 96.6206,-113.806\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1 -->\n",
|
||||
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"109\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"109\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -4->1 -->\n",
|
||||
"<g id=\"edge3\" class=\"edge\"><title>-4->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.05,-46.9906C40.3003,-46.755 64.7431,-42.1498 84.1745,-38.4889\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"91.0544,-37.1926 84.7587,-41.5843 87.6149,-37.8407 84.1755,-38.4888 84.1755,-38.4888 84.1755,-38.4888 87.6149,-37.8407 83.5922,-35.3932 91.0544,-37.1926 91.0544,-37.1926\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1 -->\n",
|
||||
"<g id=\"node5\" class=\"node\"><title>-1</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"39,-109.5 38,-109.5 38,-108.5 39,-108.5 39,-109.5\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->-1 -->\n",
|
||||
"<g id=\"edge4\" class=\"edge\"><title>0->-1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M90.5814,-126.381C80.5252,-125.592 67.7752,-123.842 57,-120 48.7209,-117.048 40.1448,-109.963 39.1051,-109.089\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"61.5\" y=\"-142.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"57\" y=\"-127.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->1 -->\n",
|
||||
"<g id=\"edge7\" class=\"edge\"><title>1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M101.332,-50.2903C99.4831,-60.3892 102.039,-70 109,-70 114.221,-70 116.964,-64.5939 117.229,-57.6304\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"116.668,-50.2903 120.342,-57.0299 116.935,-53.7801 117.201,-57.2699 117.201,-57.2699 117.201,-57.2699 116.935,-53.7801 114.06,-57.5099 116.668,-50.2903 116.668,-50.2903\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"104.5\" y=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->0 -->\n",
|
||||
"<g id=\"edge5\" class=\"edge\"><title>-1->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.05,-109.013C40.3075,-109.341 65.0281,-115.79 84.5129,-120.873\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"91.4014,-122.67 83.833,-123.951 88.0148,-121.786 84.6281,-120.903 84.6281,-120.903 84.6281,-120.903 88.0148,-121.786 85.4233,-117.855 91.4014,-122.67 91.4014,-122.67\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->1 -->\n",
|
||||
"<g id=\"edge6\" class=\"edge\"><title>-1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.05,-108.946C40.457,-107.416 71.2357,-73.9612 91.1902,-52.2715\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"96.0058,-47.0372 93.5845,-54.3215 93.636,-49.613 91.2663,-52.1888 91.2663,-52.1888 91.2663,-52.1888 93.636,-49.613 88.9481,-50.056 96.0058,-47.0372 96.0058,-47.0372\"/>\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 0x7f76dc5d71b0> >"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 17
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": false,
|
||||
"input": [
|
||||
"spot.automaton('''\n",
|
||||
"HOA: v1\n",
|
||||
"States: 2\n",
|
||||
"Start: 0&1\n",
|
||||
"AP: 2 \"a\" \"b\"\n",
|
||||
"Acceptance: 1 Fin(0)\n",
|
||||
"--BODY--\n",
|
||||
"State: 0\n",
|
||||
"[0] 0 {0}\n",
|
||||
"[!0] 1\n",
|
||||
"State: 1\n",
|
||||
"[1] 1&0\n",
|
||||
"--END--\n",
|
||||
"''')"
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"metadata": {},
|
||||
"output_type": "pyout",
|
||||
"prompt_number": 16,
|
||||
"svg": [
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
||||
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
||||
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
||||
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
||||
" -->\n",
|
||||
"<!-- Title: G Pages: 1 -->\n",
|
||||
"<svg width=\"219pt\" height=\"199pt\"\n",
|
||||
" viewBox=\"0.00 0.00 219.00 198.77\" 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 194.773)\">\n",
|
||||
"<title>G</title>\n",
|
||||
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-194.773 215,-194.773 215,4 -4,4\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"83\" y=\"-176.573\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"108\" y=\"-176.573\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"124\" y=\"-176.573\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
||||
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"green\" points=\"68,-59.7728 68,-159.773 203,-159.773 203,-59.7728 68,-59.7728\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I -->\n",
|
||||
"<!-- -4 -->\n",
|
||||
"<g id=\"node2\" class=\"node\"><title>-4</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"39,-57.2728 38,-57.2728 38,-56.2728 39,-56.2728 39,-57.2728\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I->-4 -->\n",
|
||||
"<g id=\"edge1\" class=\"edge\"><title>I->-4</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M1.10614,-56.7728C3.20855,-56.7728 35.8616,-56.7728 37.9003,-56.7728\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0 -->\n",
|
||||
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"94\" cy=\"-85.7728\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"94\" y=\"-82.0728\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -4->0 -->\n",
|
||||
"<g id=\"edge2\" class=\"edge\"><title>-4->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.1549,-56.856C40.9145,-57.8009 57.3371,-66.6205 71.5878,-74.2736\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"77.9221,-77.6754 70.2648,-77.1386 74.8386,-76.0194 71.7551,-74.3634 71.7551,-74.3634 71.7551,-74.3634 74.8386,-76.0194 73.2455,-71.5883 77.9221,-77.6754 77.9221,-77.6754\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1 -->\n",
|
||||
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"177\" cy=\"-85.7728\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"177\" y=\"-82.0728\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -4->1 -->\n",
|
||||
"<g id=\"edge3\" class=\"edge\"><title>-4->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M39.1194,-56.759C41.5706,-56.4798 81.2702,-52.1167 112,-58.7728 126.718,-61.9607 142.306,-68.4629 154.412,-74.2876\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"160.753,-77.4284 153.082,-77.1437 157.616,-75.8748 154.48,-74.3211 154.48,-74.3211 154.48,-74.3211 157.616,-75.8748 155.878,-71.4984 160.753,-77.4284 160.753,-77.4284\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->0 -->\n",
|
||||
"<g id=\"edge4\" class=\"edge\"><title>0->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M87.6208,-102.81C86.3189,-112.631 88.4453,-121.773 94,-121.773 98.166,-121.773 100.404,-116.63 100.713,-109.916\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"100.379,-102.81 103.854,-109.655 100.543,-106.306 100.708,-109.802 100.708,-109.802 100.708,-109.802 100.543,-106.306 97.561,-109.95 100.379,-102.81 100.379,-102.81\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"90.5\" y=\"-140.573\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"86\" y=\"-125.573\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->1 -->\n",
|
||||
"<g id=\"edge5\" class=\"edge\"><title>0->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M112.178,-85.7728C123.669,-85.7728 138.959,-85.7728 151.693,-85.7728\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"158.847,-85.7728 151.847,-88.9229 155.347,-85.7728 151.847,-85.7729 151.847,-85.7729 151.847,-85.7729 155.347,-85.7728 151.847,-82.6229 158.847,-85.7728 158.847,-85.7728\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"130\" y=\"-89.5728\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1 -->\n",
|
||||
"<g id=\"node5\" class=\"node\"><title>-1</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"94.5,-11.2728 93.5,-11.2728 93.5,-10.2728 94.5,-10.2728 94.5,-11.2728\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->-1 -->\n",
|
||||
"<g id=\"edge6\" class=\"edge\"><title>1->-1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M173.048,-67.9081C169.091,-50.2821 160.197,-24.2233 141,-11.7728 124.379,-0.993136 96.7913,-10.1606 95.0833,-10.7441\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"131\" y=\"-15.5728\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->0 -->\n",
|
||||
"<g id=\"edge8\" class=\"edge\"><title>-1->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M94,-11.3587C94,-27.8063 94,-44.254 94,-60.7016\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"94,-67.7506 90.8501,-60.7506 94,-64.2506 94.0001,-60.7506 94.0001,-60.7506 94.0001,-60.7506 94,-64.2506 97.1501,-60.7507 94,-67.7506 94,-67.7506\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->1 -->\n",
|
||||
"<g id=\"edge7\" class=\"edge\"><title>-1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M95.083,-10.7203C96.7853,-9.65207 124.283,7.26784 141,-3.77277 160.012,-16.3291 168.732,-41.5556 172.71,-60.7309\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"174.014,-67.7447 169.637,-61.4385 173.374,-64.3037 172.734,-60.8627 172.734,-60.8627 172.734,-60.8627 173.374,-64.3037 175.831,-60.2868 174.014,-67.7447 174.014,-67.7447\"/>\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 0x7f76dc5d7180> >"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 16
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": false,
|
||||
"input": [
|
||||
"spot.automaton('''\n",
|
||||
"HOA: v1\n",
|
||||
"States: 2\n",
|
||||
"Start: 0\n",
|
||||
"AP: 2 \"a\" \"b\"\n",
|
||||
"Acceptance: 1 Fin(0)\n",
|
||||
"--BODY--\n",
|
||||
"State: 0\n",
|
||||
"[0] 0\n",
|
||||
"[!0] 1 {0}\n",
|
||||
"State: 1\n",
|
||||
"[1] 1&0\n",
|
||||
"--END--\n",
|
||||
"''')"
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"metadata": {},
|
||||
"output_type": "pyout",
|
||||
"prompt_number": 30,
|
||||
"svg": [
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
||||
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
||||
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
||||
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
||||
" -->\n",
|
||||
"<!-- Title: G Pages: 1 -->\n",
|
||||
"<svg width=\"186pt\" height=\"153pt\"\n",
|
||||
" viewBox=\"0.00 0.00 186.00 152.50\" 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 148.5)\">\n",
|
||||
"<title>G</title>\n",
|
||||
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-148.5 182,-148.5 182,4 -4,4\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"66.5\" y=\"-130.3\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"91.5\" y=\"-130.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"107.5\" y=\"-130.3\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
||||
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"green\" points=\"30,-28.5 30,-113.5 170,-113.5 170,-28.5 30,-28.5\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I -->\n",
|
||||
"<!-- 0 -->\n",
|
||||
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-54.5\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"56\" y=\"-50.8\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- I->0 -->\n",
|
||||
"<g id=\"edge1\" class=\"edge\"><title>I->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-54.5C2.79388,-54.5 17.1543,-54.5 30.6317,-54.5\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-54.5 30.9419,-57.6501 34.4419,-54.5 30.9419,-54.5001 30.9419,-54.5001 30.9419,-54.5001 34.4419,-54.5 30.9418,-51.3501 37.9419,-54.5 37.9419,-54.5\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->0 -->\n",
|
||||
"<g id=\"edge2\" class=\"edge\"><title>0->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-71.5373C48.3189,-81.3579 50.4453,-90.5 56,-90.5 60.166,-90.5 62.4036,-85.3576 62.7128,-78.6433\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-71.5373 65.8541,-78.3818 62.5434,-75.0335 62.7076,-78.5296 62.7076,-78.5296 62.7076,-78.5296 62.5434,-75.0335 59.561,-78.6774 62.3792,-71.5373 62.3792,-71.5373\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"52.5\" y=\"-94.3\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1 -->\n",
|
||||
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"144\" cy=\"-54.5\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"144\" y=\"-50.8\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->1 -->\n",
|
||||
"<g id=\"edge3\" class=\"edge\"><title>0->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M74.4034,-54.5C87.1928,-54.5 104.732,-54.5 118.874,-54.5\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"125.916,-54.5 118.916,-57.6501 122.416,-54.5 118.916,-54.5001 118.916,-54.5001 118.916,-54.5001 122.416,-54.5 118.916,-51.3501 125.916,-54.5 125.916,-54.5\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"94.5\" y=\"-73.3\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"92\" y=\"-58.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1 -->\n",
|
||||
"<g id=\"node4\" class=\"node\"><title>-1</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"56.5,-1 55.5,-1 55.5,-0 56.5,-0 56.5,-1\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->-1 -->\n",
|
||||
"<g id=\"edge4\" class=\"edge\"><title>1->-1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M128.436,-45.3549C104.425,-30.2785 58.9748,-1.73997 57.0623,-0.539139\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"95.5\" y=\"-36.3\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->0 -->\n",
|
||||
"<g id=\"edge6\" class=\"edge\"><title>-1->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M56,-1.34375C56,-10.6098 56,-19.8758 56,-29.1418\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"56,-36.2275 52.8501,-29.2275 56,-32.7275 56.0001,-29.2275 56.0001,-29.2275 56.0001,-29.2275 56,-32.7275 59.1501,-29.2276 56,-36.2275 56,-36.2275\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->1 -->\n",
|
||||
"<g id=\"edge5\" class=\"edge\"><title>-1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M57.0885,-0.5174C58.9055,-0.877388 88.2848,-6.83508 108,-19.5 114.864,-23.9094 121.451,-29.8619 127.021,-35.6065\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"131.831,-40.7735 124.756,-37.7958 129.446,-38.2116 127.061,-35.6496 127.061,-35.6496 127.061,-35.6496 129.446,-38.2116 129.367,-33.5034 131.831,-40.7735 131.831,-40.7735\"/>\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 0x7f76dc5d7de0> >"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 30
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": false,
|
||||
"input": [
|
||||
"spot.automaton('''\n",
|
||||
"HOA: v1\n",
|
||||
"States: 2\n",
|
||||
"Start: 0\n",
|
||||
"AP: 2 \"a\" \"b\"\n",
|
||||
"Acceptance: 1 Fin(0)\n",
|
||||
"--BODY--\n",
|
||||
"State: 0\n",
|
||||
"[0] 0 {0}\n",
|
||||
"[!0] 1 \n",
|
||||
"State: 1\n",
|
||||
"[1] 1&0 {0}\n",
|
||||
"--END--\n",
|
||||
"''')"
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"metadata": {},
|
||||
"output_type": "pyout",
|
||||
"prompt_number": 31,
|
||||
"svg": [
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
||||
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
||||
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
||||
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
||||
" -->\n",
|
||||
"<!-- Title: G Pages: 1 -->\n",
|
||||
"<svg width=\"186pt\" height=\"168pt\"\n",
|
||||
" viewBox=\"0.00 0.00 186.00 167.96\" 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 163.96)\">\n",
|
||||
"<title>G</title>\n",
|
||||
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-163.96 182,-163.96 182,4 -4,4\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"66.5\" y=\"-145.76\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"91.5\" y=\"-145.76\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"107.5\" y=\"-145.76\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
||||
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
||||
"<polygon fill=\"none\" stroke=\"orange\" points=\"30,-28.9597 30,-128.96 170,-128.96 170,-28.9597 30,-28.9597\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- I -->\n",
|
||||
"<!-- 0 -->\n",
|
||||
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-54.9597\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"56\" y=\"-51.2597\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- I->0 -->\n",
|
||||
"<g id=\"edge1\" class=\"edge\"><title>I->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-54.9597C2.79388,-54.9597 17.1543,-54.9597 30.6317,-54.9597\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-54.9597 30.9419,-58.1098 34.4419,-54.9598 30.9419,-54.9598 30.9419,-54.9598 30.9419,-54.9598 34.4419,-54.9598 30.9418,-51.8098 37.9419,-54.9597 37.9419,-54.9597\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->0 -->\n",
|
||||
"<g id=\"edge2\" class=\"edge\"><title>0->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-71.997C48.3189,-81.8176 50.4453,-90.9597 56,-90.9597 60.166,-90.9597 62.4036,-85.8173 62.7128,-79.103\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-71.997 65.8541,-78.8416 62.5434,-75.4932 62.7076,-78.9893 62.7076,-78.9893 62.7076,-78.9893 62.5434,-75.4932 59.561,-79.1371 62.3792,-71.997 62.3792,-71.997\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"52.5\" y=\"-109.76\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"48\" y=\"-94.7597\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1 -->\n",
|
||||
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"144\" cy=\"-54.9597\" rx=\"18\" ry=\"18\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"144\" y=\"-51.2597\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->1 -->\n",
|
||||
"<g id=\"edge3\" class=\"edge\"><title>0->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M74.4034,-54.9597C87.1928,-54.9597 104.732,-54.9597 118.874,-54.9597\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"125.916,-54.9597 118.916,-58.1098 122.416,-54.9598 118.916,-54.9598 118.916,-54.9598 118.916,-54.9598 122.416,-54.9598 118.916,-51.8098 125.916,-54.9597 125.916,-54.9597\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"94.5\" y=\"-58.7597\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1 -->\n",
|
||||
"<g id=\"node4\" class=\"node\"><title>-1</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"none\" points=\"56.5,-1.45972 55.5,-1.45972 55.5,-0.459718 56.5,-0.459718 56.5,-1.45972\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->-1 -->\n",
|
||||
"<g id=\"edge4\" class=\"edge\"><title>1->-1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M131.723,-41.7008C125.318,-34.8036 116.831,-26.6488 108,-20.9597 88.1721,-8.18576 58.8985,-1.39181 57.0882,-0.979667\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"95.5\" y=\"-39.7597\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"92\" y=\"-24.7597\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->0 -->\n",
|
||||
"<g id=\"edge6\" class=\"edge\"><title>-1->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M56,-1.80347C56,-11.0695 56,-20.3355 56,-29.6015\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"56,-36.6873 52.8501,-29.6872 56,-33.1873 56.0001,-29.6873 56.0001,-29.6873 56.0001,-29.6873 56,-33.1873 59.1501,-29.6873 56,-36.6873 56,-36.6873\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- -1->1 -->\n",
|
||||
"<g id=\"edge5\" class=\"edge\"><title>-1->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"black\" d=\"M57.0904,-0.9493C58.9447,-0.740081 88.9129,2.42946 108,-8.95972 117.662,-14.7252 125.575,-24.2646 131.417,-33.166\"/>\n",
|
||||
"<polygon fill=\"black\" stroke=\"black\" points=\"135.127,-39.1724 128.768,-34.872 133.287,-36.1946 131.448,-33.2168 131.448,-33.2168 131.448,-33.2168 133.287,-36.1946 134.128,-31.5615 135.127,-39.1724 135.127,-39.1724\"/>\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 0x7f76dc5d7f00> >"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 31
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"collapsed": true,
|
||||
"input": [],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"prompt_number": null
|
||||
}
|
||||
],
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue