{
"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": [
"(8, 3)"
]
},
"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": [
"(8, 2)"
]
},
"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": [
"(9, 2)"
]
},
"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": 19,
"id": "interesting-seller",
"metadata": {},
"outputs": [],
"source": [
"a = spot.automaton(\"\"\"HOA: v1 name: \"(FGp0 & ((XFp0 & F!p1) | F(Gp1 &\n",
"XG!p0))) | G(F!p0 & (XFp0 | F!p1) & F(Gp1 | G!p0))\" States: 14 Start:\n",
"0 AP: 2 \"p1\" \"p0\" Acceptance: 6 (Fin(0) & Fin(1)) | ((Fin(4)|Fin(5)) &\n",
"(Inf(2)&Inf(3))) properties: trans-labels explicit-labels trans-acc\n",
"complete properties: deterministic --BODY-- State: 0 [!0] 1 [0] 2\n",
"State: 1 [!0&!1] 1 {0 1 2 3 5} [0&!1] 3 [!0&1] 4 [0&1] 5 State: 2\n",
"[0&!1] 2 {1} [!0&1] 4 [!0&!1] 6 [0&1] 7 State: 3 [0&!1] 3 {1 3} [!0&1]\n",
"4 [!0&!1] 6 {0 1 2 3 5} [0&1] 8 State: 4 [!0&!1] 4 {1 2 3 5} [!0&1] 4\n",
"{2 4 5} [0&!1] 5 {1 3} [0&1] 5 {4} State: 5 [!0&1] 4 {2 4 5} [0&!1] 5\n",
"{1 3} [0&1] 8 {2 4} [!0&!1] 9 {1 2 3 5} State: 6 [0&!1] 3 {1 3} [!0&1]\n",
"4 [0&1] 5 [!0&!1] 10 State: 7 [!0&1] 4 [0&!1] 7 {1 3} [!0&!1] 11 [0&1]\n",
"12 {0 4} State: 8 [!0&1] 4 {2 4 5} [0&1] 5 {4} [0&!1] 8 {1 3} [!0&!1]\n",
"11 {1 3 5} State: 9 [!0&1] 4 {2 4 5} [0&!1] 5 {1 3} [0&1] 5 {4}\n",
"[!0&!1] 11 {1 3 5} State: 10 [!0&1] 4 [0&1] 8 [!0&!1] 10 {0 1 2 3 5}\n",
"[0&!1] 13 {1 2 3} State: 11 [!0&1] 4 {2 4 5} [0&!1] 8 {1 2 3} [0&1] 8\n",
"{2 4} [!0&!1] 11 {1 2 3 5} State: 12 [!0&1] 4 [0&1] 7 {0 2 4} [!0&!1]\n",
"9 [0&!1] 12 {1 3} State: 13 [!0&1] 4 [0&1] 5 [!0&!1] 10 {0 1 3 5}\n",
"[0&!1] 13 {1 3} --END--\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "headed-tampa",
"metadata": {},
"outputs": [],
"source": [
"b = spot.zielonka_tree_transform(a)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "finite-works",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"33"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b.num_states()"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "numerical-education",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.equivalent_to(b)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "useful-helicopter",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.show('.s#')"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "imported-wheel",
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda = spot.acd(a); acda"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "surprised-column",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.first_branch(4, 0)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "multiple-minneapolis",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(6, 1)"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.step(6, 16)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "addressed-desire",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(6, 1)"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.step(6, 18)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "published-pollution",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(17, 0)"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.step(6, 17)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "excessive-locking",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(8, 1)"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.step(17, 22)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "premier-declaration",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(17, 1)"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.step(8, 36)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "modular-metro",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.first_branch(1, 3)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "solved-distinction",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3, 1)"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.step(3, 3)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "diagnostic-anthony",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"21\n",
"2\n"
]
}
],
"source": [
"b = spot.acd_transform(a); print(b.num_states()); print(b.num_sets())"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "large-shooting",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(False, False)"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"acda.has_parity_shape(), acda.has_streett_shape()"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "known-plain",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b.show('.s')"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "stock-physics",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.equivalent_to(b)"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "criminal-northwest",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = spot.automaton(\"\"\"\n",
"HOA: v1\n",
"States: 2\n",
"Start: 0\n",
"AP: 2 \"p1\" \"p0\"\n",
"Acceptance: 5 (Fin(0) & (Fin(3)|Fin(4)) & (Inf(1)&Inf(2))) | Inf(3)\n",
"properties: trans-labels explicit-labels trans-acc complete\n",
"properties: deterministic stutter-invariant\n",
"--BODY--\n",
"State: 0\n",
"[0&!1] 0 {2 3}\n",
"[!0&!1] 0 {2 3 4}\n",
"[!0&1] 1\n",
"[0&1] 1 {2 4}\n",
"State: 1\n",
"[!0&!1] 0 {0 2 3 4}\n",
"[!0&1] 1 {1}\n",
"[0&!1] 1 {2 3}\n",
"[0&1] 1 {1 2 4}\n",
"--END--\n",
"\"\"\"); c.show(\".#\")"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "balanced-investing",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0ba759870> >"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = spot.zielonka_tree_transform(c); d"
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "nutritional-rugby",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c.equivalent_to(d)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "criminal-marking",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"spot.acd(c)"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "unusual-dependence",
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0ba764240> >"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = spot.acd_transform(c); d"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "surgical-window",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c.equivalent_to(d)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "attractive-tradition",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0ba764750> >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0ba7646c0> >"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0ba759bd0> >"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"e = spot.translate('!(GFa -> (GFb & GF(!b & !Xb)))', 'gen', 'det')\n",
"f = spot.zielonka_tree_transform(e)\n",
"f2 = spot.acd_transform(e)\n",
"display(e,f,f2)"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "conventional-aircraft",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"e.equivalent_to(f)"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "unavailable-making",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"e.equivalent_to(f2)"
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "hispanic-europe",
"metadata": {},
"outputs": [],
"source": [
"a = spot.translate('GFa -> GF(b & Xb)', 'det', 'gen')"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "junior-basis",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.show(\".#\")"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "vietnamese-explorer",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" >"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"theacd = spot.acd(a); theacd"
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "miniature-attitude",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"theacd.has_parity_shape()"
]
},
{
"cell_type": "code",
"execution_count": 50,
"id": "refined-clerk",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0ba747c90> >"
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"spot.acd_transform(a)"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "foster-origin",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0b9cfb570> >"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"af = spot.translate('X(p3 | (p4 <-> p8)) R ((Gp4 R p6) W p8)', 'det', 'gen')\n",
"af"
]
},
{
"cell_type": "code",
"execution_count": 52,
"id": "nuclear-graduation",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0b9cfb840> >"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"spot.acd_transform(af)"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "german-vienna",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0b9cfbc90> >"
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# inherently weak automata become weak\n",
"w = spot.automaton(\"\"\"HOA: v1\n",
"States: 2\n",
"Start: 1\n",
"AP: 1 \"a\"\n",
"Acceptance: 2 Inf(0) | Inf(1)\n",
"properties: trans-labels explicit-labels trans-acc colored complete\n",
"properties: deterministic inherently-weak\n",
"--BODY--\n",
"State: 0\n",
"[t] 1 {0}\n",
"State: 1\n",
"[0] 0 {1}\n",
"[!0] 1 {0}\n",
"--END--\"\"\"); w"
]
},
{
"cell_type": "code",
"execution_count": 54,
"id": "chemical-primary",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(spot.trival_maybe(), spot.trival(True))"
]
},
"execution_count": 54,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w.prop_weak(), w.prop_inherently_weak()"
]
},
{
"cell_type": "code",
"execution_count": 55,
"id": "hispanic-floor",
"metadata": {},
"outputs": [],
"source": [
"w2 = spot.acd_transform(w)"
]
},
{
"cell_type": "code",
"execution_count": 56,
"id": "bacterial-wiring",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
" *' at 0x7fd0b9cfb5a0> >"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w2"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "central-london",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(spot.trival(True), spot.trival(True))"
]
},
"execution_count": 57,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w2.prop_weak(), w2.prop_inherently_weak()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "adjusted-cause",
"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
}