{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import spot\n",
"from buddy import bddtrue\n",
"spot.setup()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Support for games\n",
"\n",
"The support for games is currently quite rudimentary, as Spot currently only uses those games in `ltlsynt`.\n",
"\n",
"In essence, agame is just an ω-automaton with a property named `state-player` that stores the player owning each state. The players are named 0 and 1. The player owning a state can decide what the next transition from this state should be. The goal for player 1 is to force the play to be infinite and to satisfy the acceptance condition of the automaton, while the goal for player 0 is to prevent it by either forcing a finite play, or forcing an infinite play that does not satisfy the acceptance condition.\n",
"\n",
"The support is currently restricted to games that use:\n",
"- `t` acceptance: all infinite run are accepting, and player 0 can only win if it manages to force a finite play (this requires reaching states without successors).\n",
"- max odd parity acceptance: player 0 can win if the maximal value seen infinitely often is even"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Creating games from scratch\n",
"\n",
"Games can be [created like any automaton](https://spot.lrde.epita.fr/tut22.html). \n",
"Using `set_state_players()` will fix the state owners."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" Read an aiger file. Note that we do not support the full \n",
" syntax, but are restricted to:\n",
" Reading an aiger-file
\n",
"\n",
"\n",
"
\n",
"
\n", " An aiger circuit can be transformed into a monitor. If the aiger represents the implementation of a strategy in the context of active control, it can be check for correctness. This is done by computing the intersecting of the monitor and the negation of the specification.\n", "
" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "\n", " It can happen that propositions declared as output are ommited in the aig circuit.\n", " This happens if the output does not appear in the strategy. Since it does not appear in the\n", " strategy it can take arbritrary values.\n", "
" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "True\n" ] }, { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "