python: better support for explicit Kripke
Part of issue #376, reported by Hashim Ali. * python/spot/impl.i: Add bindings for kripke_graph. * python/spot/__init__.py (automaton): Add a want_kripke option. * spot/kripke/kripkegraph.hh: Honnor the "state-names" property when displaying states. * spot/twaalgos/hoa.cc: Preserve names of Kripke states. * tests/python/ltsmin-dve.ipynb: Illustrate all the above. * NEWS: Mention those changes. * THANKS: Add Hashim.
This commit is contained in:
parent
a86925e20e
commit
f26dd904ff
7 changed files with 393 additions and 33 deletions
18
NEWS
18
NEWS
|
|
@ -4,7 +4,7 @@ New in spot 2.7.0.dev (not yet release)
|
|||
|
||||
- Work around GCC bug #89303, that causes memory leaks and std::weak_bad_ptr
|
||||
exceptions when Spot is compiled with the version of g++ 8.2 currently
|
||||
distributed with Debian (starting with 8.2.0-15).
|
||||
distributed by Debian unstable (starting with g++ 8.2.0-15).
|
||||
|
||||
Python:
|
||||
|
||||
|
|
@ -17,6 +17,20 @@ New in spot 2.7.0.dev (not yet release)
|
|||
- unregister_all_my_variables(for_me)
|
||||
- unregister_variable(var, for_me)
|
||||
|
||||
- Better support for explicit Kripke structures
|
||||
- the kripke_graph type now has bindings
|
||||
- spot.automaton() and spot.automata() now support a want_kripke=True
|
||||
to return a kripke_graph
|
||||
See the bottom of https://spot.lrde.epita.fr/ipynb/ltsmin-dve.html
|
||||
for some examples.
|
||||
|
||||
Library:
|
||||
|
||||
- Printing Kripke structures via print_hoa() will save state names.
|
||||
|
||||
- kripke_graph_ptr objects now honnor any "state-names" property
|
||||
when formating states.
|
||||
|
||||
Bugs fixed:
|
||||
|
||||
- The print_dot_psl() function would incorrectly number all but the
|
||||
|
|
@ -38,7 +52,7 @@ New in spot 2.7.0.dev (not yet release)
|
|||
suspendable automaton could incorrectly build transition-based
|
||||
automata when multipliying two state-based automata. This caused
|
||||
ltl2tgba to emit error messages such as: "automaton has
|
||||
transition-based acceptance despite prop_state_acc()==true"
|
||||
transition-based acceptance despite prop_state_acc()==true".
|
||||
|
||||
New in spot 2.7 (2018-12-11)
|
||||
|
||||
|
|
|
|||
1
THANKS
1
THANKS
|
|
@ -17,6 +17,7 @@ Felix Klaedtke
|
|||
Florian Perlié-Long
|
||||
František Blahoudek
|
||||
Gerard J. Holzmann
|
||||
Hashim Ali
|
||||
Heikki Tauriainen
|
||||
Henrich Lauko
|
||||
Jan Strejček
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2018 Laboratoire de
|
||||
# Copyright (C) 2014-2019 Laboratoire de
|
||||
# Recherche et Développement de l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -367,7 +367,8 @@ class atomic_prop_set:
|
|||
|
||||
|
||||
def automata(*sources, timeout=None, ignore_abort=True,
|
||||
trust_hoa=True, no_sid=False, debug=False):
|
||||
trust_hoa=True, no_sid=False, debug=False,
|
||||
want_kripke=False):
|
||||
"""Read automata from a list of sources.
|
||||
|
||||
Parameters
|
||||
|
|
@ -386,6 +387,10 @@ def automata(*sources, timeout=None, ignore_abort=True,
|
|||
trust_hoa : bool, optional
|
||||
If True (the default), supported HOA properies that
|
||||
cannot be easily verified are trusted.
|
||||
want_kripke : bool, optional
|
||||
If True, the input is expected to discribe Kripke
|
||||
structures, in the HOA format, and the returned type
|
||||
will be of type kripke_graph_ptr.
|
||||
no_sid : bool, optional
|
||||
When an automaton is obtained from a subprocess, this
|
||||
subprocess is started from a shell with its own session
|
||||
|
|
@ -445,6 +450,8 @@ def automata(*sources, timeout=None, ignore_abort=True,
|
|||
o.ignore_abort = ignore_abort
|
||||
o.trust_hoa = trust_hoa
|
||||
o.raise_errors = True
|
||||
o.want_kripke = want_kripke
|
||||
|
||||
for filename in sources:
|
||||
try:
|
||||
p = None
|
||||
|
|
@ -496,8 +503,9 @@ def automata(*sources, timeout=None, ignore_abort=True,
|
|||
mgr = proc if proc else _supress()
|
||||
with mgr:
|
||||
while a:
|
||||
# This returns None when we reach the end of the file.
|
||||
a = p.parse(_bdd_dict).aut
|
||||
# the automaton is None when we reach the end of the file.
|
||||
res = p.parse(_bdd_dict)
|
||||
a = res.ks if want_kripke else res.aut
|
||||
if a:
|
||||
yield a
|
||||
finally:
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@
|
|||
%shared_ptr(spot::fair_kripke)
|
||||
%shared_ptr(spot::kripke)
|
||||
%shared_ptr(spot::kripke_graph)
|
||||
%shared_ptr(spot::kripke)
|
||||
%shared_ptr(spot::ta)
|
||||
%shared_ptr(spot::ta_explicit)
|
||||
%shared_ptr(spot::ta_product)
|
||||
|
|
@ -172,8 +171,9 @@
|
|||
|
||||
#include <spot/parseaut/public.hh>
|
||||
|
||||
#include <spot/kripke/kripke.hh>
|
||||
#include <spot/kripke/fairkripke.hh>
|
||||
#include <spot/kripke/kripke.hh>
|
||||
#include <spot/kripke/kripkegraph.hh>
|
||||
|
||||
#include <spot/ta/ta.hh>
|
||||
#include <spot/ta/tgta.hh>
|
||||
|
|
@ -678,10 +678,11 @@ def state_is_accepting(self, src) -> "bool":
|
|||
|
||||
%include <spot/twaalgos/complement.hh>
|
||||
|
||||
%include <spot/parseaut/public.hh>
|
||||
|
||||
%include <spot/kripke/fairkripke.hh>
|
||||
%include <spot/kripke/kripke.hh>
|
||||
%include <spot/kripke/kripkegraph.hh>
|
||||
|
||||
%include <spot/parseaut/public.hh>
|
||||
|
||||
%include <spot/ta/ta.hh>
|
||||
%include <spot/ta/tgta.hh>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2011-2018 Laboratoire de Recherche et Développement de
|
||||
// Copyright (C) 2011-2019 Laboratoire de Recherche et Développement de
|
||||
// l'Epita (LRDE)
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -239,9 +239,11 @@ namespace spot
|
|||
|
||||
std::string format_state(unsigned n) const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << n;
|
||||
return ss.str();
|
||||
auto named = get_named_prop<std::vector<std::string>>("state-names");
|
||||
if (named && n < named->size())
|
||||
return (*named)[n];
|
||||
|
||||
return std::to_string(n);
|
||||
}
|
||||
|
||||
virtual std::string format_state(const state* st) const override
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2014-2018 Laboratoire de Recherche et
|
||||
// Copyright (C) 2014-2019 Laboratoire de Recherche et
|
||||
// Developpement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -304,6 +304,9 @@ namespace spot
|
|||
case 'k':
|
||||
state_labels = true;
|
||||
break;
|
||||
case 'K':
|
||||
state_labels = false;
|
||||
break;
|
||||
case 'l':
|
||||
newline = false;
|
||||
break;
|
||||
|
|
@ -732,14 +735,12 @@ namespace spot
|
|||
const const_twa_ptr& aut,
|
||||
const char* opt)
|
||||
{
|
||||
|
||||
auto a = std::dynamic_pointer_cast<const twa_graph>(aut);
|
||||
if (!a)
|
||||
a = make_twa_graph(aut, twa::prop_set::all());
|
||||
|
||||
bool preserve_names = false;
|
||||
// for Kripke structures, automatically append "k" to the options.
|
||||
// (Unless "K" was given.)
|
||||
char* tmpopt = nullptr;
|
||||
if (std::dynamic_pointer_cast<const fair_kripke>(aut))
|
||||
if (std::dynamic_pointer_cast<const fair_kripke>(aut) &&
|
||||
(!opt || (strchr(opt, 'K') == nullptr)))
|
||||
{
|
||||
unsigned n = opt ? strlen(opt) : 0;
|
||||
tmpopt = new char[n + 2];
|
||||
|
|
@ -747,7 +748,13 @@ namespace spot
|
|||
strcpy(tmpopt, opt);
|
||||
tmpopt[n] = 'k';
|
||||
tmpopt[n + 1] = 0;
|
||||
preserve_names = true;
|
||||
}
|
||||
|
||||
auto a = std::dynamic_pointer_cast<const twa_graph>(aut);
|
||||
if (!a)
|
||||
a = make_twa_graph(aut, twa::prop_set::all(), preserve_names);
|
||||
|
||||
print_hoa(os, a, tmpopt ? tmpopt : opt);
|
||||
delete[] tmpopt;
|
||||
return os;
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.impl.kripke; proxy of <Swig Object of type 'std::shared_ptr< spot::kripke > *' at 0x7f0f044132a0> >"
|
||||
"<spot.impl.kripke; proxy of <Swig Object of type 'std::shared_ptr< spot::kripke > *' at 0x7fb8f84f9870> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
|
|
@ -1265,7 +1265,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0f04381d50> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb8f84691e0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 12,
|
||||
|
|
@ -1453,7 +1453,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.impl.twa_product; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_product > *' at 0x7f0f04381b10> >"
|
||||
"<spot.impl.twa_product; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_product > *' at 0x7fb8f8469360> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 13,
|
||||
|
|
@ -1548,7 +1548,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 19,
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
|
@ -1582,7 +1582,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": 19,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
|
@ -1663,10 +1663,10 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0f04392d80> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb8f85624e0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 20,
|
||||
"execution_count": 19,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
|
@ -1676,11 +1676,338 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"# Saving Kripke structures to some file\n",
|
||||
"\n",
|
||||
"For experiments, it is sometime useful to save a Kripke structure in the HOA format. The HOA printer will automatically use `state-labels` for Kripke structures."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"HOA: v1\n",
|
||||
"States: 22\n",
|
||||
"Start: 0\n",
|
||||
"AP: 3 \"a<1\" \"b>2\" \"dead\"\n",
|
||||
"acc-name: all\n",
|
||||
"Acceptance: 0 t\n",
|
||||
"properties: state-labels explicit-labels state-acc\n",
|
||||
"--BODY--\n",
|
||||
"State: [0&!1&!2] 0 \"a=0, b=0, Q=0\"\n",
|
||||
"1 2\n",
|
||||
"State: [!0&!1&!2] 1 \"a=1, b=0, Q=0\"\n",
|
||||
"3 4\n",
|
||||
"State: [0&!1&!2] 2 \"a=0, b=1, Q=0\"\n",
|
||||
"4 5\n",
|
||||
"State: [!0&!1&!2] 3 \"a=2, b=0, Q=0\"\n",
|
||||
"6 7\n",
|
||||
"State: [!0&!1&!2] 4 \"a=1, b=1, Q=0\"\n",
|
||||
"7 8\n",
|
||||
"State: [0&!1&!2] 5 \"a=0, b=2, Q=0\"\n",
|
||||
"8 9 10\n",
|
||||
"State: [!0&!1&2] 6 \"a=3, b=0, Q=0\"\n",
|
||||
"6\n",
|
||||
"State: [!0&!1&!2] 7 \"a=2, b=1, Q=0\"\n",
|
||||
"11 12\n",
|
||||
"State: [!0&!1&!2] 8 \"a=1, b=2, Q=0\"\n",
|
||||
"12 13 14\n",
|
||||
"State: [0&1&!2] 9 \"a=0, b=3, Q=0\"\n",
|
||||
"15\n",
|
||||
"State: [0&!1&!2] 10 \"a=0, b=2, Q=1\"\n",
|
||||
"14 15\n",
|
||||
"State: [!0&!1&2] 11 \"a=3, b=1, Q=0\"\n",
|
||||
"11\n",
|
||||
"State: [!0&!1&!2] 12 \"a=2, b=2, Q=0\"\n",
|
||||
"16 17 18\n",
|
||||
"State: [!0&1&!2] 13 \"a=1, b=3, Q=0\"\n",
|
||||
"19\n",
|
||||
"State: [!0&!1&!2] 14 \"a=1, b=2, Q=1\"\n",
|
||||
"18 19\n",
|
||||
"State: [0&1&2] 15 \"a=0, b=3, Q=1\"\n",
|
||||
"15\n",
|
||||
"State: [!0&!1&!2] 16 \"a=3, b=2, Q=0\"\n",
|
||||
"20\n",
|
||||
"State: [!0&1&!2] 17 \"a=2, b=3, Q=0\"\n",
|
||||
"21\n",
|
||||
"State: [!0&!1&!2] 18 \"a=2, b=2, Q=1\"\n",
|
||||
"20 21 12\n",
|
||||
"State: [!0&1&2] 19 \"a=1, b=3, Q=1\"\n",
|
||||
"19\n",
|
||||
"State: [!0&!1&!2] 20 \"a=3, b=2, Q=1\"\n",
|
||||
"16\n",
|
||||
"State: [!0&1&!2] 21 \"a=2, b=3, Q=1\"\n",
|
||||
"17\n",
|
||||
"--END--\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"string = k.to_str('hoa')\n",
|
||||
"print(string)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"You can load this as a Kripke structure by passing the `want_kripke` option to `spot.automaton()`. The type `kripke_graph` stores the Kripke structure explicitely (like a `twa_graph` stores an automaton explicitely), so you may want to avoid it for very large modelsand use it only for development."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"<class 'spot.impl.kripke_graph'>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"image/svg+xml": [
|
||||
"<?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.40.1 (20161225.0304)\n",
|
||||
" -->\n",
|
||||
"<!-- Pages: 1 -->\n",
|
||||
"<svg width=\"734pt\" height=\"242pt\"\n",
|
||||
" viewBox=\"0.00 0.00 734.00 242.46\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
||||
"<g id=\"graph0\" class=\"graph\" transform=\"scale(.6487 .6487) rotate(0) translate(4 369.7401)\">\n",
|
||||
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-369.7401 1127.4104,-369.7401 1127.4104,4 -4,4\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"558.7052\" y=\"-350.5401\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">t</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"550.7052\" y=\"-335.5401\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">[all]</text>\n",
|
||||
"<!-- I -->\n",
|
||||
"<!-- 0 -->\n",
|
||||
"<g id=\"node2\" class=\"node\">\n",
|
||||
"<title>0</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"150.1371\" cy=\"-154.8701\" rx=\"113.2743\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"105.1371\" y=\"-158.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=0, b=0, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"78.1371\" y=\"-143.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">"a<1" & !"b>2" & !dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- I->0 -->\n",
|
||||
"<g id=\"edge1\" class=\"edge\">\n",
|
||||
"<title>I->0</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M1.1671,-154.8701C3.9097,-154.8701 14.8741,-154.8701 29.7057,-154.8701\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"36.7767,-154.8701 29.7767,-158.0202 33.2767,-154.8701 29.7767,-154.8702 29.7767,-154.8702 29.7767,-154.8702 33.2767,-154.8701 29.7766,-151.7202 36.7767,-154.8701 36.7767,-154.8701\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1 -->\n",
|
||||
"<g id=\"node3\" class=\"node\">\n",
|
||||
"<title>1</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"415.2397\" cy=\"-190.8701\" rx=\"115.931\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"370.2397\" y=\"-194.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=1, b=0, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"341.2397\" y=\"-179.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!"a<1" & !"b>2" & !dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->1 -->\n",
|
||||
"<g id=\"edge2\" class=\"edge\">\n",
|
||||
"<title>0->1</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M248.4748,-168.224C267.7667,-170.8437 288.0966,-173.6045 307.6721,-176.2628\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"314.8467,-177.237 307.4865,-179.4164 311.3786,-176.766 307.9104,-176.295 307.9104,-176.295 307.9104,-176.295 311.3786,-176.766 308.3343,-173.1737 314.8467,-177.237 314.8467,-177.237\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 2 -->\n",
|
||||
"<g id=\"node4\" class=\"node\">\n",
|
||||
"<title>2</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"415.2397\" cy=\"-118.8701\" rx=\"113.2743\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"370.2397\" y=\"-122.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=0, b=1, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"343.2397\" y=\"-107.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">"a<1" & !"b>2" & !dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 0->2 -->\n",
|
||||
"<g id=\"edge3\" class=\"edge\">\n",
|
||||
"<title>0->2</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M248.4748,-141.5161C268.3786,-138.8133 289.3872,-135.9604 309.5324,-133.2247\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"316.6187,-132.2624 310.1063,-136.3258 313.1506,-132.7334 309.6824,-133.2045 309.6824,-133.2045 309.6824,-133.2045 313.1506,-132.7334 309.2585,-130.0831 316.6187,-132.2624 316.6187,-132.2624\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 3 -->\n",
|
||||
"<g id=\"node5\" class=\"node\">\n",
|
||||
"<title>3</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"683.1707\" cy=\"-226.8701\" rx=\"115.931\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"638.1707\" y=\"-230.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=2, b=0, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"609.1707\" y=\"-215.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!"a<1" & !"b>2" & !dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->3 -->\n",
|
||||
"<g id=\"edge4\" class=\"edge\">\n",
|
||||
"<title>1->3</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M515.7696,-204.3776C535.2954,-207.0011 555.8335,-209.7607 575.576,-212.4133\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"582.5231,-213.3467 575.1659,-215.5364 579.0543,-212.8806 575.5854,-212.4145 575.5854,-212.4145 575.5854,-212.4145 579.0543,-212.8806 576.0049,-209.2926 582.5231,-213.3467 582.5231,-213.3467\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 4 -->\n",
|
||||
"<g id=\"node6\" class=\"node\">\n",
|
||||
"<title>4</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"683.1707\" cy=\"-154.8701\" rx=\"115.931\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"638.1707\" y=\"-158.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=1, b=1, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"609.1707\" y=\"-143.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!"a<1" & !"b>2" & !dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 1->4 -->\n",
|
||||
"<g id=\"edge5\" class=\"edge\">\n",
|
||||
"<title>1->4</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M515.7696,-177.3626C535.2954,-174.739 555.8335,-171.9795 575.576,-169.3268\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"582.5231,-168.3934 576.0049,-172.4476 579.0543,-168.8595 575.5854,-169.3256 575.5854,-169.3256 575.5854,-169.3256 579.0543,-168.8595 575.1659,-166.2037 582.5231,-168.3934 582.5231,-168.3934\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 2->4 -->\n",
|
||||
"<g id=\"edge6\" class=\"edge\">\n",
|
||||
"<title>2->4</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M513.8659,-132.1218C533.8869,-134.8118 555.0421,-137.6543 575.3619,-140.3845\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"582.5112,-141.3451 575.154,-143.5348 579.0423,-140.879 575.5735,-140.4129 575.5735,-140.4129 575.5735,-140.4129 579.0423,-140.879 575.993,-137.291 582.5112,-141.3451 582.5112,-141.3451\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 5 -->\n",
|
||||
"<g id=\"node7\" class=\"node\">\n",
|
||||
"<title>5</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"683.1707\" cy=\"-82.8701\" rx=\"113.2743\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"638.1707\" y=\"-86.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=0, b=2, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"611.1707\" y=\"-71.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">"a<1" & !"b>2" & !dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 2->5 -->\n",
|
||||
"<g id=\"edge7\" class=\"edge\">\n",
|
||||
"<title>2->5</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M513.8659,-105.6184C534.5106,-102.8445 556.3611,-99.9086 577.2583,-97.1008\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"584.3054,-96.1539 577.7873,-100.2081 580.8366,-96.62 577.3678,-97.0861 577.3678,-97.0861 577.3678,-97.0861 580.8366,-96.62 576.9483,-93.9642 584.3054,-96.1539 584.3054,-96.1539\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 6 -->\n",
|
||||
"<g id=\"node8\" class=\"node\">\n",
|
||||
"<title>6</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"948.2733\" cy=\"-282.8701\" rx=\"113.2743\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"903.2733\" y=\"-286.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=3, b=0, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"876.2733\" y=\"-271.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!"a<1" & !"b>2" & dead</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 3->6 -->\n",
|
||||
"<g id=\"edge8\" class=\"edge\">\n",
|
||||
"<title>3->6</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M768.8758,-244.9743C796.7674,-250.8661 827.8348,-257.4288 856.1739,-263.4151\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"863.3164,-264.9239 855.8165,-266.559 859.892,-264.2004 856.4676,-263.477 856.4676,-263.477 856.4676,-263.477 859.892,-264.2004 857.1186,-260.395 863.3164,-264.9239 863.3164,-264.9239\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 7 -->\n",
|
||||
"<g id=\"node9\" class=\"node\">\n",
|
||||
"<title>7</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"948.2733\" cy=\"-210.8701\" rx=\"74.9067\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"903.2733\" y=\"-214.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=2, b=1, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"943.2733\" y=\"-199.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 3->7 -->\n",
|
||||
"<g id=\"edge9\" class=\"edge\">\n",
|
||||
"<title>3->7</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M795.5981,-220.0846C819.5378,-218.6398 844.3743,-217.1408 866.8851,-215.7822\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"874.108,-215.3462 867.3105,-218.9123 870.6144,-215.5571 867.1207,-215.768 867.1207,-215.768 867.1207,-215.768 870.6144,-215.5571 866.9309,-212.6238 874.108,-215.3462 874.108,-215.3462\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 4->7 -->\n",
|
||||
"<g id=\"edge10\" class=\"edge\">\n",
|
||||
"<title>4->7</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M768.8758,-172.9743C803.6186,-180.3133 843.289,-188.6933 876.4758,-195.7036\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"883.455,-197.1779 875.9551,-198.8131 880.0306,-196.4545 876.6062,-195.7311 876.6062,-195.7311 876.6062,-195.7311 880.0306,-196.4545 877.2572,-192.6491 883.455,-197.1779 883.455,-197.1779\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 8 -->\n",
|
||||
"<g id=\"node10\" class=\"node\">\n",
|
||||
"<title>8</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"948.2733\" cy=\"-138.8701\" rx=\"74.9067\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"903.2733\" y=\"-142.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=1, b=2, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"943.2733\" y=\"-127.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 4->8 -->\n",
|
||||
"<g id=\"edge11\" class=\"edge\">\n",
|
||||
"<title>4->8</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M795.5981,-148.0846C819.5378,-146.6398 844.3743,-145.1408 866.8851,-143.7822\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"874.108,-143.3462 867.3105,-146.9123 870.6144,-143.5571 867.1207,-143.768 867.1207,-143.768 867.1207,-143.768 870.6144,-143.5571 866.9309,-140.6238 874.108,-143.3462 874.108,-143.3462\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 5->8 -->\n",
|
||||
"<g id=\"edge13\" class=\"edge\">\n",
|
||||
"<title>5->8</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M767.7797,-100.7428C802.7225,-108.1241 842.8025,-116.5905 876.3042,-123.6674\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"883.349,-125.1555 875.8491,-126.7907 879.9246,-124.4321 876.5001,-123.7087 876.5001,-123.7087 876.5001,-123.7087 879.9246,-124.4321 877.1512,-120.6267 883.349,-125.1555 883.349,-125.1555\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- u5 -->\n",
|
||||
"<g id=\"node11\" class=\"node\">\n",
|
||||
"<title>u5</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"transparent\" points=\"961.2733,-94.3701 935.2733,-94.3701 935.2733,-71.3701 961.2733,-71.3701 961.2733,-94.3701\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"948.2733\" y=\"-79.1701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 5->u5 -->\n",
|
||||
"<g id=\"edge12\" class=\"edge\">\n",
|
||||
"<title>5->u5</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M796.367,-82.8701C846.0208,-82.8701 899.3777,-82.8701 927.7542,-82.8701\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"935.0716,-82.8701 928.0716,-86.0202 931.5716,-82.8701 928.0716,-82.8702 928.0716,-82.8702 928.0716,-82.8702 931.5716,-82.8701 928.0715,-79.7202 935.0716,-82.8701 935.0716,-82.8701\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 9 -->\n",
|
||||
"<g id=\"node12\" class=\"node\">\n",
|
||||
"<title>9</title>\n",
|
||||
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"948.2733\" cy=\"-26.8701\" rx=\"74.9067\" ry=\"26.7407\"/>\n",
|
||||
"<text text-anchor=\"start\" x=\"903.2733\" y=\"-30.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a=0, b=3, Q=0</text>\n",
|
||||
"<text text-anchor=\"start\" x=\"943.2733\" y=\"-15.6701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 5->9 -->\n",
|
||||
"<g id=\"edge14\" class=\"edge\">\n",
|
||||
"<title>5->9</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M767.7797,-64.9973C802.7225,-57.6161 842.8025,-49.1496 876.3042,-42.0727\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"883.349,-40.5846 877.1512,-45.1134 879.9246,-41.308 876.5001,-42.0314 876.5001,-42.0314 876.5001,-42.0314 879.9246,-41.308 875.8491,-38.9494 883.349,-40.5846 883.349,-40.5846\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- 6->6 -->\n",
|
||||
"<g id=\"edge15\" class=\"edge\">\n",
|
||||
"<title>6->6</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" d=\"M918.017,-309.1406C916.6722,-319.2978 926.7577,-327.7401 948.2733,-327.7401 964.41,-327.7401 974.1173,-322.9913 977.395,-316.3318\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"978.5297,-309.1406 980.5501,-316.546 977.9841,-312.5978 977.4386,-316.055 977.4386,-316.055 977.4386,-316.055 977.9841,-312.5978 974.3271,-315.5641 978.5297,-309.1406 978.5297,-309.1406\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- u7 -->\n",
|
||||
"<g id=\"node13\" class=\"node\">\n",
|
||||
"<title>u7</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"transparent\" points=\"1123.4104,-222.3701 1097.4104,-222.3701 1097.4104,-199.3701 1123.4104,-199.3701 1123.4104,-222.3701\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"1110.4104\" y=\"-207.1701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 7->u7 -->\n",
|
||||
"<g id=\"edge16\" class=\"edge\">\n",
|
||||
"<title>7->u7</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M1023.6459,-210.8701C1048.0287,-210.8701 1073.1021,-210.8701 1089.9848,-210.8701\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1097.1334,-210.8701 1090.1335,-214.0202 1093.6334,-210.8701 1090.1334,-210.8702 1090.1334,-210.8702 1090.1334,-210.8702 1093.6334,-210.8701 1090.1334,-207.7202 1097.1334,-210.8701 1097.1334,-210.8701\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- u8 -->\n",
|
||||
"<g id=\"node14\" class=\"node\">\n",
|
||||
"<title>u8</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"transparent\" points=\"1123.4104,-150.3701 1097.4104,-150.3701 1097.4104,-127.3701 1123.4104,-127.3701 1123.4104,-150.3701\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"1110.4104\" y=\"-135.1701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 8->u8 -->\n",
|
||||
"<g id=\"edge17\" class=\"edge\">\n",
|
||||
"<title>8->u8</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M1023.6459,-138.8701C1048.0287,-138.8701 1073.1021,-138.8701 1089.9848,-138.8701\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1097.1334,-138.8701 1090.1335,-142.0202 1093.6334,-138.8701 1090.1334,-138.8702 1090.1334,-138.8702 1090.1334,-138.8702 1093.6334,-138.8701 1090.1334,-135.7202 1097.1334,-138.8701 1097.1334,-138.8701\"/>\n",
|
||||
"</g>\n",
|
||||
"<!-- u9 -->\n",
|
||||
"<g id=\"node15\" class=\"node\">\n",
|
||||
"<title>u9</title>\n",
|
||||
"<polygon fill=\"#ffffaa\" stroke=\"transparent\" points=\"1123.4104,-38.3701 1097.4104,-38.3701 1097.4104,-15.3701 1123.4104,-15.3701 1123.4104,-38.3701\"/>\n",
|
||||
"<text text-anchor=\"middle\" x=\"1110.4104\" y=\"-23.1701\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">...</text>\n",
|
||||
"</g>\n",
|
||||
"<!-- 9->u9 -->\n",
|
||||
"<g id=\"edge18\" class=\"edge\">\n",
|
||||
"<title>9->u9</title>\n",
|
||||
"<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"5,2\" d=\"M1023.6459,-26.8701C1048.0287,-26.8701 1073.1021,-26.8701 1089.9848,-26.8701\"/>\n",
|
||||
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1097.1334,-26.8701 1090.1335,-30.0202 1093.6334,-26.8701 1090.1334,-26.8702 1090.1334,-26.8702 1090.1334,-26.8702 1093.6334,-26.8701 1090.1334,-23.7202 1097.1334,-26.8701 1097.1334,-26.8701\"/>\n",
|
||||
"</g>\n",
|
||||
"</g>\n",
|
||||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.impl.kripke_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::kripke_graph > *' at 0x7fb8f84690f0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 21,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"k2 = spot.automaton(string, want_kripke=True)\n",
|
||||
"print(type(k2))\n",
|
||||
"k2"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
@ -1699,7 +2026,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.7"
|
||||
"version": "3.7.2+"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue