Commit 760bde09 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

python: add some parity-game bindings

* python/spot/impl.i: Process game.hh.
* spot/misc/game.cc, spot/misc/game.hh: Make the output of
parity_game_solve() a solved_game object for easier manipulation in
Python.
* bin/ltlsynt.cc: Adjust usage.
* tests/python/paritygame.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* NEWS: Mention these bindings.
parent 9e8a8429
Pipeline #21504 passed with stages
in 569 minutes and 32 seconds
......@@ -79,6 +79,11 @@ New in spot 2.9.4.dev (not yet released)
- print_dot() will display states from player 1 using a diamond
shape.
Python:
- Bindings for functions related to parity games.
See https://spot.lrde.epita.fr/ipynb/paritygame.html for examples.
New in spot 2.9.4 (2020-09-07)
Bugs fixed:
......
......@@ -216,11 +216,10 @@ namespace
static spot::twa_graph_ptr
strat_to_aut(const spot::const_twa_graph_ptr& pg,
const spot::strategy_t& strat,
const spot::twa_graph_ptr& dpa,
bdd all_outputs)
{
auto aut = spot::make_twa_graph(dpa->get_dict());
aut->copy_ap_of(dpa);
auto aut = spot::make_twa_graph(pg->get_dict());
aut->copy_ap_of(pg);
unsigned pg_init = pg->get_init_state_number();
std::vector<unsigned> todo{pg_init};
std::vector<int> pg2aut(pg->num_states(), -1);
......@@ -230,10 +229,10 @@ namespace
{
unsigned s = todo.back();
todo.pop_back();
for (auto& e1: dpa->out(s))
for (auto& e1: pg->out(s))
{
unsigned i = 0;
for (auto& e2: dpa->out(e1.dst))
for (auto& e2: pg->out(e1.dst))
{
bool self_loop = false;
if (e1.dst == s || e2.dst == e1.dst)
......@@ -520,18 +519,16 @@ namespace
return 0;
}
spot::strategy_t strategy[2];
spot::region_t winning_region[2];
if (want_time)
sw.start();
parity_game_solve(dpa, winning_region, strategy);
auto solution = parity_game_solve(dpa);
if (want_time)
solve_time = sw.stop();
if (verbose)
std::cerr << "parity game solved in " << solve_time << " seconds\n";
nb_states_parity_game = dpa->num_states();
timer.stop();
if (winning_region[1].count(dpa->get_init_state_number()))
if (solution.player_winning_at(1, dpa->get_init_state_number()))
{
std::cout << "REALIZABLE\n";
if (!opt_real)
......@@ -539,7 +536,7 @@ namespace
if (want_time)
sw.start();
auto strat_aut =
strat_to_aut(dpa, strategy[1], dpa, all_outputs);
strat_to_aut(dpa, solution.winning_strategy[1], all_outputs);
if (want_time)
strat2aut_time = sw.stop();
......
......@@ -72,6 +72,7 @@ real notebooks instead.
automata
- [[https://spot.lrde.epita.fr/ipynb/parity.html][=parity.ipynb=]] documents algorithms for manipulating parity automata
in Python
- [[https://spot.lrde.epita.fr/ipynb/paritygame.html][=paritygame.ipynb=]] illustrates support for parity games
- [[https://spot.lrde.epita.fr/ipynb/product.html][=product.ipynb=]] shows how to re-implement the product of two automata
in Python
- [[https://spot.lrde.epita.fr/ipynb/randltl.html][=randltl.ipynb=]] demonstrates a Python-version of [[file:randltl.org][=randltl=]]
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009-2019 Laboratoire de Recherche et Développement
// Copyright (C) 2009-2020 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2003-2006 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
......@@ -164,6 +164,8 @@
#include <spot/parseaut/public.hh>
#include <spot/misc/game.hh>
#include <spot/kripke/fairkripke.hh>
#include <spot/kripke/kripke.hh>
#include <spot/kripke/kripkegraph.hh>
......@@ -690,6 +692,8 @@ def state_is_accepting(self, src) -> "bool":
%include <spot/twaalgos/complement.hh>
%include <spot/misc/game.hh>
%include <spot/kripke/fairkripke.hh>
%include <spot/kripke/kripke.hh>
%include <spot/kripke/kripkegraph.hh>
......
......@@ -230,9 +230,11 @@ namespace spot
}
}
void parity_game_solve(const const_twa_graph_ptr& arena,
region_t (&w)[2], strategy_t (&s)[2])
solved_game parity_game_solve(const const_twa_graph_ptr& arena)
{
solved_game result;
result.arena = arena;
const std::vector<bool>* owner =
ensure_parity_game(arena, "parity_game_solve");
......@@ -245,7 +247,10 @@ namespace spot
for (const auto& e: arena->edges())
m |= e.acc;
solve_rec(arena, owner, states_, m.max_set(), w, s);
solve_rec(arena, owner, states_, m.max_set(),
result.winning_region, result.winning_strategy);
return result;
}
void propagate_players(spot::twa_graph_ptr& arena,
......@@ -304,4 +309,44 @@ namespace spot
arena->set_named_prop("state-player", owner);
}
twa_graph_ptr
highlight_strategy(twa_graph_ptr& aut, const strategy_t& s,
unsigned color)
{
unsigned ns = aut->num_states();
auto* highlight = aut->get_or_set_named_prop<std::map<unsigned, unsigned>>
("highlight-edges");
for (auto [src, n]: s)
{
if (src >= ns)
throw std::runtime_error
("highlight_strategy(): strategy refers to unexisting states");
unsigned int i = 0;
for (auto& t: aut->out(src))
if (i++ == n)
{
(*highlight)[aut->edge_number(t)] = color;
break;
}
}
return aut;
}
twa_graph_ptr
solved_game::highlight_strategy(unsigned player, unsigned color)
{
auto aut = std::const_pointer_cast<twa_graph>(arena);
auto* highlight = aut->get_or_set_named_prop<std::map<unsigned, unsigned>>
("highlight-states");
unsigned ns = aut->num_states();
for (unsigned i = 0; i < ns; ++i)
if (player_winning_at(player, i))
(*highlight)[i] = color;
return spot::highlight_strategy(aut, winning_strategy[!!player], color);
}
}
......@@ -50,6 +50,24 @@ namespace spot
typedef std::unordered_set<unsigned> region_t;
typedef std::unordered_map<unsigned, unsigned> strategy_t;
struct SPOT_API solved_game
{
const_twa_graph_ptr arena;
region_t winning_region[2];
strategy_t winning_strategy[2];
/// \brief Highlight the edges of a strategy on the automaton.
twa_graph_ptr highlight_strategy(unsigned player, unsigned color);
bool player_winning_at(unsigned player, unsigned state)
{
auto& w = winning_region[player];
return w.find(state) != w.end();
}
};
/// \brief solve a parity-game
///
/// The arena is a deterministic max odd parity automaton with a
......@@ -59,10 +77,16 @@ namespace spot
/// game for player 1 using Zielonka's recursive algorithm.
/// \cite zielonka.98.tcs
SPOT_API
void parity_game_solve(const const_twa_graph_ptr& arena,
region_t (&w)[2], strategy_t (&s)[2]);
solved_game parity_game_solve(const const_twa_graph_ptr& arena);
/// \brief Print a max odd parity game using PG-solver syntax
SPOT_API
void pg_print(std::ostream& os, const const_twa_graph_ptr& arena);
/// \brief Highlight the edges of a strategy on an automaton.
SPOT_API
twa_graph_ptr highlight_strategy(twa_graph_ptr& arena,
const strategy_t& s,
unsigned color);
}
......@@ -362,6 +362,7 @@ TESTS_ipython = \
python/ltsmin-dve.ipynb \
python/ltsmin-pml.ipynb \
python/parity.ipynb \
python/paritygame.ipynb \
python/product.ipynb \
python/randaut.ipynb \
python/randltl.ipynb \
......
%% Cell type:code id: tags:
``` python
import spot
spot.setup()
```
%% Cell type:markdown id: tags:
# Support for parity games
The support for parity games is currently quite rudimentary, as Spot currently only uses those games in `ltlsynt`.
In essence, a parity game is just a parity automaton with a property named `state-player` that stores the player owning each state. The players are named 0 and 1.
Player 1 is winning if it has a strategy to satisfy the acceptance condition regardless of player 0's moves.
Player 0 is winning if it has a strategy to not satisfy the acceptance codition regardless of player 1's moves.
%% Cell type:markdown id: tags:
## Input/Output
An extension of the HOA format makes it possible to store the `state-player` property. This allows us to read the parity game constructed by `ltlsynt` using `spot.automaton()` like any other automaton.
%% Cell type:code id: tags:
``` python
game = spot.automaton("ltlsynt --ins=a --outs=b -f '!b & GFa <-> Gb' --print-game-hoa |");
game
```
%%%% Output: execute_result
![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.43.0 (0)--><!-- Pages: 1 --><svg width="567pt" height="338pt"viewBox="0.00 0.00 566.58 337.76" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1.0 1.0) rotate(0) translate(4 333.76)"><polygon fill="white" stroke="transparent" points="-4,4 -4,-333.76 562.58,-333.76 562.58,4 -4,4"/><text text-anchor="start" x="197.79" y="-315.56" font-family="Lato" font-size="14.00">Fin(</text><text text-anchor="start" x="220.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text><text text-anchor="start" x="236.79" y="-315.56" font-family="Lato" font-size="14.00">) &amp; (Inf(</text><text text-anchor="start" x="282.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text><text text-anchor="start" x="298.79" y="-315.56" font-family="Lato" font-size="14.00">) | Fin(</text><text text-anchor="start" x="336.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#1f78b4">⓿</text><text text-anchor="start" x="352.79" y="-315.56" font-family="Lato" font-size="14.00">))</text><text text-anchor="start" x="223.79" y="-301.56" font-family="Lato" font-size="14.00">[parity max odd 3]</text><!-- I --><!-- 0 --><g id="node2" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="56" cy="-171.76" rx="18" ry="18"/><text text-anchor="middle" x="56" y="-168.06" font-family="Lato" font-size="14.00">0</text></g><!-- I&#45;&gt;0 --><g id="edge1" class="edge"><title>I&#45;&gt;0</title><path fill="none" stroke="black" d="M1.15,-171.76C2.79,-171.76 17.15,-171.76 30.63,-171.76"/><polygon fill="black" stroke="black" points="37.94,-171.76 30.94,-174.91 34.44,-171.76 30.94,-171.76 30.94,-171.76 30.94,-171.76 34.44,-171.76 30.94,-168.61 37.94,-171.76 37.94,-171.76"/></g><!-- 1 --><g id="node3" class="node"><title>1</title><polygon fill="#ffffaa" stroke="black" points="148.98,-163.76 126.02,-145.76 148.98,-127.76 171.94,-145.76 148.98,-163.76"/><text text-anchor="middle" x="148.98" y="-142.06" font-family="Lato" font-size="14.00">1</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M69.9,-159.68C76.09,-154.68 83.92,-149.43 92,-146.76 101.41,-143.65 112.21,-142.86 121.8,-143.03"/><polygon fill="black" stroke="black" points="128.85,-143.33 121.72,-146.18 125.35,-143.18 121.86,-143.04 121.86,-143.04 121.86,-143.04 125.35,-143.18 121.99,-139.89 128.85,-143.33 128.85,-143.33"/><text text-anchor="start" x="94.5" y="-165.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="92" y="-150.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 2 --><g id="node4" class="node"><title>2</title><polygon fill="#ffffaa" stroke="black" points="148.98,-217.76 126.02,-199.76 148.98,-181.76 171.94,-199.76 148.98,-217.76"/><text text-anchor="middle" x="148.98" y="-196.06" font-family="Lato" font-size="14.00">2</text></g><!-- 0&#45;&gt;2 --><g id="edge3" class="edge"><title>0&#45;&gt;2</title><path fill="none" stroke="black" d="M73.69,-176.89C88.1,-181.33 109.07,-187.78 125.05,-192.7"/><polygon fill="black" stroke="black" points="132.01,-194.84 124.39,-195.79 128.66,-193.81 125.32,-192.78 125.32,-192.78 125.32,-192.78 128.66,-193.81 126.24,-189.77 132.01,-194.84 132.01,-194.84"/><text text-anchor="start" x="96.5" y="-205.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="92" y="-190.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 3 --><g id="node5" class="node"><title>3</title><ellipse fill="#ffffaa" stroke="black" cx="241.96" cy="-60.76" rx="18" ry="18"/><text text-anchor="middle" x="241.96" y="-57.06" font-family="Lato" font-size="14.00">3</text></g><!-- 1&#45;&gt;3 --><g id="edge4" class="edge"><title>1&#45;&gt;3</title><path fill="none" stroke="black" d="M160.06,-136.34C175.16,-122.24 203.86,-95.42 222.7,-77.82"/><polygon fill="black" stroke="black" points="228.21,-72.67 225.24,-79.75 225.65,-75.06 223.09,-77.45 223.09,-77.45 223.09,-77.45 225.65,-75.06 220.94,-75.15 228.21,-72.67 228.21,-72.67"/><text text-anchor="start" x="191.96" y="-126.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="189.96" y="-111.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 4 --><g id="node6" class="node"><title>4</title><ellipse fill="#ffffaa" stroke="black" cx="241.96" cy="-182.76" rx="18" ry="18"/><text text-anchor="middle" x="241.96" y="-179.06" font-family="Lato" font-size="14.00">4</text></g><!-- 1&#45;&gt;4 --><g id="edge5" class="edge"><title>1&#45;&gt;4</title><path fill="none" stroke="black" d="M170.91,-146.58C181.75,-147.62 194.98,-149.89 205.96,-154.76 212.12,-157.49 218.12,-161.58 223.37,-165.8"/><polygon fill="black" stroke="black" points="228.73,-170.36 221.36,-168.22 226.07,-168.09 223.4,-165.83 223.4,-165.83 223.4,-165.83 226.07,-168.09 225.44,-163.43 228.73,-170.36 228.73,-170.36"/><text text-anchor="start" x="193.96" y="-173.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="189.96" y="-158.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 2&#45;&gt;4 --><g id="edge6" class="edge"><title>2&#45;&gt;4</title><path fill="none" stroke="black" d="M167.95,-196.4C181.93,-193.79 201.45,-190.14 216.79,-187.27"/><polygon fill="black" stroke="black" points="223.94,-185.94 217.64,-190.32 220.5,-186.58 217.06,-187.22 217.06,-187.22 217.06,-187.22 220.5,-186.58 216.48,-184.13 223.94,-185.94 223.94,-185.94"/><text text-anchor="start" x="193.96" y="-210.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="189.96" y="-195.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 5 --><g id="node7" class="node"><title>5</title><ellipse fill="#ffffaa" stroke="black" cx="427.92" cy="-140.76" rx="18" ry="18"/><text text-anchor="middle" x="427.92" y="-137.06" font-family="Lato" font-size="14.00">5</text></g><!-- 2&#45;&gt;5 --><g id="edge7" class="edge"><title>2&#45;&gt;5</title><path fill="none" stroke="black" d="M160.75,-208.85C168.39,-214.75 179.16,-222.01 189.96,-225.76 275.06,-255.28 319.26,-296.01 391.92,-242.76 413.34,-227.05 401.22,-210.86 409.92,-185.76 412.38,-178.66 415.21,-170.99 417.85,-164.03"/><polygon fill="black" stroke="black" points="420.4,-157.35 420.84,-165.01 419.15,-160.62 417.9,-163.89 417.9,-163.89 417.9,-163.89 419.15,-160.62 414.96,-162.76 420.4,-157.35 420.4,-157.35"/><text text-anchor="start" x="279.96" y="-282.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="277.96" y="-267.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 6 --><g id="node8" class="node"><title>6</title><polygon fill="#ffffaa" stroke="black" points="528.25,-71.76 505.29,-53.76 528.25,-35.76 551.21,-53.76 528.25,-71.76"/><text text-anchor="middle" x="528.25" y="-50.06" font-family="Lato" font-size="14.00">6</text></g><!-- 3&#45;&gt;6 --><g id="edge8" class="edge"><title>3&#45;&gt;6</title><path fill="none" stroke="black" d="M257.63,-51.19C263.78,-47.39 271.08,-43.12 277.96,-39.76 319.9,-19.23 330.01,-10.35 375.92,-1.76 425.97,7.61 481.93,-23.1 509.68,-41.29"/><polygon fill="black" stroke="black" points="515.79,-45.4 508.22,-44.11 512.88,-43.45 509.98,-41.5 509.98,-41.5 509.98,-41.5 512.88,-43.45 511.74,-38.88 515.79,-45.4 515.79,-45.4"/><text text-anchor="start" x="378.42" y="-20.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="375.92" y="-5.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 7 --><g id="node9" class="node"><title>7</title><polygon fill="#ffffaa" stroke="black" points="334.94,-124.76 311.98,-106.76 334.94,-88.76 357.89,-106.76 334.94,-124.76"/><text text-anchor="middle" x="334.94" y="-103.06" font-family="Lato" font-size="14.00">7</text></g><!-- 3&#45;&gt;7 --><g id="edge9" class="edge"><title>3&#45;&gt;7</title><path fill="none" stroke="black" d="M258.39,-68.56C273.79,-76.35 297.5,-88.33 314.24,-96.8"/><polygon fill="black" stroke="black" points="320.51,-99.97 312.84,-99.62 317.38,-98.39 314.26,-96.81 314.26,-96.81 314.26,-96.81 317.38,-98.39 315.68,-94 320.51,-99.97 320.51,-99.97"/><text text-anchor="start" x="282.46" y="-104.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="277.96" y="-89.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 8 --><g id="node10" class="node"><title>8</title><polygon fill="#ffffaa" stroke="black" points="334.94,-222.76 311.98,-204.76 334.94,-186.76 357.89,-204.76 334.94,-222.76"/><text text-anchor="middle" x="334.94" y="-201.06" font-family="Lato" font-size="14.00">8</text></g><!-- 4&#45;&gt;8 --><g id="edge10" class="edge"><title>4&#45;&gt;8</title><path fill="none" stroke="black" d="M259.64,-186.79C273.79,-190.21 294.25,-195.16 310.12,-199"/><polygon fill="black" stroke="black" points="317.05,-200.67 309.5,-202.09 313.65,-199.85 310.24,-199.03 310.24,-199.03 310.24,-199.03 313.65,-199.85 310.98,-195.97 317.05,-200.67 317.05,-200.67"/><text text-anchor="start" x="281.46" y="-213.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="277.96" y="-198.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 5&#45;&gt;6 --><g id="edge12" class="edge"><title>5&#45;&gt;6</title><path fill="none" stroke="black" d="M442.18,-129.03C460.14,-113.14 492.15,-84.82 511.36,-67.81"/><polygon fill="black" stroke="black" points="516.89,-62.92 513.73,-69.92 514.27,-65.24 511.65,-67.56 511.65,-67.56 511.65,-67.56 514.27,-65.24 509.56,-65.2 516.89,-62.92 516.89,-62.92"/><text text-anchor="start" x="466.42" y="-125.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="463.92" y="-110.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 5&#45;&gt;7 --><g id="edge11" class="edge"><title>5&#45;&gt;7</title><path fill="none" stroke="black" d="M409.86,-142.24C399.69,-142.52 386.71,-141.81 375.92,-137.76 366.67,-134.29 357.82,-127.88 350.82,-121.79"/><polygon fill="black" stroke="black" points="345.4,-116.81 352.69,-119.22 347.98,-119.18 350.56,-121.55 350.56,-121.55 350.56,-121.55 347.98,-119.18 348.43,-123.87 345.4,-116.81 345.4,-116.81"/><text text-anchor="start" x="380.42" y="-159.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="375.92" y="-144.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 6&#45;&gt;3 --><g id="edge13" class="edge"><title>6&#45;&gt;3</title><path fill="none" stroke="black" d="M505.57,-54.29C453.62,-55.57 322.27,-58.81 267.52,-60.15"/><polygon fill="black" stroke="black" points="260.31,-60.33 267.23,-57.01 263.81,-60.25 267.31,-60.16 267.31,-60.16 267.31,-60.16 263.81,-60.25 267.39,-63.31 260.31,-60.33 260.31,-60.33"/><text text-anchor="start" x="379.42" y="-75.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="375.92" y="-60.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 7&#45;&gt;5 --><g id="edge14" class="edge"><title>7&#45;&gt;5</title><path fill="none" stroke="black" d="M352.29,-102.15C363.83,-99.77 379.4,-98.37 391.92,-103.76 400.16,-107.31 407.38,-113.87 413.08,-120.49"/><polygon fill="black" stroke="black" points="417.5,-126 410.66,-122.51 415.31,-123.27 413.12,-120.54 413.12,-120.54 413.12,-120.54 415.31,-123.27 415.57,-118.57 417.5,-126 417.5,-126"/><text text-anchor="start" x="379.42" y="-122.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="375.92" y="-107.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 8&#45;&gt;4 --><g id="edge15" class="edge"><title>8&#45;&gt;4</title><path fill="none" stroke="black" d="M327.6,-192.49C320.95,-181.1 309.32,-164.86 293.96,-157.76 282.73,-152.57 270.27,-158.46 260.47,-165.83"/><polygon fill="black" stroke="black" points="255.04,-170.26 258.47,-163.39 257.75,-168.04 260.47,-165.83 260.47,-165.83 260.47,-165.83 257.75,-168.04 262.46,-168.27 255.04,-170.26 255.04,-170.26"/><text text-anchor="start" x="281.96" y="-176.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="277.96" y="-161.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 9 --><g id="node11" class="node"><title>9</title><ellipse fill="#ffffaa" stroke="black" cx="427.92" cy="-212.76" rx="18" ry="18"/><text text-anchor="middle" x="427.92" y="-209.06" font-family="Lato" font-size="14.00">9</text></g><!-- 8&#45;&gt;9 --><g id="edge16" class="edge"><title>8&#45;&gt;9</title><path fill="none" stroke="black" d="M356.13,-206.53C369.86,-207.74 388.1,-209.35 402.62,-210.62"/><polygon fill="black" stroke="black" points="409.84,-211.26 402.59,-213.78 406.35,-210.95 402.86,-210.64 402.86,-210.64 402.86,-210.64 406.35,-210.95 403.14,-207.51 409.84,-211.26 409.84,-211.26"/><text text-anchor="start" x="377.92" y="-227.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="375.92" y="-212.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 10 --><g id="node12" class="node"><title>10</title><polygon fill="#ffffaa" stroke="black" points="528.25,-229.76 498.08,-211.76 528.25,-193.76 558.41,-211.76 528.25,-229.76"/><text text-anchor="middle" x="528.25" y="-208.06" font-family="Lato" font-size="14.00">10</text></g><!-- 9&#45;&gt;10 --><g id="edge17" class="edge"><title>9&#45;&gt;10</title><path fill="none" stroke="black" d="M441.39,-200.41C447.61,-195.11 455.58,-189.52 463.92,-186.76 479.35,-181.65 496.47,-189.25 509.02,-197.37"/><polygon fill="black" stroke="black" points="514.78,-201.34 507.23,-199.96 511.9,-199.36 509.02,-197.37 509.02,-197.37 509.02,-197.37 511.9,-199.36 510.81,-194.78 514.78,-201.34 514.78,-201.34"/><text text-anchor="start" x="467.42" y="-205.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="463.92" y="-190.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 10&#45;&gt;9 --><g id="edge18" class="edge"><title>10&#45;&gt;9</title><path fill="none" stroke="black" d="M503.51,-215.16C491.63,-216.48 477.02,-217.51 463.92,-216.76 460.44,-216.56 456.77,-216.25 453.17,-215.89"/><polygon fill="black" stroke="black" points="445.97,-215.1 453.27,-212.73 449.45,-215.48 452.93,-215.87 452.93,-215.87 452.93,-215.87 449.45,-215.48 452.59,-219 445.97,-215.1 445.97,-215.1"/><text text-anchor="start" x="467.42" y="-235.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="463.92" y="-220.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g></g></svg>)
<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fcb3c55f9f0> >
%% Cell type:markdown id: tags:
In the graphical output, player 0 is represented by circles (or ellipses or rounded rectangles depending on the situations), while player 1's states are diamond shaped. In the case of `ltlsynt`, player 0 plays the role of the environment, and player 1 plays the role of the controler.
In the HOA output, a header `spot-state-player` (or `spot.state-player` in HOA 1.1) lists the owner of each state.
%% Cell type:code id: tags:
``` python
print(game.to_str('hoa'))
```
%% Cell type:markdown id: tags:
# Solving games
%% Cell type:markdown id: tags:
The `parity_game_solve()` function returns a `solved_game` object.
%% Cell type:code id: tags:
``` python
sol = spot.parity_game_solve(game)
```
%% Cell type:markdown id: tags:
The solved game can be queried to know if a player is winning when the game starts in some given.
%% Cell type:code id: tags:
``` python
sol.player_winning_at(1, game.get_init_state_number())
```
%%%% Output: execute_result
True
%% Cell type:markdown id: tags:
Calling the `highlight_strategy` method will decorate the original game with colors showing the winning region (states from which a player has a strategy to win), and strategy (which transition should be used for each winning state owned by that player) of a given player. Let's paint the strategy of player 1 in green (color 4) for this example:
%% Cell type:code id: tags:
``` python
sol.highlight_strategy(1, 4)
```
%%%% Output: execute_result
![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.43.0 (0)--><!-- Pages: 1 --><svg width="567pt" height="338pt"viewBox="0.00 0.00 566.58 337.76" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1.0 1.0) rotate(0) translate(4 333.76)"><polygon fill="white" stroke="transparent" points="-4,4 -4,-333.76 562.58,-333.76 562.58,4 -4,4"/><text text-anchor="start" x="197.79" y="-315.56" font-family="Lato" font-size="14.00">Fin(</text><text text-anchor="start" x="220.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text><text text-anchor="start" x="236.79" y="-315.56" font-family="Lato" font-size="14.00">) &amp; (Inf(</text><text text-anchor="start" x="282.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text><text text-anchor="start" x="298.79" y="-315.56" font-family="Lato" font-size="14.00">) | Fin(</text><text text-anchor="start" x="336.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#1f78b4">⓿</text><text text-anchor="start" x="352.79" y="-315.56" font-family="Lato" font-size="14.00">))</text><text text-anchor="start" x="223.79" y="-301.56" font-family="Lato" font-size="14.00">[parity max odd 3]</text><!-- I --><!-- 0 --><g id="node2" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="#33a02c" stroke-width="2" cx="56" cy="-171.76" rx="18" ry="18"/><text text-anchor="middle" x="56" y="-168.06" font-family="Lato" font-size="14.00">0</text></g><!-- I&#45;&gt;0 --><g id="edge1" class="edge"><title>I&#45;&gt;0</title><path fill="none" stroke="black" d="M1.15,-171.76C2.79,-171.76 17.15,-171.76 30.63,-171.76"/><polygon fill="black" stroke="black" points="37.94,-171.76 30.94,-174.91 34.44,-171.76 30.94,-171.76 30.94,-171.76 30.94,-171.76 34.44,-171.76 30.94,-168.61 37.94,-171.76 37.94,-171.76"/></g><!-- 1 --><g id="node3" class="node"><title>1</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="148.98,-163.76 126.02,-145.76 148.98,-127.76 171.94,-145.76 148.98,-163.76"/><text text-anchor="middle" x="148.98" y="-142.06" font-family="Lato" font-size="14.00">1</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M69.9,-159.68C76.09,-154.68 83.92,-149.43 92,-146.76 101.41,-143.65 112.21,-142.86 121.8,-143.03"/><polygon fill="black" stroke="black" points="128.85,-143.33 121.72,-146.18 125.35,-143.18 121.86,-143.04 121.86,-143.04 121.86,-143.04 125.35,-143.18 121.99,-139.89 128.85,-143.33 128.85,-143.33"/><text text-anchor="start" x="94.5" y="-165.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="92" y="-150.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 2 --><g id="node4" class="node"><title>2</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="148.98,-217.76 126.02,-199.76 148.98,-181.76 171.94,-199.76 148.98,-217.76"/><text text-anchor="middle" x="148.98" y="-196.06" font-family="Lato" font-size="14.00">2</text></g><!-- 0&#45;&gt;2 --><g id="edge3" class="edge"><title>0&#45;&gt;2</title><path fill="none" stroke="black" d="M73.69,-176.89C88.1,-181.33 109.07,-187.78 125.05,-192.7"/><polygon fill="black" stroke="black" points="132.01,-194.84 124.39,-195.79 128.66,-193.81 125.32,-192.78 125.32,-192.78 125.32,-192.78 128.66,-193.81 126.24,-189.77 132.01,-194.84 132.01,-194.84"/><text text-anchor="start" x="96.5" y="-205.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="92" y="-190.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 3 --><g id="node5" class="node"><title>3</title><ellipse fill="#ffffaa" stroke="black" cx="241.96" cy="-60.76" rx="18" ry="18"/><text text-anchor="middle" x="241.96" y="-57.06" font-family="Lato" font-size="14.00">3</text></g><!-- 1&#45;&gt;3 --><g id="edge4" class="edge"><title>1&#45;&gt;3</title><path fill="none" stroke="black" d="M160.06,-136.34C175.16,-122.24 203.86,-95.42 222.7,-77.82"/><polygon fill="black" stroke="black" points="228.21,-72.67 225.24,-79.75 225.65,-75.06 223.09,-77.45 223.09,-77.45 223.09,-77.45 225.65,-75.06 220.94,-75.15 228.21,-72.67 228.21,-72.67"/><text text-anchor="start" x="191.96" y="-126.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="189.96" y="-111.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 4 --><g id="node6" class="node"><title>4</title><ellipse fill="#ffffaa" stroke="#33a02c" stroke-width="2" cx="241.96" cy="-182.76" rx="18" ry="18"/><text text-anchor="middle" x="241.96" y="-179.06" font-family="Lato" font-size="14.00">4</text></g><!-- 1&#45;&gt;4 --><g id="edge5" class="edge"><title>1&#45;&gt;4</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M170.91,-146.58C181.75,-147.62 194.98,-149.89 205.96,-154.76 212.12,-157.49 218.12,-161.58 223.37,-165.8"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="228.73,-170.36 221.36,-168.22 225.74,-168.48 223.08,-166.21 223.4,-165.83 223.72,-165.44 226.39,-167.71 225.44,-163.43 228.73,-170.36 228.73,-170.36"/><text text-anchor="start" x="193.96" y="-173.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="189.96" y="-158.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 2&#45;&gt;4 --><g id="edge6" class="edge"><title>2&#45;&gt;4</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M167.95,-196.4C181.93,-193.79 201.45,-190.14 216.79,-187.27"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="223.94,-185.94 217.64,-190.32 220.6,-187.07 217.15,-187.72 217.06,-187.22 216.97,-186.73 220.41,-186.09 216.48,-184.13 223.94,-185.94 223.94,-185.94"/><text text-anchor="start" x="193.96" y="-210.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="189.96" y="-195.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 5 --><g id="node7" class="node"><title>5</title><ellipse fill="#ffffaa" stroke="black" cx="427.92" cy="-140.76" rx="18" ry="18"/><text text-anchor="middle" x="427.92" y="-137.06" font-family="Lato" font-size="14.00">5</text></g><!-- 2&#45;&gt;5 --><g id="edge7" class="edge"><title>2&#45;&gt;5</title><path fill="none" stroke="black" d="M160.75,-208.85C168.39,-214.75 179.16,-222.01 189.96,-225.76 275.06,-255.28 319.26,-296.01 391.92,-242.76 413.34,-227.05 401.22,-210.86 409.92,-185.76 412.38,-178.66 415.21,-170.99 417.85,-164.03"/><polygon fill="black" stroke="black" points="420.4,-157.35 420.84,-165.01 419.15,-160.62 417.9,-163.89 417.9,-163.89 417.9,-163.89 419.15,-160.62 414.96,-162.76 420.4,-157.35 420.4,-157.35"/><text text-anchor="start" x="279.96" y="-282.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="277.96" y="-267.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 6 --><g id="node8" class="node"><title>6</title><polygon fill="#ffffaa" stroke="black" points="528.25,-71.76 505.29,-53.76 528.25,-35.76 551.21,-53.76 528.25,-71.76"/><text text-anchor="middle" x="528.25" y="-50.06" font-family="Lato" font-size="14.00">6</text></g><!-- 3&#45;&gt;6 --><g id="edge8" class="edge"><title>3&#45;&gt;6</title><path fill="none" stroke="black" d="M257.63,-51.19C263.78,-47.39 271.08,-43.12 277.96,-39.76 319.9,-19.23 330.01,-10.35 375.92,-1.76 425.97,7.61 481.93,-23.1 509.68,-41.29"/><polygon fill="black" stroke="black" points="515.79,-45.4 508.22,-44.11 512.88,-43.45 509.98,-41.5 509.98,-41.5 509.98,-41.5 512.88,-43.45 511.74,-38.88 515.79,-45.4 515.79,-45.4"/><text text-anchor="start" x="378.42" y="-20.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="375.92" y="-5.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 7 --><g id="node9" class="node"><title>7</title><polygon fill="#ffffaa" stroke="black" points="334.94,-124.76 311.98,-106.76 334.94,-88.76 357.89,-106.76 334.94,-124.76"/><text text-anchor="middle" x="334.94" y="-103.06" font-family="Lato" font-size="14.00">7</text></g><!-- 3&#45;&gt;7 --><g id="edge9" class="edge"><title>3&#45;&gt;7</title><path fill="none" stroke="black" d="M258.39,-68.56C273.79,-76.35 297.5,-88.33 314.24,-96.8"/><polygon fill="black" stroke="black" points="320.51,-99.97 312.84,-99.62 317.38,-98.39 314.26,-96.81 314.26,-96.81 314.26,-96.81 317.38,-98.39 315.68,-94 320.51,-99.97 320.51,-99.97"/><text text-anchor="start" x="282.46" y="-104.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="277.96" y="-89.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 8 --><g id="node10" class="node"><title>8</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="334.94,-222.76 311.98,-204.76 334.94,-186.76 357.89,-204.76 334.94,-222.76"/><text text-anchor="middle" x="334.94" y="-201.06" font-family="Lato" font-size="14.00">8</text></g><!-- 4&#45;&gt;8 --><g id="edge10" class="edge"><title>4&#45;&gt;8</title><path fill="none" stroke="black" d="M259.64,-186.79C273.79,-190.21 294.25,-195.16 310.12,-199"/><polygon fill="black" stroke="black" points="317.05,-200.67 309.5,-202.09 313.65,-199.85 310.24,-199.03 310.24,-199.03 310.24,-199.03 313.65,-199.85 310.98,-195.97 317.05,-200.67 317.05,-200.67"/><text text-anchor="start" x="281.46" y="-213.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="277.96" y="-198.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 5&#45;&gt;6 --><g id="edge12" class="edge"><title>5&#45;&gt;6</title><path fill="none" stroke="black" d="M442.18,-129.03C460.14,-113.14 492.15,-84.82 511.36,-67.81"/><polygon fill="black" stroke="black" points="516.89,-62.92 513.73,-69.92 514.27,-65.24 511.65,-67.56 511.65,-67.56 511.65,-67.56 514.27,-65.24 509.56,-65.2 516.89,-62.92 516.89,-62.92"/><text text-anchor="start" x="466.42" y="-125.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="463.92" y="-110.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 5&#45;&gt;7 --><g id="edge11" class="edge"><title>5&#45;&gt;7</title><path fill="none" stroke="black" d="M409.86,-142.24C399.69,-142.52 386.71,-141.81 375.92,-137.76 366.67,-134.29 357.82,-127.88 350.82,-121.79"/><polygon fill="black" stroke="black" points="345.4,-116.81 352.69,-119.22 347.98,-119.18 350.56,-121.55 350.56,-121.55 350.56,-121.55 347.98,-119.18 348.43,-123.87 345.4,-116.81 345.4,-116.81"/><text text-anchor="start" x="380.42" y="-159.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="375.92" y="-144.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 6&#45;&gt;3 --><g id="edge13" class="edge"><title>6&#45;&gt;3</title><path fill="none" stroke="black" d="M505.57,-54.29C453.62,-55.57 322.27,-58.81 267.52,-60.15"/><polygon fill="black" stroke="black" points="260.31,-60.33 267.23,-57.01 263.81,-60.25 267.31,-60.16 267.31,-60.16 267.31,-60.16 263.81,-60.25 267.39,-63.31 260.31,-60.33 260.31,-60.33"/><text text-anchor="start" x="379.42" y="-75.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="375.92" y="-60.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 7&#45;&gt;5 --><g id="edge14" class="edge"><title>7&#45;&gt;5</title><path fill="none" stroke="black" d="M352.29,-102.15C363.83,-99.77 379.4,-98.37 391.92,-103.76 400.16,-107.31 407.38,-113.87 413.08,-120.49"/><polygon fill="black" stroke="black" points="417.5,-126 410.66,-122.51 415.31,-123.27 413.12,-120.54 413.12,-120.54 413.12,-120.54 415.31,-123.27 415.57,-118.57 417.5,-126 417.5,-126"/><text text-anchor="start" x="379.42" y="-122.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="375.92" y="-107.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 8&#45;&gt;4 --><g id="edge15" class="edge"><title>8&#45;&gt;4</title><path fill="none" stroke="black" d="M327.6,-192.49C320.95,-181.1 309.32,-164.86 293.96,-157.76 282.73,-152.57 270.27,-158.46 260.47,-165.83"/><polygon fill="black" stroke="black" points="255.04,-170.26 258.47,-163.39 257.75,-168.04 260.47,-165.83 260.47,-165.83 260.47,-165.83 257.75,-168.04 262.46,-168.27 255.04,-170.26 255.04,-170.26"/><text text-anchor="start" x="281.96" y="-176.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="277.96" y="-161.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 9 --><g id="node11" class="node"><title>9</title><ellipse fill="#ffffaa" stroke="#33a02c" stroke-width="2" cx="427.92" cy="-212.76" rx="18" ry="18"/><text text-anchor="middle" x="427.92" y="-209.06" font-family="Lato" font-size="14.00">9</text></g><!-- 8&#45;&gt;9 --><g id="edge16" class="edge"><title>8&#45;&gt;9</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M356.13,-206.53C369.86,-207.74 388.1,-209.35 402.62,-210.62"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="409.84,-211.26 402.59,-213.78 406.31,-211.45 402.82,-211.14 402.86,-210.64 402.91,-210.15 406.39,-210.45 403.14,-207.51 409.84,-211.26 409.84,-211.26"/><text text-anchor="start" x="377.92" y="-227.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="375.92" y="-212.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 10 --><g id="node12" class="node"><title>10</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="528.25,-229.76 498.08,-211.76 528.25,-193.76 558.41,-211.76 528.25,-229.76"/><text text-anchor="middle" x="528.25" y="-208.06" font-family="Lato" font-size="14.00">10</text></g><!-- 9&#45;&gt;10 --><g id="edge17" class="edge"><title>9&#45;&gt;10</title><path fill="none" stroke="black" d="M441.39,-200.41C447.61,-195.11 455.58,-189.52 463.92,-186.76 479.35,-181.65 496.47,-189.25 509.02,-197.37"/><polygon fill="black" stroke="black" points="514.78,-201.34 507.23,-199.96 511.9,-199.36 509.02,-197.37 509.02,-197.37 509.02,-197.37 511.9,-199.36 510.81,-194.78 514.78,-201.34 514.78,-201.34"/><text text-anchor="start" x="467.42" y="-205.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="463.92" y="-190.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 10&#45;&gt;9 --><g id="edge18" class="edge"><title>10&#45;&gt;9</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M503.51,-215.16C491.63,-216.48 477.02,-217.51 463.92,-216.76 460.44,-216.56 456.77,-216.25 453.17,-215.89"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="445.97,-215.1 453.27,-212.73 449.51,-214.99 452.98,-215.37 452.93,-215.87 452.88,-216.36 449.4,-215.98 452.59,-219 445.97,-215.1 445.97,-215.1"/><text text-anchor="start" x="467.42" y="-235.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="463.92" y="-220.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g></g></svg>)
<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fcb3c55a1e0> >
%% Cell type:markdown id: tags:
Because `highlight_strategy` simply decorates the original automaton, we can call it a second time to show that player 0 could win if it had a way to reach the red (color 5) region and play the red strategy.
%% Cell type:code id: tags:
``` python
sol.highlight_strategy(0, 5)
```
%%%% Output: execute_result
![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.43.0 (0)--><!-- Pages: 1 --><svg width="567pt" height="338pt"viewBox="0.00 0.00 566.58 337.76" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1.0 1.0) rotate(0) translate(4 333.76)"><polygon fill="white" stroke="transparent" points="-4,4 -4,-333.76 562.58,-333.76 562.58,4 -4,4"/><text text-anchor="start" x="197.79" y="-315.56" font-family="Lato" font-size="14.00">Fin(</text><text text-anchor="start" x="220.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text><text text-anchor="start" x="236.79" y="-315.56" font-family="Lato" font-size="14.00">) &amp; (Inf(</text><text text-anchor="start" x="282.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text><text text-anchor="start" x="298.79" y="-315.56" font-family="Lato" font-size="14.00">) | Fin(</text><text text-anchor="start" x="336.79" y="-315.56" font-family="Lato" font-size="14.00" fill="#1f78b4">⓿</text><text text-anchor="start" x="352.79" y="-315.56" font-family="Lato" font-size="14.00">))</text><text text-anchor="start" x="223.79" y="-301.56" font-family="Lato" font-size="14.00">[parity max odd 3]</text><!-- I --><!-- 0 --><g id="node2" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="#33a02c" stroke-width="2" cx="56" cy="-171.76" rx="18" ry="18"/><text text-anchor="middle" x="56" y="-168.06" font-family="Lato" font-size="14.00">0</text></g><!-- I&#45;&gt;0 --><g id="edge1" class="edge"><title>I&#45;&gt;0</title><path fill="none" stroke="black" d="M1.15,-171.76C2.79,-171.76 17.15,-171.76 30.63,-171.76"/><polygon fill="black" stroke="black" points="37.94,-171.76 30.94,-174.91 34.44,-171.76 30.94,-171.76 30.94,-171.76 30.94,-171.76 34.44,-171.76 30.94,-168.61 37.94,-171.76 37.94,-171.76"/></g><!-- 1 --><g id="node3" class="node"><title>1</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="148.98,-163.76 126.02,-145.76 148.98,-127.76 171.94,-145.76 148.98,-163.76"/><text text-anchor="middle" x="148.98" y="-142.06" font-family="Lato" font-size="14.00">1</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M69.9,-159.68C76.09,-154.68 83.92,-149.43 92,-146.76 101.41,-143.65 112.21,-142.86 121.8,-143.03"/><polygon fill="black" stroke="black" points="128.85,-143.33 121.72,-146.18 125.35,-143.18 121.86,-143.04 121.86,-143.04 121.86,-143.04 125.35,-143.18 121.99,-139.89 128.85,-143.33 128.85,-143.33"/><text text-anchor="start" x="94.5" y="-165.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="92" y="-150.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 2 --><g id="node4" class="node"><title>2</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="148.98,-217.76 126.02,-199.76 148.98,-181.76 171.94,-199.76 148.98,-217.76"/><text text-anchor="middle" x="148.98" y="-196.06" font-family="Lato" font-size="14.00">2</text></g><!-- 0&#45;&gt;2 --><g id="edge3" class="edge"><title>0&#45;&gt;2</title><path fill="none" stroke="black" d="M73.69,-176.89C88.1,-181.33 109.07,-187.78 125.05,-192.7"/><polygon fill="black" stroke="black" points="132.01,-194.84 124.39,-195.79 128.66,-193.81 125.32,-192.78 125.32,-192.78 125.32,-192.78 128.66,-193.81 126.24,-189.77 132.01,-194.84 132.01,-194.84"/><text text-anchor="start" x="96.5" y="-205.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="92" y="-190.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 3 --><g id="node5" class="node"><title>3</title><ellipse fill="#ffffaa" stroke="#e31a1c" stroke-width="2" cx="241.96" cy="-60.76" rx="18" ry="18"/><text text-anchor="middle" x="241.96" y="-57.06" font-family="Lato" font-size="14.00">3</text></g><!-- 1&#45;&gt;3 --><g id="edge4" class="edge"><title>1&#45;&gt;3</title><path fill="none" stroke="black" d="M160.06,-136.34C175.16,-122.24 203.86,-95.42 222.7,-77.82"/><polygon fill="black" stroke="black" points="228.21,-72.67 225.24,-79.75 225.65,-75.06 223.09,-77.45 223.09,-77.45 223.09,-77.45 225.65,-75.06 220.94,-75.15 228.21,-72.67 228.21,-72.67"/><text text-anchor="start" x="191.96" y="-126.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="189.96" y="-111.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 4 --><g id="node6" class="node"><title>4</title><ellipse fill="#ffffaa" stroke="#33a02c" stroke-width="2" cx="241.96" cy="-182.76" rx="18" ry="18"/><text text-anchor="middle" x="241.96" y="-179.06" font-family="Lato" font-size="14.00">4</text></g><!-- 1&#45;&gt;4 --><g id="edge5" class="edge"><title>1&#45;&gt;4</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M170.91,-146.58C181.75,-147.62 194.98,-149.89 205.96,-154.76 212.12,-157.49 218.12,-161.58 223.37,-165.8"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="228.73,-170.36 221.36,-168.22 225.74,-168.48 223.08,-166.21 223.4,-165.83 223.72,-165.44 226.39,-167.71 225.44,-163.43 228.73,-170.36 228.73,-170.36"/><text text-anchor="start" x="193.96" y="-173.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="189.96" y="-158.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 2&#45;&gt;4 --><g id="edge6" class="edge"><title>2&#45;&gt;4</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M167.95,-196.4C181.93,-193.79 201.45,-190.14 216.79,-187.27"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="223.94,-185.94 217.64,-190.32 220.6,-187.07 217.15,-187.72 217.06,-187.22 216.97,-186.73 220.41,-186.09 216.48,-184.13 223.94,-185.94 223.94,-185.94"/><text text-anchor="start" x="193.96" y="-210.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="189.96" y="-195.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 5 --><g id="node7" class="node"><title>5</title><ellipse fill="#ffffaa" stroke="#e31a1c" stroke-width="2" cx="427.92" cy="-140.76" rx="18" ry="18"/><text text-anchor="middle" x="427.92" y="-137.06" font-family="Lato" font-size="14.00">5</text></g><!-- 2&#45;&gt;5 --><g id="edge7" class="edge"><title>2&#45;&gt;5</title><path fill="none" stroke="black" d="M160.75,-208.85C168.39,-214.75 179.16,-222.01 189.96,-225.76 275.06,-255.28 319.26,-296.01 391.92,-242.76 413.34,-227.05 401.22,-210.86 409.92,-185.76 412.38,-178.66 415.21,-170.99 417.85,-164.03"/><polygon fill="black" stroke="black" points="420.4,-157.35 420.84,-165.01 419.15,-160.62 417.9,-163.89 417.9,-163.89 417.9,-163.89 419.15,-160.62 414.96,-162.76 420.4,-157.35 420.4,-157.35"/><text text-anchor="start" x="279.96" y="-282.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="277.96" y="-267.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 6 --><g id="node8" class="node"><title>6</title><polygon fill="#ffffaa" stroke="#e31a1c" stroke-width="2" points="528.25,-71.76 505.29,-53.76 528.25,-35.76 551.21,-53.76 528.25,-71.76"/><text text-anchor="middle" x="528.25" y="-50.06" font-family="Lato" font-size="14.00">6</text></g><!-- 3&#45;&gt;6 --><g id="edge8" class="edge"><title>3&#45;&gt;6</title><path fill="none" stroke="black" d="M257.63,-51.19C263.78,-47.39 271.08,-43.12 277.96,-39.76 319.9,-19.23 330.01,-10.35 375.92,-1.76 425.97,7.61 481.93,-23.1 509.68,-41.29"/><polygon fill="black" stroke="black" points="515.79,-45.4 508.22,-44.11 512.88,-43.45 509.98,-41.5 509.98,-41.5 509.98,-41.5 512.88,-43.45 511.74,-38.88 515.79,-45.4 515.79,-45.4"/><text text-anchor="start" x="378.42" y="-20.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="375.92" y="-5.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 7 --><g id="node9" class="node"><title>7</title><polygon fill="#ffffaa" stroke="#e31a1c" stroke-width="2" points="334.94,-124.76 311.98,-106.76 334.94,-88.76 357.89,-106.76 334.94,-124.76"/><text text-anchor="middle" x="334.94" y="-103.06" font-family="Lato" font-size="14.00">7</text></g><!-- 3&#45;&gt;7 --><g id="edge9" class="edge"><title>3&#45;&gt;7</title><path fill="none" stroke="#e31a1c" stroke-width="2" d="M258.39,-68.56C273.79,-76.35 297.5,-88.33 314.24,-96.8"/><polygon fill="#e31a1c" stroke="#e31a1c" stroke-width="2" points="320.51,-99.97 312.84,-99.62 317.16,-98.84 314.03,-97.26 314.26,-96.81 314.49,-96.36 317.61,-97.94 315.68,-94 320.51,-99.97 320.51,-99.97"/><text text-anchor="start" x="282.46" y="-104.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="277.96" y="-89.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 8 --><g id="node10" class="node"><title>8</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="334.94,-222.76 311.98,-204.76 334.94,-186.76 357.89,-204.76 334.94,-222.76"/><text text-anchor="middle" x="334.94" y="-201.06" font-family="Lato" font-size="14.00">8</text></g><!-- 4&#45;&gt;8 --><g id="edge10" class="edge"><title>4&#45;&gt;8</title><path fill="none" stroke="black" d="M259.64,-186.79C273.79,-190.21 294.25,-195.16 310.12,-199"/><polygon fill="black" stroke="black" points="317.05,-200.67 309.5,-202.09 313.65,-199.85 310.24,-199.03 310.24,-199.03 310.24,-199.03 313.65,-199.85 310.98,-195.97 317.05,-200.67 317.05,-200.67"/><text text-anchor="start" x="281.46" y="-213.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="277.96" y="-198.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 5&#45;&gt;6 --><g id="edge12" class="edge"><title>5&#45;&gt;6</title><path fill="none" stroke="black" d="M442.18,-129.03C460.14,-113.14 492.15,-84.82 511.36,-67.81"/><polygon fill="black" stroke="black" points="516.89,-62.92 513.73,-69.92 514.27,-65.24 511.65,-67.56 511.65,-67.56 511.65,-67.56 514.27,-65.24 509.56,-65.2 516.89,-62.92 516.89,-62.92"/><text text-anchor="start" x="466.42" y="-125.56" font-family="Lato" font-size="14.00">!a</text><text text-anchor="start" x="463.92" y="-110.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 5&#45;&gt;7 --><g id="edge11" class="edge"><title>5&#45;&gt;7</title><path fill="none" stroke="#e31a1c" stroke-width="2" d="M409.86,-142.24C399.69,-142.52 386.71,-141.81 375.92,-137.76 366.67,-134.29 357.82,-127.88 350.82,-121.79"/><polygon fill="#e31a1c" stroke="#e31a1c" stroke-width="2" points="345.4,-116.81 352.69,-119.22 348.32,-118.81 350.9,-121.18 350.56,-121.55 350.22,-121.91 347.64,-119.55 348.43,-123.87 345.4,-116.81 345.4,-116.81"/><text text-anchor="start" x="380.42" y="-159.56" font-family="Lato" font-size="14.00">a</text><text text-anchor="start" x="375.92" y="-144.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 6&#45;&gt;3 --><g id="edge13" class="edge"><title>6&#45;&gt;3</title><path fill="none" stroke="black" d="M505.57,-54.29C453.62,-55.57 322.27,-58.81 267.52,-60.15"/><polygon fill="black" stroke="black" points="260.31,-60.33 267.23,-57.01 263.81,-60.25 267.31,-60.16 267.31,-60.16 267.31,-60.16 263.81,-60.25 267.39,-63.31 260.31,-60.33 260.31,-60.33"/><text text-anchor="start" x="379.42" y="-75.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="375.92" y="-60.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 7&#45;&gt;5 --><g id="edge14" class="edge"><title>7&#45;&gt;5</title><path fill="none" stroke="black" d="M352.29,-102.15C363.83,-99.77 379.4,-98.37 391.92,-103.76 400.16,-107.31 407.38,-113.87 413.08,-120.49"/><polygon fill="black" stroke="black" points="417.5,-126 410.66,-122.51 415.31,-123.27 413.12,-120.54 413.12,-120.54 413.12,-120.54 415.31,-123.27 415.57,-118.57 417.5,-126 417.5,-126"/><text text-anchor="start" x="379.42" y="-122.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="375.92" y="-107.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 8&#45;&gt;4 --><g id="edge15" class="edge"><title>8&#45;&gt;4</title><path fill="none" stroke="black" d="M327.6,-192.49C320.95,-181.1 309.32,-164.86 293.96,-157.76 282.73,-152.57 270.27,-158.46 260.47,-165.83"/><polygon fill="black" stroke="black" points="255.04,-170.26 258.47,-163.39 257.75,-168.04 260.47,-165.83 260.47,-165.83 260.47,-165.83 257.75,-168.04 262.46,-168.27 255.04,-170.26 255.04,-170.26"/><text text-anchor="start" x="281.96" y="-176.56" font-family="Lato" font-size="14.00">b</text><text text-anchor="start" x="277.96" y="-161.56" font-family="Lato" font-size="14.00" fill="#ff7f00">❷</text></g><!-- 9 --><g id="node11" class="node"><title>9</title><ellipse fill="#ffffaa" stroke="#33a02c" stroke-width="2" cx="427.92" cy="-212.76" rx="18" ry="18"/><text text-anchor="middle" x="427.92" y="-209.06" font-family="Lato" font-size="14.00">9</text></g><!-- 8&#45;&gt;9 --><g id="edge16" class="edge"><title>8&#45;&gt;9</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M356.13,-206.53C369.86,-207.74 388.1,-209.35 402.62,-210.62"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="409.84,-211.26 402.59,-213.78 406.31,-211.45 402.82,-211.14 402.86,-210.64 402.91,-210.15 406.39,-210.45 403.14,-207.51 409.84,-211.26 409.84,-211.26"/><text text-anchor="start" x="377.92" y="-227.56" font-family="Lato" font-size="14.00">!b</text><text text-anchor="start" x="375.92" y="-212.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 10 --><g id="node12" class="node"><title>10</title><polygon fill="#ffffaa" stroke="#33a02c" stroke-width="2" points="528.25,-229.76 498.08,-211.76 528.25,-193.76 558.41,-211.76 528.25,-229.76"/><text text-anchor="middle" x="528.25" y="-208.06" font-family="Lato" font-size="14.00">10</text></g><!-- 9&#45;&gt;10 --><g id="edge17" class="edge"><title>9&#45;&gt;10</title><path fill="none" stroke="black" d="M441.39,-200.41C447.61,-195.11 455.58,-189.52 463.92,-186.76 479.35,-181.65 496.47,-189.25 509.02,-197.37"/><polygon fill="black" stroke="black" points="514.78,-201.34 507.23,-199.96 511.9,-199.36 509.02,-197.37 509.02,-197.37 509.02,-197.37 511.9,-199.36 510.81,-194.78 514.78,-201.34 514.78,-201.34"/><text text-anchor="start" x="467.42" y="-205.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="463.92" y="-190.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g><!-- 10&#45;&gt;9 --><g id="edge18" class="edge"><title>10&#45;&gt;9</title><path fill="none" stroke="#33a02c" stroke-width="2" d="M503.51,-215.16C491.63,-216.48 477.02,-217.51 463.92,-216.76 460.44,-216.56 456.77,-216.25 453.17,-215.89"/><polygon fill="#33a02c" stroke="#33a02c" stroke-width="2" points="445.97,-215.1 453.27,-212.73 449.51,-214.99 452.98,-215.37 452.93,-215.87 452.88,-216.36 449.4,-215.98 452.59,-219 445.97,-215.1 445.97,-215.1"/><text text-anchor="start" x="467.42" y="-235.56" font-family="Lato" font-size="14.00">1</text><text text-anchor="start" x="463.92" y="-220.56" font-family="Lato" font-size="14.00" fill="#ff4da0">❶</text></g></g></svg>)
<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fcb3c55a900> >
%% Cell type:code id: tags:
``` python
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment