{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "found-hurricane",
"metadata": {},
"outputs": [],
"source": [
"import spot\n",
"spot.setup()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "colonial-testimony",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(6, 7, False, False, False)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('Fin(0)&Inf(1)&(Inf(2)|Fin(3)) | (Inf(0)|Fin(1))&Fin(2)&Inf(3)')\n",
"t = spot.zielonka_tree(c); display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "incorrect-protection",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(7, 3)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(7, [3])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "rolled-command",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(7, 2)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(7, [2])"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "affecting-border",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(8, 1)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(7, [1])"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "accepting-clerk",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(9, 2)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(8, [1])"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "flexible-country",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(9, 3)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(9, [1])"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "continental-sessions",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(8, 3)"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(8, [3])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "expired-asian",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(10, 0)"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(8, [0])"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "binary-republic",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(7, 0)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(10, [0,2])"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "starting-liechtenstein",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(10, 0)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(7, [0,2])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "forced-canyon",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(7, 4)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.step(7, [])"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "floppy-chassis",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(6, (Fin(0) & Inf(1)) | (Fin(2) & Inf(3)) | (Fin(4) & Inf(5)))\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(6, 19, True, False, False)"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('Rabin 3')\n",
"print(c)\n",
"t = spot.zielonka_tree(c)\n",
"display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "acquired-rogers",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(6, (Fin(0) | Inf(1)) & (Fin(2) | Inf(3)) & (Fin(4) | Inf(5)))\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(6, 19, False, True, False)"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('Streett 3')\n",
"print(c)\n",
"t = spot.zielonka_tree(c)\n",
"display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "minimal-douglas",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(5, (Inf(0) & Fin(1)) | (Inf(2) & Fin(3) & Fin(4)))\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(2, 5, True, False, False)"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('Inf(0)&Fin(1) | (Inf(2)&Fin(3)&Fin(4))')\n",
"print(c)\n",
"t = spot.zielonka_tree(c)\n",
"display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "tired-thumbnail",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(5, Fin(4) & (Inf(3) | (Fin(2) & (Inf(1) | Fin(0)))))\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(1, 4, True, True, True)"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('parity max odd 5')\n",
"print(c)\n",
"t = spot.zielonka_tree(c)\n",
"display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "structured-palace",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(0, f)\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(1, 0, True, True, True)"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('f')\n",
"print(c)\n",
"t = spot.zielonka_tree(c)\n",
"display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "plain-modern",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(0, t)\n"
]
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(1, 0, True, True, True)"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.acc_cond('t')\n",
"print(c)\n",
"t = spot.zielonka_tree(c)\n",
"display(t)\n",
"t.num_branches(), t.first_branch(), t.has_rabin_shape(), t.has_streett_shape(), t.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "interesting-seller",
"metadata": {},
"outputs": [],
"source": []
}
],
"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.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}