diff --git a/notebooks/experiments/SMT_Translation_Experiments.ipynb b/notebooks/experiments/SMT_Translation_Experiments.ipynb index b200fa719ec5f6dad3e10ccc958bc718008a9158..ffac438b38be2227723c689333acf9a495b68208 100644 --- a/notebooks/experiments/SMT_Translation_Experiments.ipynb +++ b/notebooks/experiments/SMT_Translation_Experiments.ipynb @@ -29,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -69,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -78,10 +78,10 @@ "$\\mathit{f} = \\{(1\\mapsto 3),(2\\mapsto 6)\\} \\wedge (\\exists /* LET */ (\\mathit{st13}).( (\\mathit{st13})=\\mathit{r} \\wedge \\forall \\mathit{st15}\\cdot (\\mathit{st15} \\in \\mathit{st13} \\mathbin\\Rightarrow \\exists \\mathit{st16}\\cdot (6 \\mapsto \\mathit{st15} \\in \\mathit{st16} \\wedge (\\forall (\\mathit{st17},\\mathit{st18})\\cdot (\\mathit{st17} \\mapsto \\mathit{st18} \\in \\mathit{st16} \\mathbin\\Rightarrow \\mathit{st18} \\mapsto \\mathit{st17} \\in \\mathit{f}) \\wedge \\forall (\\mathit{st17},\\mathit{st18})\\cdot (\\mathit{st18} \\mapsto \\mathit{st17} \\in \\mathit{f} \\mathbin\\Rightarrow \\mathit{st17} \\mapsto \\mathit{st18} \\in \\mathit{st16})))) \\wedge \\forall \\mathit{st15}\\cdot (\\exists \\mathit{st19}\\cdot (6 \\mapsto \\mathit{st15} \\in \\mathit{st19} \\wedge (\\forall (\\mathit{st20},\\mathit{st21})\\cdot (\\mathit{st20} \\mapsto \\mathit{st21} \\in \\mathit{st19} \\mathbin\\Rightarrow \\mathit{st21} \\mapsto \\mathit{st20} \\in \\mathit{f}) \\wedge \\forall (\\mathit{st20},\\mathit{st21})\\cdot (\\mathit{st21} \\mapsto \\mathit{st20} \\in \\mathit{f} \\mathbin\\Rightarrow \\mathit{st20} \\mapsto \\mathit{st21} \\in \\mathit{st19}))) \\mathbin\\Rightarrow \\mathit{st15} \\in \\mathit{st13})))$" ], "text/plain": [ - "f = {(1↦3),(2↦6)} ∧ (∃ /* LET */ (st13).( (st13)=r ∧ ∀st15·(st15 ∈ st13 ⇒ ∃st16·(6 ↦ st15 ∈ st16 ∧ (∀(st17,st18)·(st17 ↦ st18 ∈ st16 ⇒ st18 ↦ st17 ∈ f) ∧ ∀(st17,st18)·(st18 ↦ st17 ∈ f ⇒ st17 ↦ st18 ∈ st16)))) ∧ ∀st15·(∃st19·(6 ↦ st15 ∈ st19 ∧ (∀(st20,st21)·(st20 ↦ st21 ∈ st19 ⇒ st21 ↦ st20 ∈ f) ∧ ∀(st20,st21)·(st21 ↦ st20 ∈ f ⇒ st20 ↦ st21 ∈ st19))) ⇒ st15 ∈ st13)))" + "f = {(1↦3),(2↦6)} ∧ (∃ /* LET */ (st13).( (st13)=r ∧ ∀st15·(st15 ∈ st13 ⇒ ∃st16·(6 ↦ st15 ∈ st16 ∧ (∀(st17,st18)·(st17 ↦ st18 ∈ st16 ⇒ st18 ↦ st17 ∈ f) ∧ ∀(st17,st18)·(st18 ↦ st17 ∈ f ⇒ st17 ↦ st18 ∈ st16)))) ∧ ∀st15·(∃st19·(6 ↦ st15 ∈ st19 ∧ (∀(st20,st21)·(st20 ↦ st21 ∈ st19 ⇒ st21 ↦ st20 ∈ f) ∧ ∀(st20,st21)·(st21 ↦ st20 ∈ f ⇒ st20 ↦ st21 ∈ st19))) ⇒ st15 ∈ st13)))" ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -98,16 +98,16 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.194111316 seconds" + "Execution time: 0.347330269 seconds" ], "text/plain": [ - "Execution time: 0.194111316 seconds" + "Execution time: 0.347330269 seconds" ] }, "metadata": {}, @@ -115,6 +115,13 @@ }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{2\\}$\n", + "* $\\mathit{f} = \\{(1\\mapsto 3),(2\\mapsto 6)\\}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -123,7 +130,7 @@ "\tf = {(1↦3),(2↦6)}" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -199,7 +206,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -227,7 +234,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -244,13 +251,6 @@ "f = ((INTEGER*INTEGER)*{FALSE}) <+ {(1,3,TRUE),(2,6,TRUE)} &\n", "r:INTEGER-->BOOL & !x1.(x1:INTEGER => (x1|->TRUE:r <=> (x|->6)|->TRUE:f)) & not(2|->TRUE:r)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -260,8 +260,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/manual/ExternalFunctions.ipynb b/notebooks/manual/ExternalFunctions.ipynb index d2dd2ec30f15f8fbbebad75a7eb4db264d73184e..9761042dc522ce265c163196ce241ba88669331b 100644 --- a/notebooks/manual/ExternalFunctions.ipynb +++ b/notebooks/manual/ExternalFunctions.ipynb @@ -29,7 +29,7 @@ { "data": { "text/plain": [ - "Loaded machine: Jupyter_LibraryStrings : []\n" + "Loaded machine: Jupyter_LibraryStrings" ] }, "execution_count": 1, @@ -62,6 +62,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"abcabc\"}$" + ], "text/plain": [ "\"abcabc\"" ] @@ -82,6 +85,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"abc\"}$" + ], "text/plain": [ "\"abc\"" ] @@ -113,6 +119,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$3$" + ], "text/plain": [ "3" ] @@ -133,6 +142,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -165,6 +177,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(1\\mapsto\\text{\"filename\"}),(2\\mapsto\\text{\"ext\"})\\}$" + ], "text/plain": [ "{(1↦\"filename\"),(2↦\"ext\")}" ] @@ -185,6 +200,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(1\\mapsto\\text{\"filename.ext\"})\\}$" + ], "text/plain": [ "{(1↦\"filename.ext\")}" ] @@ -205,6 +223,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[\\text{\"usr\"},\\text{\"local\"},\\text{\"lib\"}]$" + ], "text/plain": [ "[\"usr\",\"local\",\"lib\"]" ] @@ -225,6 +246,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(1\\mapsto\\text{\"\"})\\}$" + ], "text/plain": [ "{(1↦\"\")}" ] @@ -252,6 +276,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(1\\mapsto\\text{\"usr/local/lib\"})\\}$" + ], "text/plain": [ "{(1↦\"usr/local/lib\")}" ] @@ -272,6 +299,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(1\\mapsto\\text{\"usr/lo\"}),(2\\mapsto\\text{\"/lib\"})\\}$" + ], "text/plain": [ "{(1↦\"usr/lo\"),(2↦\"/lib\")}" ] @@ -304,6 +334,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"usr/local/lib\"}$" + ], "text/plain": [ "\"usr/local/lib\"" ] @@ -324,6 +357,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"usr/local/lib\"}$" + ], "text/plain": [ "\"usr/local/lib\"" ] @@ -344,6 +380,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"usr/local/lib\"}$" + ], "text/plain": [ "\"usr/local/lib\"" ] @@ -376,6 +415,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -396,6 +438,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[\\text{\"a\"},\\text{\"b\"},\\text{\"c\"}]$" + ], "text/plain": [ "[\"a\",\"b\",\"c\"]" ] @@ -416,6 +461,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"a.b.c\"}$" + ], "text/plain": [ "\"a.b.c\"" ] @@ -449,6 +497,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -469,6 +520,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[65,90,32,97,122,32,48,57]$" + ], "text/plain": [ "[65,90,32,97,122,32,48,57]" ] @@ -506,6 +560,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -526,6 +583,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -546,6 +606,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -566,6 +629,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] @@ -586,6 +652,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] @@ -606,6 +675,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] @@ -626,6 +698,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -646,6 +721,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -666,6 +744,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -699,6 +780,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1024$" + ], "text/plain": [ "1024" ] @@ -719,6 +803,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$-1$" + ], "text/plain": [ "−1" ] @@ -750,6 +837,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"1024\"}$" + ], "text/plain": [ "\"1024\"" ] @@ -770,6 +860,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"-1024\"}$" + ], "text/plain": [ "\"-1024\"" ] @@ -790,6 +883,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"-1\"}$" + ], "text/plain": [ "\"-1\"" ] @@ -810,6 +906,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -841,6 +940,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1024$" + ], "text/plain": [ "1024" ] @@ -861,6 +963,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$102400$" + ], "text/plain": [ "102400" ] @@ -881,6 +986,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$102$" + ], "text/plain": [ "102" ] @@ -901,6 +1009,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$103$" + ], "text/plain": [ "103" ] @@ -921,6 +1032,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$-103$" + ], "text/plain": [ "−103" ] @@ -941,6 +1055,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$102423$" + ], "text/plain": [ "102423" ] @@ -961,6 +1078,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$10240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000$" + ], "text/plain": [ "10240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ] @@ -981,6 +1101,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] @@ -1013,6 +1136,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"12.04\"}$" + ], "text/plain": [ "\"12.04\"" ] @@ -1033,6 +1159,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"-1.204\"}$" + ], "text/plain": [ "\"-1.204\"" ] @@ -1053,6 +1182,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"0.00\"}$" + ], "text/plain": [ "\"0.00\"" ] @@ -1073,6 +1205,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"120400\"}$" + ], "text/plain": [ "\"120400\"" ] @@ -1093,6 +1228,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"-0.010\"}$" + ], "text/plain": [ "\"-0.010\"" ] @@ -1124,6 +1262,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"1024\"}$" + ], "text/plain": [ "\"1024\"" ] @@ -1144,6 +1285,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"1024\"}$" + ], "text/plain": [ "\"1024\"" ] @@ -1164,6 +1308,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"{2,3,5}\"}$" + ], "text/plain": [ "\"{2,3,5}\"" ] @@ -1184,6 +1331,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"((TRUE|->3)|->{(11|->rec(a:22,b:33))})\"}$" + ], "text/plain": [ "\"((TRUE|->3)|->{(11|->rec(a:22,b:33))})\"" ] @@ -1218,6 +1368,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"two to the power ten = 1024\"}$" + ], "text/plain": [ "\"two to the power ten = 1024\"" ] @@ -1238,6 +1391,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"My two sets are {1,2} and {}\"}$" + ], "text/plain": [ "\"My two sets are {1,2} and {}\"" ] @@ -1298,7 +1454,7 @@ { "data": { "text/plain": [ - "Loaded machine: Jupyter_CHOOSE : []\n" + "Loaded machine: Jupyter_CHOOSE" ] }, "execution_count": 54, @@ -1320,6 +1476,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1$" + ], "text/plain": [ "1" ] @@ -1340,6 +1499,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1$" + ], "text/plain": [ "1" ] @@ -1360,6 +1522,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"a\"}$" + ], "text/plain": [ "\"a\"" ] @@ -1380,6 +1545,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -1400,6 +1568,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -1467,7 +1638,7 @@ { "data": { "text/plain": [ - "Loaded machine: Jupyter_SORT : []\n" + "Loaded machine: Jupyter_SORT" ] }, "execution_count": 60, @@ -1489,6 +1660,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[1,2,3]$" + ], "text/plain": [ "[1,2,3]" ] @@ -1509,6 +1683,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[6,9,27]$" + ], "text/plain": [ "[6,9,27]" ] @@ -1529,6 +1706,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[\\text{\"1\"},\\text{\"10\"},\\text{\"11\"},\\text{\"2\"},\\text{\"a\"},\\text{\"aa\"},\\text{\"ab\"},\\text{\"b\"}]$" + ], "text/plain": [ "[\"1\",\"10\",\"11\",\"2\",\"a\",\"aa\",\"ab\",\"b\"]" ] @@ -1549,6 +1729,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$[(\\text{\"a\"}\\mapsto 0),(\\text{\"a\"}\\mapsto 1),(\\text{\"b\"}\\mapsto 0)]$" + ], "text/plain": [ "[(\"a\"↦0),(\"a\"↦1),(\"b\"↦0)]" ] @@ -1593,7 +1776,7 @@ { "data": { "text/plain": [ - "Loaded machine: Jupyter_LibraryMeta : []\n" + "Loaded machine: Jupyter_LibraryMeta" ] }, "execution_count": 65, @@ -1624,8 +1807,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"1.8.2-beta2\"}$" + ], "text/plain": [ - "\"1.8.1-beta4\"" + "\"1.8.2-beta2\"" ] }, "execution_count": 66, @@ -1644,8 +1830,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"ce702ba99f667cb03de8ed41ab58ba72db9112c3\"}$" + ], "text/plain": [ - "\"c6264c505a07e8df7a9f0a7631c9d503c125bd8e\"" + "\"ce702ba99f667cb03de8ed41ab58ba72db9112c3\"" ] }, "execution_count": 67, @@ -1664,8 +1853,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"Fri Aug 10 17:40:37 2018 +0200\"}$" + ], "text/plain": [ - "\"Tue Jun 5 12:14:24 2018 +0100\"" + "\"Fri Aug 10 17:40:37 2018 +0200\"" ] }, "execution_count": 68, @@ -1684,6 +1876,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"1.8.0_172-b11\"}$" + ], "text/plain": [ "\"1.8.0_172-b11\"" ] @@ -1704,6 +1899,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin/java\"}$" + ], "text/plain": [ "\"/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin/java\"" ] @@ -1724,8 +1922,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"13/8/2018 - 14h34 49s\"}$" + ], "text/plain": [ - "\"6/6/2018 - 11h59 26s\"" + "\"13/8/2018 - 14h34 49s\"" ] }, "execution_count": 71, @@ -1760,8 +1961,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$150940944$" + ], "text/plain": [ - "150612400" + "150940944" ] }, "execution_count": 72, @@ -1780,6 +1984,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1$" + ], "text/plain": [ "1" ] @@ -1800,6 +2007,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -1820,6 +2030,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -1840,6 +2053,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$-1$" + ], "text/plain": [ "−1" ] @@ -1860,8 +2076,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1534163689$" + ], "text/plain": [ - "1528279167" + "1534163689" ] }, "execution_count": 77, @@ -1880,8 +2099,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1660$" + ], "text/plain": [ - "1820" + "1660" ] }, "execution_count": 78, @@ -1900,8 +2122,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$2890$" + ], "text/plain": [ - "2960" + "2890" ] }, "execution_count": 79, @@ -1946,6 +2171,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -1966,6 +2194,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -1986,6 +2217,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -2006,6 +2240,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -2026,6 +2263,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -2046,6 +2286,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -2066,6 +2309,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$0$" + ], "text/plain": [ "0" ] @@ -2095,8 +2341,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\text{\"(machine from Jupyter cell).mch\"},\\text{\"LibraryMeta.def\"}\\}$" + ], "text/plain": [ - "{\"LibraryMeta.def\",\"manual\"}" + "{\"(machine from Jupyter cell).mch\",\"LibraryMeta.def\"}" ] }, "execution_count": 87, @@ -2115,8 +2364,11 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\text{\"(machine from Jupyter cell).mch\"}\\}$" + ], "text/plain": [ - "{\"from_string\"}" + "{\"(machine from Jupyter cell).mch\"}" ] }, "execution_count": 88, @@ -2135,6 +2387,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -2155,6 +2410,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -2175,6 +2433,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -2195,6 +2456,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -2215,6 +2479,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -2235,6 +2502,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -2306,7 +2576,7 @@ { "data": { "text/plain": [ - "Loaded machine: Jupyter_LibraryXML : []\n" + "Loaded machine: Jupyter_LibraryXML" ] }, "execution_count": 95, @@ -2337,6 +2607,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(1\\mapsto \\mathit{rec}(\\mathit{attributes}\\in\\{(\\text{\"version\"}\\mapsto\\text{\"0.1\"})\\},\\mathit{element}\\in\\text{\"Data\"},\\mathit{meta}\\in\\{(\\text{\"xmlLineNumber\"}\\mapsto\\text{\"3\"})\\},\\mathit{pId}\\in 0,\\mathit{recId}\\in 1)),(2\\mapsto \\mathit{rec}(\\mathit{attributes}\\in\\{(\\text{\"attr1\"}\\mapsto\\text{\"value1\"}),(\\text{\"elemID\"}\\mapsto\\text{\"ID1\"})\\},\\mathit{element}\\in\\text{\"Tag1\"},\\mathit{meta}\\in\\{(\\text{\"xmlLineNumber\"}\\mapsto\\text{\"4\"})\\},\\mathit{pId}\\in 1,\\mathit{recId}\\in 2))\\}$" + ], "text/plain": [ "{(1↦rec(attributes∈{(\"version\"↦\"0.1\")},element∈\"Data\",meta∈{(\"xmlLineNumber\"↦\"3\")},pId∈0,recId∈1)),(2↦rec(attributes∈{(\"attr1\"↦\"value1\"),(\"elemID\"↦\"ID1\")},element∈\"Tag1\",meta∈{(\"xmlLineNumber\"↦\"4\")},pId∈1,recId∈2))}" ] @@ -2379,8 +2652,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/models/scheduler.ipynb b/notebooks/models/scheduler.ipynb index 6f23b2a0cb5117e442de79eb40ff8e6a3d3532f8..7fabf4a9b31d05592867c51ea26ef0f82d7740d1 100644 --- a/notebooks/models/scheduler.ipynb +++ b/notebooks/models/scheduler.ipynb @@ -10,7 +10,7 @@ { "data": { "text/plain": [ - "Loaded machine: scheduler : []\n" + "Loaded machine: scheduler" ] }, "execution_count": 1, @@ -29,6 +29,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{PID1},\\mathit{PID2},\\mathit{PID3}\\}$" + ], "text/plain": [ "{PID1,PID2,PID3}" ] @@ -55,7 +58,7 @@ "Constants: (none)\n", "Variables: active, ready, waiting\n", "Operations: \n", - "0: $initialise_machine()" + "INITIALISATION()" ] }, "execution_count": 3, @@ -93,7 +96,7 @@ { "data": { "text/plain": [ - "Executed operation 0: $initialise_machine()" + "Executed operation: $initialise_machine()" ] }, "execution_count": 5, @@ -113,7 +116,7 @@ { "data": { "text/plain": [ - "Executed operation 2: new(PID1)" + "Executed operation: new(PID1)" ] }, "execution_count": 6, @@ -132,6 +135,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{PID1}\\}$" + ], "text/plain": [ "{PID1}" ] @@ -153,7 +159,7 @@ { "data": { "text/plain": [ - "Executed operation 9: ready(PID1)" + "Executed operation: ready(PID1)" ] }, "execution_count": 8, @@ -172,6 +178,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{PID1}\\}$" + ], "text/plain": [ "{PID1}" ] @@ -193,7 +202,7 @@ { "data": { "text/plain": [ - "Executed operation 12: new(PID3)" + "Executed operation: new(PID3)" ] }, "execution_count": 10, @@ -213,13 +222,13 @@ { "data": { "text/markdown": [ - "|Nr|Elements|\n", - "|---|---|\n", - "|1|PID3|\n" + "|waiting|\n", + "|---|\n", + "|$\\mathit{PID3}$|\n" ], "text/plain": [ - "Nr\tElements\n", - "1\tPID3\n" + "waiting\n", + "PID3\n" ] }, "execution_count": 11, @@ -238,6 +247,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\emptyset$" + ], "text/plain": [ "∅" ] @@ -258,6 +270,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{PID1}\\}$" + ], "text/plain": [ "{PID1}" ] @@ -279,7 +294,7 @@ { "data": { "text/plain": [ - "Executed operation 15: new(PID2)" + "Executed operation: new(PID2)" ] }, "execution_count": 14, @@ -299,15 +314,15 @@ { "data": { "text/markdown": [ - "|Nr|Elements|\n", - "|---|---|\n", - "|1|PID2|\n", - "|2|PID3|\n" + "|waiting|\n", + "|---|\n", + "|$\\mathit{PID2}$|\n", + "|$\\mathit{PID3}$|\n" ], "text/plain": [ - "Nr\tElements\n", - "1\tPID2\n", - "2\tPID3\n" + "waiting\n", + "PID2\n", + "PID3\n" ] }, "execution_count": 15, @@ -327,8 +342,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/presentations/BvsLP.ipynb b/notebooks/presentations/BvsLP.ipynb index 4fde7f527b08ac1b49d1b021bbaa08176ae260ea..ee9c27efb47d19dde1086d4e530e51461fc422b4 100644 --- a/notebooks/presentations/BvsLP.ipynb +++ b/notebooks/presentations/BvsLP.ipynb @@ -40,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -52,7 +52,7 @@ "TRUE" ] }, - "execution_count": 2, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -63,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -72,61 +72,70 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: state Pages: 1 -->\n", - "<svg width=\"216pt\" height=\"134pt\"\n", - " viewBox=\"0.00 0.00 216.32 134.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 130)\">\n", + "<svg width=\"217pt\" height=\"131pt\"\n", + " viewBox=\"0.00 0.00 217.00 131.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 127)\">\n", "<title>state</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-130 213.321,-130 213.321,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-127 213,-127 213,4 -4,4\"/>\n", "<!-- 3 -->\n", - "<g id=\"node1\" class=\"node\"><title>3</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-126 0,-126 0,-90 54,-90 54,-126\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>3</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-123 0,-123 0,-87 54,-87 54,-123\"/>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n", "</g>\n", "<!-- 6 -->\n", - "<g id=\"node3\" class=\"node\"><title>6</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-36 0,-36 0,-0 54,-0 54,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">6</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>6</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-36 0,-36 0,0 54,0 54,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">6</text>\n", "</g>\n", "<!-- 3->6 -->\n", - "<g id=\"edge2\" class=\"edge\"><title>3->6</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M27,-89.614C27,-77.2403 27,-60.3686 27,-46.2198\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"30.5001,-46.0504 27,-36.0504 23.5001,-46.0504 30.5001,-46.0504\"/>\n", - "<text text-anchor=\"middle\" x=\"45.6606\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">[4,5,6]</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>3->6</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M27,-86.9735C27,-75.1918 27,-59.5607 27,-46.1581\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"30.5001,-46.0033 27,-36.0034 23.5001,-46.0034 30.5001,-46.0033\"/>\n", + "<text text-anchor=\"middle\" x=\"46\" y=\"-57.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">[4,5,6]</text>\n", "</g>\n", "<!-- 2 -->\n", - "<g id=\"node4\" class=\"node\"><title>2</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"126,-126 72,-126 72,-90 126,-90 126,-126\"/>\n", - "<text text-anchor=\"middle\" x=\"99\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>2</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"126,-123 72,-123 72,-87 126,-87 126,-123\"/>\n", + "<text text-anchor=\"middle\" x=\"99\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n", "</g>\n", "<!-- 5 -->\n", - "<g id=\"node6\" class=\"node\"><title>5</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"126,-36 72,-36 72,-0 126,-0 126,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"99\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">5</text>\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>5</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"126,-36 72,-36 72,0 126,0 126,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"99\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n", "</g>\n", "<!-- 2->5 -->\n", - "<g id=\"edge4\" class=\"edge\"><title>2->5</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M99,-89.614C99,-77.2403 99,-60.3686 99,-46.2198\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"102.5,-46.0504 99,-36.0504 95.5001,-46.0504 102.5,-46.0504\"/>\n", - "<text text-anchor=\"middle\" x=\"117.661\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">[4,5,6]</text>\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>2->5</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M99,-86.9735C99,-75.1918 99,-59.5607 99,-46.1581\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"102.5001,-46.0033 99,-36.0034 95.5001,-46.0034 102.5001,-46.0033\"/>\n", + "<text text-anchor=\"middle\" x=\"118\" y=\"-57.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">[4,5,6]</text>\n", "</g>\n", "<!-- 1 -->\n", - "<g id=\"node7\" class=\"node\"><title>1</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"198,-126 144,-126 144,-90 198,-90 198,-126\"/>\n", - "<text text-anchor=\"middle\" x=\"171\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n", + "<g id=\"node5\" class=\"node\">\n", + "<title>1</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"198,-123 144,-123 144,-87 198,-87 198,-123\"/>\n", + "<text text-anchor=\"middle\" x=\"171\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n", "</g>\n", "<!-- 4 -->\n", - "<g id=\"node9\" class=\"node\"><title>4</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"198,-36 144,-36 144,-0 198,-0 198,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"171\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n", + "<g id=\"node6\" class=\"node\">\n", + "<title>4</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"198,-36 144,-36 144,0 198,0 198,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"171\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n", "</g>\n", "<!-- 1->4 -->\n", - "<g id=\"edge6\" class=\"edge\"><title>1->4</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M171,-89.614C171,-77.2403 171,-60.3686 171,-46.2198\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"174.5,-46.0504 171,-36.0504 167.5,-46.0504 174.5,-46.0504\"/>\n", - "<text text-anchor=\"middle\" x=\"189.661\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">[4,5,6]</text>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>1->4</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M171,-86.9735C171,-75.1918 171,-59.5607 171,-46.1581\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"174.5001,-46.0033 171,-36.0034 167.5001,-46.0034 174.5001,-46.0033\"/>\n", + "<text text-anchor=\"middle\" x=\"190\" y=\"-57.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">[4,5,6]</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -135,7 +144,7 @@ "<Dot visualization: expr_as_graph [[4,5,6]]>" ] }, - "execution_count": 38, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -153,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -165,7 +174,7 @@ "[1,2,3,4,5,6]" ] }, - "execution_count": 1, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -205,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -226,7 +235,7 @@ "[1,2,3]\t{}\n" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -244,7 +253,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -264,7 +273,7 @@ "\tres = [1,2,3,4]" ] }, - "execution_count": 12, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -293,7 +302,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -319,7 +328,7 @@ "\tFacts = {((∅↦{FALSE})↦{FALSE}),((∅↦{TRUE})↦{TRUE})}" ] }, - "execution_count": 32, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -343,7 +352,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -367,7 +376,7 @@ "\tFacts = {((∅↦{FALSE})↦{FALSE}),((∅↦{TRUE})↦{TRUE})}" ] }, - "execution_count": 34, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -384,7 +393,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -408,7 +417,7 @@ "\tFacts = {((∅↦{FALSE})↦{FALSE}),((∅↦{TRUE})↦{TRUE})}" ] }, - "execution_count": 36, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -434,7 +443,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -446,7 +455,7 @@ "time_out" ] }, - "execution_count": 35, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -459,13 +468,6 @@ "AllModels = {Model | Facts <: Model &\n", " !(x,y,z).( (x,y,z):Model => !h.(h:TYPE => (x\\/{h},y,z\\/{h}):Model))}" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/notebooks/presentations/LPOP18.ipynb b/notebooks/presentations/LPOP18.ipynb index 6d2b2fcd648223cb15c4858f30a14ac0a9ab1170..642daaffaf3aa343c1448245a30da55b386b34ea 100644 --- a/notebooks/presentations/LPOP18.ipynb +++ b/notebooks/presentations/LPOP18.ipynb @@ -132,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "slideshow": { "slide_type": "-" @@ -145,7 +145,7 @@ "Loaded machine: MyBasicSets" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -170,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": { "slideshow": { "slide_type": "-" @@ -186,7 +186,7 @@ "{Points1,Points2}" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -209,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": { "slideshow": { "slide_type": "fragment" @@ -219,13 +219,13 @@ { "data": { "text/markdown": [ - "$(thomas\\mapsto10)$" + "$(\\mathit{thomas}\\mapsto 10)$" ], "text/plain": [ "(thomas↦10)" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -236,7 +236,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": { "slideshow": { "slide_type": "fragment" @@ -246,13 +246,13 @@ { "data": { "text/markdown": [ - "$(thomas\\mapsto10)$" + "$(\\mathit{thomas}\\mapsto 10)$" ], "text/plain": [ "(thomas↦10)" ] }, - "execution_count": 8, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -274,7 +274,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -286,7 +286,7 @@ "((thomas↦gordon)↦20)" ] }, - "execution_count": 5, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -304,7 +304,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -316,7 +316,7 @@ "r = rec(length:20,position:10302,train:thomas)" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -340,7 +340,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": { "slideshow": { "slide_type": "fragment" @@ -356,7 +356,7 @@ "{1,2,3}" ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -378,7 +378,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": { "slideshow": { "slide_type": "fragment" @@ -394,7 +394,7 @@ "{1,2,3}" ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -416,7 +416,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 12, "metadata": { "slideshow": { "slide_type": "fragment" @@ -432,7 +432,7 @@ "{1,2,3}" ] }, - "execution_count": 14, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -461,7 +461,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": { "slideshow": { "slide_type": "fragment" @@ -477,7 +477,7 @@ "{{0,1},{1,2,3}}" ] }, - "execution_count": 14, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -499,7 +499,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 14, "metadata": { "slideshow": { "slide_type": "fragment" @@ -507,12 +507,17 @@ }, "outputs": [ { - "ename": "CommandExecutionException", - "evalue": ":eval: Computation not completed: Unknown identifier \"thomas\",Unknown identifier \"gordon\",Unknown identifier \"gordon\",Unknown identifier \"gordon\",Unknown identifier \"thomas\",Unknown identifier \"thomas\"", - "output_type": "error", - "traceback": [ - "\u001b[1m\u001b[31m:eval: Computation not completed: Unknown identifier \"thomas\",Unknown identifier \"gordon\",Unknown identifier \"gordon\",Unknown identifier \"gordon\",Unknown identifier \"thomas\",Unknown identifier \"thomas\"\u001b[0m" - ] + "data": { + "text/markdown": [ + "$\\{(\\mathit{thomas}\\mapsto \\mathit{thomas}),(\\mathit{thomas}\\mapsto \\mathit{gordon}),(\\mathit{gordon}\\mapsto \\mathit{gordon})\\}$" + ], + "text/plain": [ + "{(thomas↦thomas),(thomas↦gordon),(gordon↦gordon)}" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -521,7 +526,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -530,45 +535,51 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: state Pages: 1 -->\n", - "<svg width=\"128pt\" height=\"188pt\"\n", - " viewBox=\"0.00 0.00 128.00 188.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 184)\">\n", + "<svg width=\"131pt\" height=\"222pt\"\n", + " viewBox=\"0.00 0.00 131.00 222.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 218)\">\n", "<title>state</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-184 125,-184 125,5 -4,5\"/>\n", - "<g id=\"graph2\" class=\"cluster\"><title>cluster_Trains</title>\n", - "<polygon fill=\"lightgrey\" stroke=\"lightgrey\" points=\"8,-8 8,-172 112,-172 112,-8 8,-8\"/>\n", - "<text text-anchor=\"middle\" x=\"60\" y=\"-157.2\" font-family=\"Times,serif\" font-size=\"12.00\">Trains</text>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-218 127,-218 127,4 -4,4\"/>\n", + "<g id=\"clust1\" class=\"cluster\">\n", + "<title>cluster_Trains</title>\n", + "<polygon fill=\"#d3d3d3\" stroke=\"#d3d3d3\" points=\"8,-8 8,-206 115,-206 115,-8 8,-8\"/>\n", + "<text text-anchor=\"middle\" x=\"61.5\" y=\"-192.4\" font-family=\"Times,serif\" font-size=\"12.00\" fill=\"#000000\">Trains</text>\n", "</g>\n", "<!-- gordon -->\n", - "<g id=\"node1\" class=\"node\"><title>gordon</title>\n", - "<polygon fill=\"#efdf84\" stroke=\"#efdf84\" points=\"71.249,-52 16.751,-52 16.751,-16 71.249,-16 71.249,-52\"/>\n", - "<text text-anchor=\"middle\" x=\"44\" y=\"-29.8\" font-family=\"Times,serif\" font-size=\"14.00\">gordon</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>gordon</title>\n", + "<polygon fill=\"#efdf84\" stroke=\"#efdf84\" points=\"73,-52 17,-52 17,-16 73,-16 73,-52\"/>\n", + "<text text-anchor=\"middle\" x=\"45\" y=\"-30.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gordon</text>\n", "</g>\n", "<!-- gordon->gordon -->\n", - "<g id=\"edge2\" class=\"edge\"><title>gordon->gordon</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M71.6842,-42.248C81.2638,-42.3353 89,-39.5859 89,-34 89,-30.5961 86.1273,-28.2455 81.7152,-26.9482\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"82.0283,-23.4609 71.6842,-25.752 81.1994,-30.4116 82.0283,-23.4609\"/>\n", - "<text text-anchor=\"middle\" x=\"96.3829\" y=\"-29.8\" font-family=\"Times,serif\" font-size=\"14.00\">rel</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>gordon->gordon</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M73.2994,-40.7484C83.0919,-40.8198 91,-38.5703 91,-34 91,-31.215 88.0634,-29.2918 83.5533,-28.2304\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"83.5867,-24.7177 73.2994,-27.2516 82.9216,-31.6861 83.5867,-24.7177\"/>\n", + "<text text-anchor=\"middle\" x=\"98.5\" y=\"-30.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">rel</text>\n", "</g>\n", "<!-- thomas -->\n", - "<g id=\"node3\" class=\"node\"><title>thomas</title>\n", - "<polygon fill=\"#efdf84\" stroke=\"#efdf84\" points=\"72.3312,-142 15.6688,-142 15.6688,-106 72.3312,-106 72.3312,-142\"/>\n", - "<text text-anchor=\"middle\" x=\"44\" y=\"-119.8\" font-family=\"Times,serif\" font-size=\"14.00\">thomas</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>thomas</title>\n", + "<polygon fill=\"#efdf84\" stroke=\"#efdf84\" points=\"73.5,-177 16.5,-177 16.5,-141 73.5,-141 73.5,-177\"/>\n", + "<text text-anchor=\"middle\" x=\"45\" y=\"-155.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">thomas</text>\n", "</g>\n", "<!-- thomas->gordon -->\n", - "<g id=\"edge4\" class=\"edge\"><title>thomas->gordon</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M44,-105.614C44,-93.2403 44,-76.3686 44,-62.2198\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"47.5001,-62.0504 44,-52.0504 40.5001,-62.0504 47.5001,-62.0504\"/>\n", - "<text text-anchor=\"middle\" x=\"51.3829\" y=\"-74.8\" font-family=\"Times,serif\" font-size=\"14.00\">rel</text>\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>thomas->gordon</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M45,-140.8239C45,-120.2723 45,-86.5472 45,-62.4893\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"48.5001,-62.198 45,-52.198 41.5001,-62.198 48.5001,-62.198\"/>\n", + "<text text-anchor=\"middle\" x=\"52.5\" y=\"-92.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">rel</text>\n", "</g>\n", "<!-- thomas->thomas -->\n", - "<g id=\"edge6\" class=\"edge\"><title>thomas->thomas</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M72.2994,-132.248C82.0919,-132.335 90,-129.586 90,-124 90,-120.596 87.0634,-118.245 82.5533,-116.948\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"82.6376,-113.434 72.2994,-115.752 81.8265,-120.387 82.6376,-113.434\"/>\n", - "<text text-anchor=\"middle\" x=\"97.3829\" y=\"-119.8\" font-family=\"Times,serif\" font-size=\"14.00\">rel</text>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>thomas->thomas</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M73.607,-165.7484C83.5059,-165.8198 91.5,-163.5703 91.5,-159 91.5,-156.1436 88.3773,-154.1937 83.6186,-153.1504\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"83.8799,-149.6599 73.607,-152.2516 83.254,-156.6319 83.8799,-149.6599\"/>\n", + "<text text-anchor=\"middle\" x=\"99\" y=\"-155.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">rel</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -577,7 +588,7 @@ "<Dot visualization: expr_as_graph [(\"rel\",{(thomas,gordon),(gordon,gordon),(thomas,thomas)})]>" ] }, - "execution_count": 28, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -600,7 +611,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -609,7 +620,7 @@ "Preference changed: DOT_ENGINE = circo\n" ] }, - "execution_count": 26, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -620,7 +631,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -629,98 +640,113 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: state Pages: 1 -->\n", "<svg width=\"243pt\" height=\"235pt\"\n", " viewBox=\"0.00 0.00 243.39 234.72\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 230.72)\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 230.7203)\">\n", "<title>state</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-230.72 240.386,-230.72 240.386,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-230.7203 239.3858,-230.7203 239.3858,4 -4,4\"/>\n", "<!-- 5 -->\n", - "<g id=\"node1\" class=\"node\"><title>5</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.103,-36 112.103,-36 112.103,-0 166.103,-0 166.103,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"139.103\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">5</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>5</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.1026,-36 112.1026,-36 112.1026,0 166.1026,0 166.1026,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"139.1026\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n", "</g>\n", "<!-- 4 -->\n", - "<g id=\"node3\" class=\"node\"><title>4</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"235.386,-131.36 181.386,-131.36 181.386,-95.3602 235.386,-95.3602 235.386,-131.36\"/>\n", - "<text text-anchor=\"middle\" x=\"208.386\" y=\"-109.16\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>4</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"235.3858,-131.3602 181.3858,-131.3602 181.3858,-95.3602 235.3858,-95.3602 235.3858,-131.3602\"/>\n", + "<text text-anchor=\"middle\" x=\"208.3858\" y=\"-109.6602\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n", "</g>\n", "<!-- 5->4 -->\n", - "<g id=\"edge2\" class=\"edge\"><title>5->4</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M152.461,-36.3864C162.879,-50.7254 177.49,-70.8353 189.165,-86.9044\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"186.594,-89.3207 195.303,-95.3536 192.257,-85.2062 186.594,-89.3207\"/>\n", - "<text text-anchor=\"middle\" x=\"179.813\" y=\"-50.4454\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>5->4</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M152.4611,-36.3864C162.879,-50.7254 177.4897,-70.8353 189.1646,-86.9044\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"186.5938,-89.3207 195.3033,-95.3536 192.257,-85.2062 186.5938,-89.3207\"/>\n", + "<text text-anchor=\"middle\" x=\"163.3128\" y=\"-65.4454\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 3 -->\n", - "<g id=\"node5\" class=\"node\"><title>3</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-190.296 1.42109e-14,-190.296 1.42109e-14,-154.296 54,-154.296 54,-190.296\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-168.096\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>3</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-190.296 0,-190.296 0,-154.296 54,-154.296 54,-190.296\"/>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-168.596\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n", "</g>\n", "<!-- 5->3 -->\n", - "<g id=\"edge4\" class=\"edge\"><title>5->3</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M126.024,-36.0017C106.385,-63.0326 69.1556,-114.274 46.3626,-145.646\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"43.3895,-143.783 40.3432,-153.931 49.0526,-147.898 43.3895,-143.783\"/>\n", - "<text text-anchor=\"middle\" x=\"95.1931\" y=\"-93.6237\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>5->3</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M126.0236,-36.0017C106.3845,-63.0326 69.1556,-114.2737 46.3626,-145.6457\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"43.3895,-143.7832 40.3432,-153.9307 49.0526,-147.8978 43.3895,-143.7832\"/>\n", + "<text text-anchor=\"middle\" x=\"78.6931\" y=\"-94.6237\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 2 -->\n", - "<g id=\"node7\" class=\"node\"><title>2</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.103,-226.72 112.103,-226.72 112.103,-190.72 166.103,-190.72 166.103,-226.72\"/>\n", - "<text text-anchor=\"middle\" x=\"139.103\" y=\"-204.52\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>2</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.1026,-226.7203 112.1026,-226.7203 112.1026,-190.7203 166.1026,-190.7203 166.1026,-226.7203\"/>\n", + "<text text-anchor=\"middle\" x=\"139.1026\" y=\"-205.0203\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n", "</g>\n", "<!-- 5->2 -->\n", - "<g id=\"edge6\" class=\"edge\"><title>5->2</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M139.103,-36.2871C139.103,-69.6799 139.103,-140.734 139.103,-180.418\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"135.603,-180.489 139.103,-190.489 142.603,-180.489 135.603,-180.489\"/>\n", - "<text text-anchor=\"middle\" x=\"131.103\" y=\"-104.152\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>5->2</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M139.1026,-36.2871C139.1026,-69.6799 139.1026,-140.734 139.1026,-180.4178\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"135.6027,-180.4886 139.1026,-190.4886 142.6027,-180.4887 135.6027,-180.4886\"/>\n", + "<text text-anchor=\"middle\" x=\"131.6026\" y=\"-112.1524\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 1 -->\n", - "<g id=\"node9\" class=\"node\"><title>1</title>\n", + "<g id=\"node5\" class=\"node\">\n", + "<title>1</title>\n", "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-72.4243 0,-72.4243 0,-36.4243 54,-36.4243 54,-72.4243\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-50.2243\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-50.7243\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n", "</g>\n", "<!-- 5->1 -->\n", - "<g id=\"edge8\" class=\"edge\"><title>5->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M111.966,-26.8173C97.6137,-31.4806 79.779,-37.2754 64.1603,-42.3502\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"62.7045,-39.143 54.2756,-45.562 64.8677,-45.8004 62.7045,-39.143\"/>\n", - "<text text-anchor=\"middle\" x=\"91.063\" y=\"-40.3838\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge4\" class=\"edge\">\n", + "<title>5->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M111.9657,-26.8173C97.6137,-31.4806 79.779,-37.2754 64.1603,-42.3502\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"62.7045,-39.143 54.2756,-45.562 64.8677,-45.8004 62.7045,-39.143\"/>\n", + "<text text-anchor=\"middle\" x=\"80.563\" y=\"-38.3838\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 4->3 -->\n", - "<g id=\"edge10\" class=\"edge\"><title>4->3</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M181.231,-122.183C150.018,-132.325 98.6277,-149.023 63.8291,-160.33\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"62.4733,-157.09 54.0443,-163.509 64.6364,-163.747 62.4733,-157.09\"/>\n", - "<text text-anchor=\"middle\" x=\"125.53\" y=\"-147.056\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge5\" class=\"edge\">\n", + "<title>4->3</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M181.2305,-122.1835C150.0179,-132.3251 98.6277,-149.0227 63.8291,-160.3295\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"62.4733,-157.0898 54.0443,-163.5088 64.6364,-163.7472 62.4733,-157.0898\"/>\n", + "<text text-anchor=\"middle\" x=\"115.0298\" y=\"-145.0565\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 4->2 -->\n", - "<g id=\"edge12\" class=\"edge\"><title>4->2</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M195.027,-131.747C184.609,-146.086 169.999,-166.196 158.324,-182.265\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"155.231,-180.566 152.185,-190.714 160.895,-184.681 155.231,-180.566\"/>\n", - "<text text-anchor=\"middle\" x=\"185.676\" y=\"-159.806\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge6\" class=\"edge\">\n", + "<title>4->2</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M195.0273,-131.7466C184.6094,-146.0856 169.9987,-166.1955 158.3238,-182.2646\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"155.2315,-180.5663 152.1851,-190.7138 160.8946,-184.6809 155.2315,-180.5663\"/>\n", + "<text text-anchor=\"middle\" x=\"169.1756\" y=\"-160.8056\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 4->1 -->\n", - "<g id=\"edge14\" class=\"edge\"><title>4->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M181.231,-104.537C150.018,-94.3953 98.6277,-77.6976 63.8291,-66.3908\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"64.6364,-62.9731 54.0443,-63.2116 62.4733,-69.6305 64.6364,-62.9731\"/>\n", - "<text text-anchor=\"middle\" x=\"119.53\" y=\"-91.2639\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge7\" class=\"edge\">\n", + "<title>4->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M181.2305,-104.5369C150.0179,-94.3953 98.6277,-77.6976 63.8291,-66.3908\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"64.6364,-62.9731 54.0443,-63.2116 62.4733,-69.6305 64.6364,-62.9731\"/>\n", + "<text text-anchor=\"middle\" x=\"115.0298\" y=\"-89.2639\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 3->2 -->\n", - "<g id=\"edge16\" class=\"edge\"><title>3->2</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M54.1369,-181.113C68.4889,-185.777 86.3236,-191.571 101.942,-196.646\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"101.235,-200.096 111.827,-199.858 103.398,-193.439 101.235,-200.096\"/>\n", - "<text text-anchor=\"middle\" x=\"81.0396\" y=\"-174.68\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge8\" class=\"edge\">\n", + "<title>3->2</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M54.1369,-181.1133C68.4889,-185.7765 86.3236,-191.5714 101.9423,-196.6462\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"101.2349,-200.0964 111.827,-199.858 103.3981,-193.439 101.2349,-200.0964\"/>\n", + "<text text-anchor=\"middle\" x=\"70.5396\" y=\"-192.6798\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 3->1 -->\n", - "<g id=\"edge18\" class=\"edge\"><title>3->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M27,-154.137C27,-135.157 27,-105.11 27,-82.9567\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"30.5001,-82.7983 27,-72.7983 23.5001,-82.7983 30.5001,-82.7983\"/>\n", - "<text text-anchor=\"middle\" x=\"35\" y=\"-114.347\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge9\" class=\"edge\">\n", + "<title>3->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M27,-154.1369C27,-135.157 27,-105.1104 27,-82.9567\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"30.5001,-82.7983 27,-72.7983 23.5001,-82.7983 30.5001,-82.7983\"/>\n", + "<text text-anchor=\"middle\" x=\"19.5\" y=\"-122.3468\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "<!-- 2->1 -->\n", - "<g id=\"edge20\" class=\"edge\"><title>2->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M126.024,-190.719C106.385,-163.688 69.1556,-112.447 46.3626,-81.0746\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"49.0526,-78.8226 40.3432,-72.7896 43.3895,-82.9371 49.0526,-78.8226\"/>\n", - "<text text-anchor=\"middle\" x=\"77.1931\" y=\"-138.697\" font-family=\"Times,serif\" font-size=\"14.00\">k5</text>\n", + "<g id=\"edge10\" class=\"edge\">\n", + "<title>2->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M126.0236,-190.7187C106.3845,-163.6878 69.1556,-112.4466 46.3626,-81.0746\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"49.0526,-78.8226 40.3432,-72.7896 43.3895,-82.9371 49.0526,-78.8226\"/>\n", + "<text text-anchor=\"middle\" x=\"78.6931\" y=\"-139.6966\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">k5</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -729,7 +755,7 @@ "<Dot visualization: expr_as_graph [(\"k5\",{x,y|x:1..5 & y:1..5 & x>y})]>" ] }, - "execution_count": 28, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -757,7 +783,7 @@ { "data": { "text/markdown": [ - "$\\{(thomas\\mapsto1),(gordon\\mapsto2)\\}$" + "$\\{(\\mathit{thomas}\\mapsto 1),(\\mathit{gordon}\\mapsto 2)\\}$" ], "text/plain": [ "{(thomas↦1),(gordon↦2)}" @@ -781,7 +807,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -793,7 +819,7 @@ "TRUE" ] }, - "execution_count": 1, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -828,7 +854,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 20, "metadata": { "slideshow": { "slide_type": "fragment" @@ -844,7 +870,7 @@ "10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376" ] }, - "execution_count": 18, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -867,7 +893,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -879,7 +905,7 @@ "{1,7,8,9,10}" ] }, - "execution_count": 19, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -890,7 +916,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 22, "metadata": { "slideshow": { "slide_type": "fragment" @@ -906,7 +932,7 @@ "{1,7,8,9,10}" ] }, - "execution_count": 20, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -924,7 +950,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "metadata": { "slideshow": { "slide_type": "fragment" @@ -934,13 +960,13 @@ { "data": { "text/markdown": [ - "$\\{thomas,gordon\\}$" + "$\\{\\mathit{thomas},\\mathit{gordon}\\}$" ], "text/plain": [ "{thomas,gordon}" ] }, - "execution_count": 22, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -962,7 +988,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 24, "metadata": { "slideshow": { "slide_type": "fragment" @@ -978,7 +1004,7 @@ "1" ] }, - "execution_count": 21, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -1000,7 +1026,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 25, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1016,7 +1042,7 @@ "{gordon}" ] }, - "execution_count": 22, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -1039,7 +1065,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1049,13 +1075,13 @@ { "data": { "text/markdown": [ - "$FALSE$" + "$\\mathit{FALSE}$" ], "text/plain": [ "FALSE" ] }, - "execution_count": 25, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -1066,7 +1092,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1076,13 +1102,13 @@ { "data": { "text/markdown": [ - "$TRUE$" + "$\\mathit{TRUE}$" ], "text/plain": [ "TRUE" ] }, - "execution_count": 26, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -1105,7 +1131,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 28, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1127,7 +1153,7 @@ "\tx = −10" ] }, - "execution_count": 23, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -1150,7 +1176,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 29, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1166,7 +1192,7 @@ "{−10,10}" ] }, - "execution_count": 24, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1208,7 +1234,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1224,7 +1250,7 @@ "∃x·(x ∈ ℕ ∧ x * x = 1000)" ] }, - "execution_count": 29, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -1285,7 +1311,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "metadata": { "slideshow": { "slide_type": "skip" @@ -1301,7 +1327,7 @@ "{S,E,N,D,M,O,R,Y} ⊆ 0 ‥ 9 ∧ S > 0 ∧ M > 0 ∧ card({S,E,N,D,M,O,R,Y}) = 8 ∧ S * 1000 + E * 100 + N * 10 + D + M * 1000 + O * 100 + R * 10 + E = M * 10000 + O * 1000 + N * 100 + E * 10 + Y" ] }, - "execution_count": 30, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -1313,7 +1339,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -1345,7 +1371,7 @@ "\tO = 0" ] }, - "execution_count": 31, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -1371,7 +1397,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -1383,7 +1409,7 @@ "{(((((((9↦5)↦6)↦7)↦1)↦0)↦8)↦2)}" ] }, - "execution_count": 32, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -1399,7 +1425,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -1414,7 +1440,7 @@ "9\t5\t6\t7\t1\t0\t8\t2\n" ] }, - "execution_count": 33, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -1442,22 +1468,22 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $P = 4$\n", - "* $A = 1$\n", - "* $S = 3$\n", - "* $I = 0$\n", - "* $K = 2$\n", - "* $N = 9$\n", - "* $O = 8$" + "* $\\mathit{P} = 4$\n", + "* $\\mathit{A} = 1$\n", + "* $\\mathit{S} = 3$\n", + "* $\\mathit{I} = 0$\n", + "* $\\mathit{K} = 2$\n", + "* $\\mathit{N} = 9$\n", + "* $\\mathit{O} = 8$" ], "text/plain": [ "TRUE\n", @@ -1472,7 +1498,7 @@ "\tO = 8" ] }, - "execution_count": 39, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -1487,7 +1513,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -1502,7 +1528,7 @@ "2\t0\t3\t4\t1\t8\t9\n" ] }, - "execution_count": 29, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -1528,16 +1554,16 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $x = \\{2,3,4,5\\}$" + "* $\\mathit{x} = \\{2,3,4,5\\}$" ], "text/plain": [ "TRUE\n", @@ -1546,7 +1572,7 @@ "\tx = {2,3,4,5}" ] }, - "execution_count": 40, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -1564,16 +1590,16 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.113811662 seconds" + "Execution time: 0.116087886 seconds" ], "text/plain": [ - "Execution time: 0.113811662 seconds" + "Execution time: 0.116087886 seconds" ] }, "metadata": {}, @@ -1596,7 +1622,7 @@ "\tn = 8" ] }, - "execution_count": 32, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -1618,7 +1644,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -1646,7 +1672,7 @@ "\tr1 = 10000000000" ] }, - "execution_count": 7, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -1662,7 +1688,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -1692,7 +1718,7 @@ "\tr1 = 317" ] }, - "execution_count": 8, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -1726,16 +1752,16 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.036815957 seconds" + "Execution time: 0.071063304 seconds" ], "text/plain": [ - "Execution time: 0.036815957 seconds" + "Execution time: 0.071063304 seconds" ] }, "metadata": {}, @@ -1758,7 +1784,7 @@ "\tn = 20" ] }, - "execution_count": 14, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -1771,16 +1797,16 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 1.417787341 seconds" + "Execution time: 3.886160680 seconds" ], "text/plain": [ - "Execution time: 1.417787341 seconds" + "Execution time: 3.886160680 seconds" ] }, "metadata": {}, @@ -1803,7 +1829,7 @@ "\tn = 13" ] }, - "execution_count": 18, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -1816,7 +1842,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -1873,7 +1899,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 44, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1881,23 +1907,12 @@ }, "outputs": [ { - "data": { - "text/markdown": [ - "$TRUE$\n", - "\n", - "**Solution:**\n", - "* $x = -10$" - ], - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = −10" - ] - }, - "execution_count": 52, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -1917,16 +1932,16 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $x = 6001$" + "* $\\mathit{x} = 6001$" ], "text/plain": [ "TRUE\n", @@ -1935,7 +1950,7 @@ "\tx = 6001" ] }, - "execution_count": 53, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -1946,27 +1961,16 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 46, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "$TRUE$\n", - "\n", - "**Solution:**\n", - "* $x = 6001$" - ], - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = 6001" - ] - }, - "execution_count": 54, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -1986,7 +1990,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -2004,27 +2008,16 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 48, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "$TRUE$\n", - "\n", - "**Solution:**\n", - "* $x = 6756001$" - ], - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = 6756001" - ] - }, - "execution_count": 56, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2045,21 +2038,16 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 49, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "$FALSE$" - ], - "text/plain": [ - "FALSE" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2068,7 +2056,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -2121,7 +2109,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -2141,7 +2129,7 @@ "\ty = {1,2}" ] }, - "execution_count": 39, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -2167,7 +2155,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -2179,7 +2167,7 @@ "1267650600228229401496703205376" ] }, - "execution_count": 64, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } @@ -2197,7 +2185,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 53, "metadata": {}, "outputs": [ { @@ -2215,7 +2203,7 @@ "\tx = {{100},{1}}" ] }, - "execution_count": 36, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -2237,7 +2225,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -2255,7 +2243,7 @@ "\tx = {{100},{50,100},{25,50,100},{12,25,50,100},{6,12,25,50,100},{3,6,12,25,50,100},{1,3,6,12,25,50,100},{0,1,3,6,12,25,50,100}}" ] }, - "execution_count": 34, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -2278,16 +2266,16 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.097977646 seconds" + "Execution time: 0.078285006 seconds" ], "text/plain": [ - "Execution time: 0.097977646 seconds" + "Execution time: 0.078285006 seconds" ] }, "metadata": {}, @@ -2296,10 +2284,10 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r = \\{(3\\mapsto5),(3\\mapsto4),(5\\mapsto5),(5\\mapsto4),(1\\mapsto4),(2\\mapsto4),(4\\mapsto4)\\}$" + "* $\\mathit{r} = \\{(3\\mapsto 5),(3\\mapsto 4),(5\\mapsto 5),(5\\mapsto 4),(1\\mapsto 4),(2\\mapsto 4),(4\\mapsto 4)\\}$" ], "text/plain": [ "TRUE\n", @@ -2308,7 +2296,7 @@ "\tr = {(3↦5),(3↦4),(5↦5),(5↦4),(1↦4),(2↦4),(4↦4)}" ] }, - "execution_count": 67, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -2333,29 +2321,16 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 56, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "$TRUE$\n", - "\n", - "**Solution:**\n", - "* $x = \\emptyset$\n", - "* $y = \\{1,2\\}$" - ], - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = ∅\n", - "\ty = {1,2}" - ] - }, - "execution_count": 68, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2382,7 +2357,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -2426,7 +2401,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 58, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2442,7 +2417,7 @@ "f = {(1↦3),(2↦6)} ∧ (∃ /* LET */ (st13).( (st13)=r ∧ ∀st15·(st15 ∈ st13 ⇒ ∃st16·(6 ↦ st15 ∈ st16 ∧ (∀(st17,st18)·(st17 ↦ st18 ∈ st16 ⇒ st18 ↦ st17 ∈ f) ∧ ∀(st17,st18)·(st18 ↦ st17 ∈ f ⇒ st17 ↦ st18 ∈ st16)))) ∧ ∀st15·(∃st19·(6 ↦ st15 ∈ st19 ∧ (∀(st20,st21)·(st20 ↦ st21 ∈ st19 ⇒ st21 ↦ st20 ∈ f) ∧ ∀(st20,st21)·(st21 ↦ st20 ∈ f ⇒ st20 ↦ st21 ∈ st19))) ⇒ st15 ∈ st13)))" ] }, - "execution_count": 57, + "execution_count": 58, "metadata": {}, "output_type": "execute_result" } @@ -2459,7 +2434,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 59, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2469,10 +2444,10 @@ { "data": { "text/markdown": [ - "Execution time: 0.140791514 seconds" + "Execution time: 0.066506694 seconds" ], "text/plain": [ - "Execution time: 0.140791514 seconds" + "Execution time: 0.066506694 seconds" ] }, "metadata": {}, @@ -2495,7 +2470,7 @@ "\tf = {(1↦3),(2↦6)}" ] }, - "execution_count": 58, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -2512,7 +2487,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 60, "metadata": {}, "outputs": [ { @@ -2549,7 +2524,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -2561,7 +2536,7 @@ "FALSE" ] }, - "execution_count": 60, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -2579,21 +2554,16 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 62, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "$\\mathit{FALSE}$" - ], - "text/plain": [ - "FALSE" - ] - }, - "execution_count": 61, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2628,7 +2598,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 63, "metadata": { "slideshow": { "slide_type": "fragment" @@ -2644,7 +2614,7 @@ "{0,100,200,300,400,500,600,700,800,900,1000}" ] }, - "execution_count": 62, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -2668,7 +2638,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 64, "metadata": {}, "outputs": [ { @@ -2680,7 +2650,7 @@ "{x∣x > 1000}" ] }, - "execution_count": 37, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -2698,17 +2668,17 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 65, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$\\mathit{TRUE}$\n", + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", "* $\\mathit{inf} = \\{\\mathit{x}\\mid \\mathit{x} > 1000\\}$\n", - "* $\\mathit{res} = (1001 \\ldots 1100)$" + "* $\\mathit{res} = (1001 \\upto 1100)$" ], "text/plain": [ "TRUE\n", @@ -2718,7 +2688,7 @@ "\tres = (1001 ‥ 1100)" ] }, - "execution_count": 38, + "execution_count": 65, "metadata": {}, "output_type": "execute_result" } @@ -2755,7 +2725,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 66, "metadata": { "slideshow": { "slide_type": "fragment" @@ -2765,10 +2735,10 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $vec = \\{(1\\mapsto1),(2\\mapsto2),(3\\mapsto4),(4\\mapsto8),(5\\mapsto16),(6\\mapsto32),(7\\mapsto64),(8\\mapsto128),(9\\mapsto256),(10\\mapsto512)\\}$" + "* $\\mathit{vec} = \\{(1\\mapsto 1),(2\\mapsto 2),(3\\mapsto 4),(4\\mapsto 8),(5\\mapsto 16),(6\\mapsto 32),(7\\mapsto 64),(8\\mapsto 128),(9\\mapsto 256),(10\\mapsto 512)\\}$" ], "text/plain": [ "TRUE\n", @@ -2777,7 +2747,7 @@ "\tvec = {(1↦1),(2↦2),(3↦4),(4↦8),(5↦16),(6↦32),(7↦64),(8↦128),(9↦256),(10↦512)}" ] }, - "execution_count": 83, + "execution_count": 66, "metadata": {}, "output_type": "execute_result" } @@ -2819,16 +2789,16 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 67, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.716030873 seconds" + "Execution time: 0.592840941 seconds" ], "text/plain": [ - "Execution time: 0.716030873 seconds" + "Execution time: 0.592840941 seconds" ] }, "metadata": {}, @@ -2855,7 +2825,7 @@ "\ts2 = #2000∈{5,10,…,9995,10000}" ] }, - "execution_count": 1, + "execution_count": 67, "metadata": {}, "output_type": "execute_result" } @@ -3002,7 +2972,7 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 68, "metadata": {}, "outputs": [ { @@ -3020,39 +2990,16 @@ }, { "cell_type": "code", - "execution_count": 104, + "execution_count": 69, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "Execution time: 0.224425596 seconds" - ], - "text/plain": [ - "Execution time: 0.224425596 seconds" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "$TRUE$\n", - "\n", - "**Solution:**\n", - "* $x = \\{6,7,8,9,10,11,12,13,14,15\\}$" - ], - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = {6,7,8,9,10,11,12,13,14,15}" - ] - }, - "execution_count": 104, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -3061,39 +3008,16 @@ }, { "cell_type": "code", - "execution_count": 105, + "execution_count": 70, "metadata": {}, "outputs": [ { - "data": { - "text/markdown": [ - "Execution time: 1.149180308 seconds" - ], - "text/plain": [ - "Execution time: 1.149180308 seconds" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "$TRUE$\n", - "\n", - "**Solution:**\n", - "* $x = \\{6,7,8,9,10,11,12,13,14,15\\}$" - ], - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = {6,7,8,9,10,11,12,13,14,15}" - ] - }, - "execution_count": 105, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -3102,7 +3026,7 @@ }, { "cell_type": "code", - "execution_count": 106, + "execution_count": 71, "metadata": {}, "outputs": [ { @@ -3120,16 +3044,16 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.005873811 seconds" + "Execution time: 0.006872708 seconds" ], "text/plain": [ - "Execution time: 0.005873811 seconds" + "Execution time: 0.006872708 seconds" ] }, "metadata": {}, @@ -3138,10 +3062,10 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $x = (6 \\ldots 15)$" + "* $\\mathit{x} = (6 \\upto 15)$" ], "text/plain": [ "TRUE\n", @@ -3150,7 +3074,7 @@ "\tx = (6 ‥ 15)" ] }, - "execution_count": 107, + "execution_count": 72, "metadata": {}, "output_type": "execute_result" } @@ -3172,7 +3096,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 73, "metadata": {}, "outputs": [ { @@ -3190,19 +3114,19 @@ }, { "cell_type": "code", - "execution_count": 109, + "execution_count": 74, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r = \\{2,3,5,7,11\\}$\n", - "* $c = (\\{2,3,5,7,11\\} * \\{4,8,16,32\\})$\n", - "* $s1 = \\{2,3,5,7,11\\}$\n", - "* $s2 = \\{4,8,16,32\\}$" + "* $\\mathit{r} = \\{2,3,5,7,11\\}$\n", + "* $\\mathit{c} = (\\{2,3,5,7,11\\} * \\{4,8,16,32\\})$\n", + "* $\\mathit{s1} = \\{2,3,5,7,11\\}$\n", + "* $\\mathit{s2} = \\{4,8,16,32\\}$" ], "text/plain": [ "TRUE\n", @@ -3214,7 +3138,7 @@ "\ts2 = {4,8,16,32}" ] }, - "execution_count": 109, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } @@ -3236,7 +3160,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 75, "metadata": {}, "outputs": [ { @@ -3245,7 +3169,7 @@ "Loaded machine: signals" ] }, - "execution_count": 44, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } @@ -3284,16 +3208,16 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 76, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.199987519 seconds" + "Execution time: 0.344076441 seconds" ], "text/plain": [ - "Execution time: 0.199987519 seconds" + "Execution time: 0.344076441 seconds" ] }, "metadata": {}, @@ -3316,7 +3240,7 @@ "\tnxt = {(PL01↦PL02),(PL02↦PL03),(PL03↦PL04),(PL04↦PL05),(PL05↦PL06),(PL06↦PL07),(PL07↦PL08),(PL08↦PL09),(PL09↦PL10),(PL10↦PL11),(PL11↦PL11),(PL12↦PL13),(PL13↦PL14),(PL14↦PL15),(PL15↦PL16),(PL16↦PL17),(PL17↦PL18),(PL18↦PL19),(PL19↦PL20),(PL20↦PL20)}" ] }, - "execution_count": 45, + "execution_count": 76, "metadata": {}, "output_type": "execute_result" } @@ -3333,7 +3257,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 77, "metadata": {}, "outputs": [ { @@ -3357,16 +3281,16 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.789322780 seconds" + "Execution time: 1.241641085 seconds" ], "text/plain": [ - "Execution time: 0.789322780 seconds" + "Execution time: 1.241641085 seconds" ] }, "metadata": {}, @@ -3389,7 +3313,7 @@ "\tnxt = {(PL01↦PL02),(PL02↦PL03),(PL03↦PL04),(PL04↦PL05),(PL05↦PL06),(PL06↦PL07),(PL07↦PL08),(PL08↦PL09),(PL09↦PL10),(PL10↦PL11),(PL11↦PL11),(PL12↦PL13),(PL13↦PL14),(PL14↦PL15),(PL15↦PL16),(PL16↦PL17),(PL17↦PL18),(PL18↦PL19),(PL19↦PL20),(PL20↦PL20)}" ] }, - "execution_count": 47, + "execution_count": 78, "metadata": {}, "output_type": "execute_result" } @@ -3403,13 +3327,6 @@ " PL17 |-> PL18, PL18 |-> PL19, PL19 |-> PL20, PL20 |-> PL20} &\n", " res = SIGNAL \\ nxt[SIGNAL]" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/notebooks/presentations/SETS_RODIN18.ipynb b/notebooks/presentations/SETS_RODIN18.ipynb index f9479ae876cd0068e3cc72b8e2f6d6cb7cfa0b92..1f5bfcc7330a7e8975192da0f521a9b9d0dc8cba 100644 --- a/notebooks/presentations/SETS_RODIN18.ipynb +++ b/notebooks/presentations/SETS_RODIN18.ipynb @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": { "slideshow": { "slide_type": "subslide" @@ -48,11 +48,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{FALSE},\\mathit{TRUE}\\}$" + ], "text/plain": [ "{FALSE,TRUE}" ] }, - "execution_count": 3, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -63,7 +66,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" @@ -72,11 +75,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\text{\"this is a string\"}$" + ], "text/plain": [ "\"this is a string\"" ] }, - "execution_count": 4, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -87,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": { "slideshow": { "slide_type": "fragment" @@ -96,11 +102,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$1024$" + ], "text/plain": [ "1024" ] }, - "execution_count": 5, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -123,31 +132,20 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 4, "metadata": { "slideshow": { "slide_type": "-" } }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 11:26:25,674, T+11556688] \"Shell-0\" de.prob.cli.PrologProcessProvider.makeProcess(PrologProcessProvider.java:64): [INFO] Starting ProB's Prolog Core. Path is /Users/leuschel/git_root/prob_prolog/probcli.sh\n", - "[2018-06-05 11:26:26,811, T+11557825] \"Shell-0\" de.prob.cli.PortPattern.setValue(PortPattern.java:30): [INFO] Server has started and listens on port 54552\n", - "[2018-06-05 11:26:26,812, T+11557826] \"Shell-0\" de.prob.cli.InterruptRefPattern.setValue(InterruptRefPattern.java:29): [INFO] Server can receive user interrupts via reference 61500\n", - "[2018-06-05 11:26:26,814, T+11557828] \"ProB Output Logger for instance 78644ca9\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] -- starting command loop --\u001b[0m\n", - "[2018-06-05 11:26:26,833, T+11557847] \"ProB Output Logger for instance 78644ca9\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Connected: 127.0.0.1\u001b[0m\n" - ] - }, { "data": { "text/plain": [ - "Loaded machine: MyBasicSets : []\n" + "Loaded machine: MyBasicSets" ] }, - "execution_count": 74, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -161,16 +159,19 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{thomas},\\mathit{gordon}\\}$" + ], "text/plain": [ "{thomas,gordon}" ] }, - "execution_count": 7, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -192,7 +193,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": { "slideshow": { "slide_type": "-" @@ -201,11 +202,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{Points1},\\mathit{Points2}\\}$" + ], "text/plain": [ "{Points1,Points2}" ] }, - "execution_count": 8, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -228,7 +232,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": { "slideshow": { "slide_type": "fragment" @@ -237,11 +241,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$(\\mathit{thomas}\\mapsto 10)$" + ], "text/plain": [ "(thomas↦10)" ] }, - "execution_count": 9, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -252,7 +259,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "metadata": { "slideshow": { "slide_type": "fragment" @@ -261,11 +268,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$(\\mathit{thomas}\\mapsto 10)$" + ], "text/plain": [ "(thomas↦10)" ] }, - "execution_count": 10, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -287,16 +297,19 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$((\\mathit{thomas}\\mapsto \\mathit{gordon})\\mapsto 20)$" + ], "text/plain": [ "((thomas↦gordon)↦20)" ] }, - "execution_count": 11, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -314,9 +327,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{rec}(\\mathit{length}\\in 20,\\mathit{position}\\in 10302,\\mathit{train}\\in \\mathit{thomas})$" + ], + "text/plain": [ + "rec(length∈20,position∈10302,train∈thomas)" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "rec(train:thomas,length:20,position:10302)" ] @@ -336,7 +363,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": { "slideshow": { "slide_type": "fragment" @@ -345,11 +372,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{1,2,3\\}$" + ], "text/plain": [ "{1,2,3}" ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -371,7 +401,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": { "slideshow": { "slide_type": "fragment" @@ -380,11 +410,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{1,2,3\\}$" + ], "text/plain": [ "{1,2,3}" ] }, - "execution_count": 13, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -402,9 +435,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$((((\\{\\mathit{FALSE},\\mathit{TRUE}\\}\\mapsto \\mathit{INTEGER})\\mapsto \\mathit{STRING})\\mapsto\\{\\mathit{thomas},\\mathit{gordon}\\})\\mapsto\\{\\mathit{Points1},\\mathit{Points2}\\})$" + ], + "text/plain": [ + "(((({FALSE,TRUE}↦INTEGER)↦STRING)↦{thomas,gordon})↦{Points1,Points2})" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "(BOOL,INTEGER,STRING,Trains,Points)" ] @@ -431,6 +478,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{1,2,3\\}$" + ], "text/plain": [ "{1,2,3}" ] @@ -473,6 +523,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\{0,1\\},\\{1,2,3\\}\\}$" + ], "text/plain": [ "{{0,1},{1,2,3}}" ] @@ -508,6 +561,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{(\\mathit{thomas}\\mapsto \\mathit{thomas}),(\\mathit{thomas}\\mapsto \\mathit{gordon}),(\\mathit{gordon}\\mapsto \\mathit{gordon})\\}$" + ], "text/plain": [ "{(thomas↦thomas),(thomas↦gordon),(gordon↦gordon)}" ] @@ -535,9 +591,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\{(\\mathit{thomas}\\mapsto \\mathit{thomas}),(\\mathit{thomas}\\mapsto \\mathit{gordon}),(\\mathit{gordon}\\mapsto \\mathit{thomas}),(\\mathit{gordon}\\mapsto \\mathit{gordon})\\}$" + ], + "text/plain": [ + "{(thomas↦thomas),(thomas↦gordon),(gordon↦thomas),(gordon↦gordon)}" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "Trains * Trains" ] @@ -555,16 +625,19 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\{(\\mathit{thomas}\\mapsto 1),(\\mathit{gordon}\\mapsto 2)\\}$" + ], "text/plain": [ "{(thomas↦1),(gordon↦2)}" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -599,7 +672,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": { "slideshow": { "slide_type": "fragment" @@ -608,11 +681,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376$" + ], "text/plain": [ "10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376" ] }, - "execution_count": 18, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -635,16 +711,19 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\{1,7,8,9,10\\}$" + ], "text/plain": [ "{1,7,8,9,10}" ] }, - "execution_count": 19, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -655,7 +734,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": { "slideshow": { "slide_type": "fragment" @@ -664,11 +743,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{1,7,8,9,10\\}$" + ], "text/plain": [ "{1,7,8,9,10}" ] }, - "execution_count": 20, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -695,6 +777,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{thomas},\\mathit{gordon}\\}$" + ], "text/plain": [ "{thomas,gordon}" ] @@ -721,7 +806,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 23, "metadata": { "slideshow": { "slide_type": "fragment" @@ -765,6 +850,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{\\mathit{gordon}\\}$" + ], "text/plain": [ "{gordon}" ] @@ -792,7 +880,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 25, "metadata": { "slideshow": { "slide_type": "fragment" @@ -801,11 +889,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] }, - "execution_count": 26, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -816,7 +907,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 26, "metadata": { "slideshow": { "slide_type": "fragment" @@ -825,11 +916,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$" + ], "text/plain": [ "TRUE" ] }, - "execution_count": 27, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -852,7 +946,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 27, "metadata": { "slideshow": { "slide_type": "fragment" @@ -861,6 +955,12 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = -10$" + ], "text/plain": [ "TRUE\n", "\n", @@ -868,7 +968,7 @@ "\tx = −10" ] }, - "execution_count": 28, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -891,7 +991,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 28, "metadata": { "slideshow": { "slide_type": "fragment" @@ -900,11 +1000,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\{-10,10\\}$" + ], "text/plain": [ "{−10,10}" ] }, - "execution_count": 29, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -945,7 +1048,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 29, "metadata": { "slideshow": { "slide_type": "fragment" @@ -958,10 +1061,10 @@ "$\\exists \\mathit{x}\\cdot (\\mathit{x} \\in \\mathbb N \\wedge \\mathit{x} * \\mathit{x} = 1000)$" ], "text/plain": [ - "∃x·(x ∈ ℕ ∧ x * x = 1000)" + "∃x·(x ∈ ℕ ∧ x * x = 1000)" ] }, - "execution_count": 32, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1012,11 +1115,20 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 30, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = 1$\n", + "* $\\mathit{train\\_position} = \\{(\\mathit{thomas}\\mapsto 100),(\\mathit{gordon}\\mapsto 2020)\\}$\n", + "* $\\mathit{t1} = \\mathit{thomas}$\n", + "* $\\mathit{t2} = \\mathit{gordon}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1027,7 +1139,7 @@ "\tt2 = gordon" ] }, - "execution_count": 33, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -1040,9 +1152,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "train_position = {thomas|->2019, gordon|->2020} &\n", "t1:dom(train_position) & t2:dom(train_position) & train_position(t1) < train_position(t2) &\n", @@ -1063,11 +1189,20 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 32, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = 1$\n", + "* $\\mathit{train\\_position} = \\{(\\mathit{thomas}\\mapsto 1),(\\mathit{gordon}\\mapsto 3)\\}$\n", + "* $\\mathit{t1} = \\mathit{thomas}$\n", + "* $\\mathit{t2} = \\mathit{gordon}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1078,7 +1213,7 @@ "\tt2 = gordon" ] }, - "execution_count": 34, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -1091,26 +1226,26 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "|Nr|x|y|\n", - "|---|---|---|\n", - "|1|TRUE|1|\n", - "|2|TRUE|2|\n", - "|3|TRUE|3|\n" + "|x|y|\n", + "|---|---|\n", + "|$\\mathit{TRUE}$|$1$|\n", + "|$\\mathit{TRUE}$|$2$|\n", + "|$\\mathit{TRUE}$|$3$|\n" ], "text/plain": [ - "Nr\tx\ty\n", - "1\tTRUE\t1\n", - "2\tTRUE\t2\n", - "3\tTRUE\t3\n" + "x\ty\n", + "TRUE\t1\n", + "TRUE\t2\n", + "TRUE\t3\n" ] }, - "execution_count": 35, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -1138,16 +1273,19 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 34, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] }, - "execution_count": 36, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -1182,7 +1320,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 35, "metadata": { "slideshow": { "slide_type": "skip" @@ -1198,7 +1336,7 @@ "{S,E,N,D,M,O,R,Y} ⊆ 0 ‥ 9 ∧ S > 0 ∧ M > 0 ∧ card({S,E,N,D,M,O,R,Y}) = 8 ∧ S * 1000 + E * 100 + N * 10 + D + M * 1000 + O * 100 + R * 10 + E = M * 10000 + O * 1000 + N * 100 + E * 10 + Y" ] }, - "execution_count": 37, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -1210,11 +1348,24 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 36, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = 8$\n", + "* $\\mathit{S} = 9$\n", + "* $\\mathit{D} = 7$\n", + "* $\\mathit{E} = 5$\n", + "* $\\mathit{Y} = 2$\n", + "* $\\mathit{M} = 1$\n", + "* $\\mathit{N} = 6$\n", + "* $\\mathit{O} = 0$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1229,7 +1380,7 @@ "\tO = 0" ] }, - "execution_count": 38, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -1255,16 +1406,19 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 37, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\{(((((((9\\mapsto 5)\\mapsto 6)\\mapsto 7)\\mapsto 1)\\mapsto 0)\\mapsto 8)\\mapsto 2)\\}$" + ], "text/plain": [ "{(((((((9↦5)↦6)↦7)↦1)↦0)↦8)↦2)}" ] }, - "execution_count": 39, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -1280,22 +1434,22 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "|Nr|S|E|N|D|M|O|R|Y|\n", - "|---|---|---|---|---|---|---|---|---|\n", - "|1|9|5|6|7|1|0|8|2|\n" + "|S|E|N|D|M|O|R|Y|\n", + "|---|---|---|---|---|---|---|---|\n", + "|$9$|$5$|$6$|$7$|$1$|$0$|$8$|$2$|\n" ], "text/plain": [ - "Nr\tS\tE\tN\tD\tM\tO\tR\tY\n", - "1\t9\t5\t6\t7\t1\t0\t8\t2\n" + "S\tE\tN\tD\tM\tO\tR\tY\n", + "9\t5\t6\t7\t1\t0\t8\t2\n" ] }, - "execution_count": 40, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -1323,9 +1477,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{P} = 4$\n", + "* $\\mathit{A} = 1$\n", + "* $\\mathit{S} = 3$\n", + "* $\\mathit{I} = 0$\n", + "* $\\mathit{K} = 2$\n", + "* $\\mathit{N} = 9$\n", + "* $\\mathit{O} = 8$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tP = 4\n", + "\tA = 1\n", + "\tS = 3\n", + "\tI = 0\n", + "\tK = 2\n", + "\tN = 9\n", + "\tO = 8" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ " {K,P} <: 1..9 &\n", " {I,S,A,O,N} <: 0..9 &\n", @@ -1347,11 +1533,17 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 40, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\{2,3,4,5\\}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1359,7 +1551,7 @@ "\tx = {2,3,4,5}" ] }, - "execution_count": 41, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -1421,7 +1613,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 41, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1430,7 +1622,15 @@ "outputs": [ { "data": { - "text/plain": [ + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{A} = \\mathit{TRUE}$\n", + "* $\\mathit{B} = \\mathit{TRUE}$\n", + "* $\\mathit{C} = \\mathit{FALSE}$" + ], + "text/plain": [ "TRUE\n", "\n", "Solution:\n", @@ -1439,7 +1639,7 @@ "\tC = FALSE" ] }, - "execution_count": 42, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -1478,16 +1678,19 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 42, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\{(0\\mapsto 2),(1\\mapsto 1),(2\\mapsto 0)\\}$" + ], "text/plain": [ "{(0↦2),(1↦1),(2↦0)}" ] }, - "execution_count": 43, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -1528,11 +1731,23 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 43, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{Z0} = \\mathit{FALSE}$\n", + "* $\\mathit{Y0} = \\mathit{TRUE}$\n", + "* $\\mathit{Z1} = \\mathit{TRUE}$\n", + "* $\\mathit{X0} = \\mathit{TRUE}$\n", + "* $\\mathit{Y1} = \\mathit{TRUE}$\n", + "* $\\mathit{X1} = \\mathit{TRUE}$\n", + "* $\\mathit{CARRY0} = \\mathit{TRUE}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1546,7 +1761,7 @@ "\tCARRY0 = TRUE" ] }, - "execution_count": 44, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -1561,7 +1776,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 44, "metadata": { "slideshow": { "slide_type": "subslide" @@ -1570,11 +1785,14 @@ "outputs": [ { "data": { + "text/markdown": [ + "$4$" + ], "text/plain": [ "4" ] }, - "execution_count": 46, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } @@ -1597,7 +1815,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 45, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1607,20 +1825,20 @@ { "data": { "text/markdown": [ - "|Nr|X0|X1|Y0|Y1|Z0|Z1|CARRY0|\n", - "|---|---|---|---|---|---|---|---|\n", - "|1|FALSE|FALSE|FALSE|TRUE|FALSE|TRUE|FALSE|\n", - "|2|FALSE|TRUE|FALSE|FALSE|FALSE|TRUE|FALSE|\n", - "|3|TRUE|FALSE|TRUE|FALSE|FALSE|TRUE|TRUE|\n" + "|X0|X1|Y0|Y1|Z0|Z1|CARRY0|\n", + "|---|---|---|---|---|---|---|\n", + "|$\\mathit{FALSE}$|$\\mathit{FALSE}$|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{FALSE}$|\n", + "|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{FALSE}$|$\\mathit{FALSE}$|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{FALSE}$|\n", + "|$\\mathit{TRUE}$|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{FALSE}$|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{TRUE}$|\n" ], "text/plain": [ - "Nr\tX0\tX1\tY0\tY1\tZ0\tZ1\tCARRY0\n", - "1\tFALSE\tFALSE\tFALSE\tTRUE\tFALSE\tTRUE\tFALSE\n", - "2\tFALSE\tTRUE\tFALSE\tFALSE\tFALSE\tTRUE\tFALSE\n", - "3\tTRUE\tFALSE\tTRUE\tFALSE\tFALSE\tTRUE\tTRUE\n" + "X0\tX1\tY0\tY1\tZ0\tZ1\tCARRY0\n", + "FALSE\tFALSE\tFALSE\tTRUE\tFALSE\tTRUE\tFALSE\n", + "FALSE\tTRUE\tFALSE\tFALSE\tFALSE\tTRUE\tFALSE\n", + "TRUE\tFALSE\tTRUE\tFALSE\tFALSE\tTRUE\tTRUE\n" ] }, - "execution_count": 91, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -1656,24 +1874,22 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 46, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:10:18,465, T+6989479] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \u001b[0mkodkod ok: x : 0 .. 2 & y : 0 .. 2 & x + y = 2 ints: irange(0,4), intatoms: none\u001b[0m\n", - "[2018-06-05 10:10:18,465, T+6989479] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Kodkod module started up successfully (SAT solver SAT4J with timeout of 1500 ms).\u001b[0m\n", - "[2018-06-05 10:10:18,466, T+6989480] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Times for computing solutions: [1,2,0]\u001b[0m\n" - ] - }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = 2$\n", + "* $\\mathit{y} = 0$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1682,7 +1898,7 @@ "\ty = 0" ] }, - "execution_count": 49, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -1700,23 +1916,21 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 47, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:10:35,717, T+7006731] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] kodkod ok: {x,y|x : 0 .. 2 & y : 0 .. 2 & x + y = 2} = res ints: irange(0,4), intatoms: irange(0,2)\u001b[0m\n", - "[2018-06-05 10:10:35,718, T+7006732] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Times for computing solutions: [1]\u001b[0m\n" - ] - }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{res} = \\{(0\\mapsto 2),(1\\mapsto 1),(2\\mapsto 0)\\}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1724,7 +1938,7 @@ "\tres = {(0↦2),(1↦1),(2↦0)}" ] }, - "execution_count": 50, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -1775,22 +1989,16 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 48, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = 0\n", - "\ty = 2" - ] - }, - "execution_count": 51, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -1837,16 +2045,16 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.009508264 seconds" + "Execution time: 0.019088766 seconds" ], "text/plain": [ - "Execution time: 0.009508264 seconds" + "Execution time: 0.019088766 seconds" ] }, "metadata": {}, @@ -1854,6 +2062,18 @@ }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{P} = 4$\n", + "* $\\mathit{A} = 1$\n", + "* $\\mathit{S} = 3$\n", + "* $\\mathit{I} = 0$\n", + "* $\\mathit{K} = 2$\n", + "* $\\mathit{N} = 9$\n", + "* $\\mathit{O} = 8$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1867,7 +2087,7 @@ "\tO = 8" ] }, - "execution_count": 52, + "execution_count": 49, "metadata": {}, "output_type": "execute_result" } @@ -1880,7 +2100,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 50, "metadata": { "slideshow": { "slide_type": "subslide" @@ -1902,24 +2122,16 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 51, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:18:05,165, T+7456179] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] kodkod ok: K : 1 .. 9 & P : 1 .. 9 & I : 0 .. 9 & S : 0 .. 9 ... ints: irange(0,99980001), intatoms: irange(0,9)\u001b[0m\n", - "[2018-06-05 10:18:05,165, T+7456179] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Times for computing solutions: [395]\u001b[0m\n" - ] - }, { "data": { "text/markdown": [ - "Execution time: 0.918848527 seconds" + "Execution time: 1.669338080 seconds" ], "text/plain": [ - "Execution time: 0.918848527 seconds" + "Execution time: 1.669338080 seconds" ] }, "metadata": {}, @@ -1927,6 +2139,18 @@ }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{P} = 4$\n", + "* $\\mathit{A} = 1$\n", + "* $\\mathit{S} = 3$\n", + "* $\\mathit{I} = 0$\n", + "* $\\mathit{K} = 2$\n", + "* $\\mathit{N} = 9$\n", + "* $\\mathit{O} = 8$" + ], "text/plain": [ "TRUE\n", "\n", @@ -1940,7 +2164,7 @@ "\tO = 8" ] }, - "execution_count": 54, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -1988,7 +2212,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 52, "metadata": { "slideshow": { "slide_type": "fragment" @@ -1996,17 +2220,12 @@ }, "outputs": [ { - "data": { - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = −10" - ] - }, - "execution_count": 55, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2026,18 +2245,17 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 53, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:19:13,740, T+7524754] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] ### Warning: enumerating x : INTEGER : 6001:sup ---> 6001:6001\u001b[0m\n" - ] - }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = 6001$" + ], "text/plain": [ "TRUE\n", "\n", @@ -2045,7 +2263,7 @@ "\tx = 6001" ] }, - "execution_count": 56, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -2056,21 +2274,16 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 54, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = 6001" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2090,16 +2303,9 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 55, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:19:51,805, T+7562819] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] ### Warning: enumerating x : INTEGER : 6001:sup ---> 6001:6001\u001b[0m\n" - ] - }, { "ename": "CommandExecutionException", "evalue": ":solve: Computation not completed: no solution found (but one might exist)", @@ -2115,21 +2321,16 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 56, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "TRUE\n", - "\n", - "Solution:\n", - "\tx = 6756001" - ] - }, - "execution_count": 58, - "metadata": {}, - "output_type": "execute_result" + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] } ], "source": [ @@ -2150,18 +2351,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 57, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 x>y & y>x" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 58, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve prob x>y &y>x" ] @@ -2200,9 +2419,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 59, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\mathit{thomas}$\n", + "* $\\mathit{y} = \\mathit{gordon}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = thomas\n", + "\ty = gordon" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "x:Trains & y:Trains & x/=y" ] @@ -2227,11 +2468,18 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 60, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\{1\\}$\n", + "* $\\mathit{y} = \\{1,2\\}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -2240,7 +2488,7 @@ "\ty = {1,2}" ] }, - "execution_count": 2, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } @@ -2261,11 +2509,20 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 61, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{y1} = \\mathit{TRUE}$\n", + "* $\\mathit{x1} = \\mathit{TRUE}$\n", + "* $\\mathit{y2} = \\mathit{TRUE}$\n", + "* $\\mathit{x2} = \\mathit{FALSE}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -2276,7 +2533,7 @@ "\tx2 = FALSE" ] }, - "execution_count": 88, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -2290,22 +2547,22 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "|Nr|x1|x2|y1|y2|\n", - "|---|---|---|---|---|\n", - "|1|TRUE|FALSE|TRUE|TRUE|\n" + "|x1|x2|y1|y2|\n", + "|---|---|---|---|\n", + "|$\\mathit{TRUE}$|$\\mathit{FALSE}$|$\\mathit{TRUE}$|$\\mathit{TRUE}$|\n" ], "text/plain": [ - "Nr\tx1\tx2\ty1\ty2\n", - "1\tTRUE\tFALSE\tTRUE\tTRUE\n" + "x1\tx2\ty1\ty2\n", + "TRUE\tFALSE\tTRUE\tTRUE\n" ] }, - "execution_count": 90, + "execution_count": 62, "metadata": {}, "output_type": "execute_result" } @@ -2330,19 +2587,18 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 63, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:22:52,620, T+7743634] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] kodkod ok: x <: 1 .. 2 & y <: 1 .. 2 & x \\/ y = 1 .. 2 & 1 : ... ints: irange(1,2), intatoms: irange(1,2)\u001b[0m\n", - "[2018-06-05 10:22:52,620, T+7743634] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Times for computing solutions: [1]\u001b[0m\n" - ] - }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\{1\\}$\n", + "* $\\mathit{y} = \\{1,2\\}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -2351,7 +2607,7 @@ "\ty = {1,2}" ] }, - "execution_count": 61, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -2377,16 +2633,19 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 64, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$1267650600228229401496703205376$" + ], "text/plain": [ "1267650600228229401496703205376" ] }, - "execution_count": 62, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -2404,9 +2663,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 65, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\{\\{100\\},\\{1\\}\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = {{100},{1}}" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "x <: POW(1..100) & {100}:x & !y.(y:x => {card(y)}:x)" ] @@ -2424,9 +2703,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 66, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\{\\{100\\},\\{50,100\\},\\{25,50,100\\},\\{12,25,50,100\\},\\{6,12,25,50,100\\},\\{3,6,12,25,50,100\\},\\{1,3,6,12,25,50,100\\},\\{0,1,3,6,12,25,50,100\\}\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = {{100},{50,100},{25,50,100},{12,25,50,100},{6,12,25,50,100},{3,6,12,25,50,100},{1,3,6,12,25,50,100},{0,1,3,6,12,25,50,100}}" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "{100}:x & !y.(y:x => (!z.(z:y => y \\/ {z / 2}:x)))" ] @@ -2445,24 +2744,16 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 67, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-05 10:23:40,430, T+7791444] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] kodkod ok: r : 1 .. 5 <-> 1 .. 5 & (r ; r) = r & r /= {} & do... ints: irange(0,5), intatoms: irange(0,5)\u001b[0m\n", - "[2018-06-05 10:23:40,431, T+7791445] \"ProB Output Logger for instance 67d0d036\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Times for computing solutions: [2,2,2,2,4,4,7,2,2,4,6,2,1,4,1,3,2,1,2,3,1,1]\u001b[0m\n" - ] - }, { "data": { "text/markdown": [ - "Execution time: 0.103495089 seconds" + "Execution time: 0.133314395 seconds" ], "text/plain": [ - "Execution time: 0.103495089 seconds" + "Execution time: 0.133314395 seconds" ] }, "metadata": {}, @@ -2470,6 +2761,12 @@ }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{(3\\mapsto 5),(3\\mapsto 4),(5\\mapsto 5),(5\\mapsto 4),(1\\mapsto 4),(2\\mapsto 4),(4\\mapsto 4)\\}$" + ], "text/plain": [ "TRUE\n", "\n", @@ -2477,7 +2774,7 @@ "\tr = {(3↦5),(3↦4),(5↦5),(5↦4),(1↦4),(2↦4),(4↦4)}" ] }, - "execution_count": 63, + "execution_count": 67, "metadata": {}, "output_type": "execute_result" } @@ -2502,9 +2799,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 68, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 x ⊆ 1..2 & y ⊆ 1..2 & x ∪ y = 1..2" ] @@ -2518,13 +2824,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 69, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = \\emptyset$\n", + "* $\\mathit{y} = \\{1,2\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = ∅\n", + "\ty = {1,2}" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "∀ smt_tmp28.(smt_tmp28 ∈ x ⇒ smt_tmp28 ≥ 1 & 2 ≥ smt_tmp28) & \n", "∀ smt_tmp29.(smt_tmp29 ∈ y ⇒ smt_tmp29 ≥ 1 & 2 ≥ smt_tmp29) &\n", @@ -2581,9 +2909,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 70, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 x ⊆ 1..2 & y ⊆ 1..2 & x ∪ y = 1..2 & 1∈x & x ⊂ y" ] @@ -2601,7 +2938,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 71, "metadata": {}, "outputs": [ { @@ -2645,13 +2982,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 72, "metadata": { "slideshow": { "slide_type": "subslide" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/latex": [ + "$\\mathit{f} = \\{(1\\mapsto 3),(2\\mapsto 6)\\} \\wedge (\\exists /* LET */ (\\mathit{st13}).( (\\mathit{st13})=\\mathit{r} \\wedge \\forall \\mathit{st15}\\cdot (\\mathit{st15} \\in \\mathit{st13} \\mathbin\\Rightarrow \\exists \\mathit{st16}\\cdot (6 \\mapsto \\mathit{st15} \\in \\mathit{st16} \\wedge (\\forall (\\mathit{st17},\\mathit{st18})\\cdot (\\mathit{st17} \\mapsto \\mathit{st18} \\in \\mathit{st16} \\mathbin\\Rightarrow \\mathit{st18} \\mapsto \\mathit{st17} \\in \\mathit{f}) \\wedge \\forall (\\mathit{st17},\\mathit{st18})\\cdot (\\mathit{st18} \\mapsto \\mathit{st17} \\in \\mathit{f} \\mathbin\\Rightarrow \\mathit{st17} \\mapsto \\mathit{st18} \\in \\mathit{st16})))) \\wedge \\forall \\mathit{st15}\\cdot (\\exists \\mathit{st19}\\cdot (6 \\mapsto \\mathit{st15} \\in \\mathit{st19} \\wedge (\\forall (\\mathit{st20},\\mathit{st21})\\cdot (\\mathit{st20} \\mapsto \\mathit{st21} \\in \\mathit{st19} \\mathbin\\Rightarrow \\mathit{st21} \\mapsto \\mathit{st20} \\in \\mathit{f}) \\wedge \\forall (\\mathit{st20},\\mathit{st21})\\cdot (\\mathit{st21} \\mapsto \\mathit{st20} \\in \\mathit{f} \\mathbin\\Rightarrow \\mathit{st20} \\mapsto \\mathit{st21} \\in \\mathit{st19}))) \\mathbin\\Rightarrow \\mathit{st15} \\in \\mathit{st13})))$" + ], + "text/plain": [ + "f = {(1↦3),(2↦6)} ∧ (∃ /* LET */ (st13).( (st13)=r ∧ ∀st15·(st15 ∈ st13 ⇒ ∃st16·(6 ↦ st15 ∈ st16 ∧ (∀(st17,st18)·(st17 ↦ st18 ∈ st16 ⇒ st18 ↦ st17 ∈ f) ∧ ∀(st17,st18)·(st18 ↦ st17 ∈ f ⇒ st17 ↦ st18 ∈ st16)))) ∧ ∀st15·(∃st19·(6 ↦ st15 ∈ st19 ∧ (∀(st20,st21)·(st20 ↦ st21 ∈ st19 ⇒ st21 ↦ st20 ∈ f) ∧ ∀(st20,st21)·(st21 ↦ st20 ∈ f ⇒ st20 ↦ st21 ∈ st19))) ⇒ st15 ∈ st13)))" + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":prettyprint f = {(1|->3),(2|->6)} &\n", "#st13.(r = st13 & (\n", @@ -2664,13 +3015,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 73, "metadata": { "slideshow": { "slide_type": "subslide" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.078465770 seconds" + ], + "text/plain": [ + "Execution time: 0.078465770 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{2\\}$\n", + "* $\\mathit{f} = \\{(1\\mapsto 3),(2\\mapsto 6)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr = {2}\n", + "\tf = {(1↦3),(2↦6)}" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob f = {(1|->3),(2|->6)} &\n", "#st13.(r = st13 & (\n", @@ -2683,9 +3068,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 74, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve cvc4 f = {(1|->3),(2|->6)} &\n", "#st13.(r = st13 & (\n", @@ -2711,9 +3105,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 75, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 75, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":solve prob x:s1 & x:s2 & x /: (s1 /\\ s2) & s1 <: INTEGER" ] @@ -2727,9 +3135,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 76, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 x:s1 & x/:s2 & x /: (s1 \\/s2) & s1 <: INTEGER" ] @@ -2762,13 +3179,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 77, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\{0,100,200,300,400,500,600,700,800,900,1000\\}$" + ], + "text/plain": [ + "{0,100,200,300,400,500,600,700,800,900,1000}" + ] + }, + "execution_count": 77, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "{x|x∈0..2**10 & x mod 100 = 0}" ] @@ -2786,9 +3217,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 78, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{mn} = 0$\n", + "* $\\mathit{s} = \\{0,100,200,300,400,500,600,700,800,900,1000\\}$\n", + "* $\\mathit{mx} = 1000$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tmn = 0\n", + "\ts = {0,100,200,300,400,500,600,700,800,900,1000}\n", + "\tmx = 1000" + ] + }, + "execution_count": 78, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "s = {x|x∈0..2**10 & x mod 100 = 0} &\n", "mx = max(s) &\n", @@ -2810,9 +3265,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 79, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\{\\mathit{x}\\mid \\mathit{x} > 1000\\}$" + ], + "text/plain": [ + "{x∣x > 1000}" + ] + }, + "execution_count": 79, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "{x|x>1000}" ] @@ -2826,9 +3295,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 80, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{inf} = \\{\\mathit{x}\\mid \\mathit{x} > 1000\\}$\n", + "* $\\mathit{res} = (1001 \\upto 1100)$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tinf = {x∣x > 1000}\n", + "\tres = (1001 ‥ 1100)" + ] + }, + "execution_count": 80, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "inf = {x|x>1000} & 1024 : inf & not(1000:inf) & res = (900..1100) ∩ inf" ] @@ -2847,9 +3338,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 81, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\binter}{\\mathbin{\\mkern1mu\\cap\\mkern1mu}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{inf} = \\{\\mathit{x}\\mid \\mathit{x} > 1000 \\land \\mathit{x} \\mathit{mod} 25 = 0\\}$\n", + "* $\\mathit{res} = ((900 \\upto 1100) \\binter \\{\\mathit{x}\\mid \\mathit{x} > 1000 \\land \\mathit{x} \\mathit{mod} 25 = 0\\})$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tinf = {x∣x > 1000 ∧ x mod 25 = 0}\n", + "\tres = ((900 ‥ 1100) ∩ {x∣x > 1000 ∧ x mod 25 = 0})" + ] + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "inf = {x|x>1000 & x mod 25 = 0} & 1025 ∈ inf & not(1000∈inf) & res = (900..1100) ∩ inf" ] @@ -2867,9 +3380,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 82, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\binter}{\\mathbin{\\mkern1mu\\cap\\mkern1mu}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{inf} = \\{\\mathit{x}\\mid \\mathit{x} > 1000 \\land \\mathit{x} \\mathit{mod} 25 = 0\\}$\n", + "* $\\mathit{res} = ((900 \\upto 1100) \\binter \\{\\mathit{x}\\mid \\mathit{x} > 1000 \\land \\mathit{x} \\mathit{mod} 25 = 0\\})$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tinf = {x∣x > 1000 ∧ x mod 25 = 0}\n", + "\tres = ((900 ‥ 1100) ∩ {x∣x > 1000 ∧ x mod 25 = 0})" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "inf = /*@symbolic*/ {x|x>1000 & x mod 25 = 0} & 1025 ∈ inf & not(1000∈inf) & res = (900..1100) ∩ inf" ] @@ -2902,13 +3437,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 83, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{vec} = \\{(1\\mapsto 1),(2\\mapsto 2),(3\\mapsto 4),(4\\mapsto 8),(5\\mapsto 16),(6\\mapsto 32),(7\\mapsto 64),(8\\mapsto 128),(9\\mapsto 256),(10\\mapsto 512)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tvec = {(1↦1),(2↦2),(3↦4),(4↦8),(5↦16),(6↦32),(7↦64),(8↦128),(9↦256),(10↦512)}" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "vec: 1..10 --> 0..9999 &\n", "vec(1) : {1,10} &\n", @@ -2929,33 +3484,106 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 84, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 3.739915875 seconds" + ], + "text/plain": [ + "Execution time: 3.739915875 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{vec} = \\{(3\\mapsto 4),(5\\mapsto 16),(6\\mapsto 32),(7\\mapsto 64),(1\\mapsto 1),(2\\mapsto 2),(4\\mapsto 8),(8\\mapsto 128)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tvec = {(3↦4),(5↦16),(6↦32),(7↦64),(1↦1),(2↦2),(4↦8),(8↦128)}" + ] + }, + "execution_count": 84, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod vec: 1..8 --> 0..199 & vec(1) : {1,10} & !x.(x:2..8 => vec(x) = vec(x-1)*2)" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - ":time :solve prob vec: 1..8 --> 0..199 & vec(1) : {1,10} & !x.(x:2..8 => vec(x) = vec(x-1)*2)" - ] - }, - { - "cell_type": "code", - "execution_count": null, + "execution_count": 85, "metadata": {}, - "outputs": [], - "source": [ - ":time :solve z3 vec: 1..8 --> 0..199 & vec(1) : {1,10} & !x.(x:2..8 => vec(x) = vec(x-1)*2)" - ] - }, - { - "cell_type": "markdown", + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.022024766 seconds" + ], + "text/plain": [ + "Execution time: 0.022024766 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{vec} = \\{(1\\mapsto 1),(2\\mapsto 2),(3\\mapsto 4),(4\\mapsto 8),(5\\mapsto 16),(6\\mapsto 32),(7\\mapsto 64),(8\\mapsto 128)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tvec = {(1↦1),(2↦2),(3↦4),(4↦8),(5↦16),(6↦32),(7↦64),(8↦128)}" + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":time :solve prob vec: 1..8 --> 0..199 & vec(1) : {1,10} & !x.(x:2..8 => vec(x) = vec(x-1)*2)" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": {}, + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], + "source": [ + ":time :solve z3 vec: 1..8 --> 0..199 & vec(1) : {1,10} & !x.(x:2..8 => vec(x) = vec(x-1)*2)" + ] + }, + { + "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" @@ -2974,9 +3602,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 87, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.630473163 seconds" + ], + "text/plain": [ + "Execution time: 0.630473163 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{s3} = \\#500\\in\\{20,40,\\ldots,9980,10000\\}$\n", + "* $\\mathit{n} = 4$\n", + "* $\\mathit{s1} = \\#2500\\in\\{4,8,\\ldots,9996,10000\\}$\n", + "* $\\mathit{s2} = \\#2000\\in\\{5,10,\\ldots,9995,10000\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\ts3 = #500∈{20,40,…,9980,10000}\n", + "\tn = 4\n", + "\ts1 = #2500∈{4,8,…,9996,10000}\n", + "\ts2 = #2000∈{5,10,…,9995,10000}" + ] + }, + "execution_count": 87, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob s1 = {x|x:1..10**n & x mod n = 0} & s2 = {y|y:1..10**n & y mod (n+1) = 0} & s3 = s1 /\\ s2 & n=4" ] @@ -2994,31 +3660,116 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 88, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.028245723 seconds" + ], + "text/plain": [ + "Execution time: 0.028245723 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{xy} = \\#201\\in\\{1,2,\\ldots,299,300\\}$\n", + "* $\\mathit{x} = (1 \\upto 100)$\n", + "* $\\mathit{y} = (200 \\upto 300)$\n", + "* $\\mathit{n} = 100$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\txy = #201∈{1,2,…,299,300}\n", + "\tx = (1 ‥ 100)\n", + "\ty = (200 ‥ 300)\n", + "\tn = 100" + ] + }, + "execution_count": 88, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob x = 1..n & y = 2*n..3*n & n = 100 & xy = x \\/ y" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 89, "metadata": { "slideshow": { "slide_type": "subslide" } }, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 x = 1..n & y = 2*n..3*n & n = 100 & xy = x \\/ y" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 90, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.692911415 seconds" + ], + "text/plain": [ + "Execution time: 0.692911415 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{xy} = \\{3,5,6,7,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,200,201,202,203,204,205,206,\\ldots\\}$\n", + "* $\\mathit{x} = \\{3,5,6,7,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,1,2,4,8,16,32,64\\}$\n", + "* $\\mathit{y} = \\{200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,256\\}$\n", + "* $\\mathit{n} = 100$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\txy = {3,5,6,7,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,200,201,202,203,204,205,206,…}\n", + "\tx = {3,5,6,7,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,1,2,4,8,16,32,64}\n", + "\ty = {200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,256}\n", + "\tn = 100" + ] + }, + "execution_count": 90, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod x = 1..n & y = 2*n..3*n & n = 100 & xy = x \\/ y" ] @@ -3089,9 +3840,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 91, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\newcommand{\\qdot}{\\mathord{\\mkern1mu\\cdot\\mkern1mu}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r2} = \\{1,4,9,16,25,36,49,64,81,100\\}$\n", + "* $\\mathit{r3} = [4,9,25,49,121]$\n", + "* $\\mathit{r4} = 256$\n", + "* $\\mathit{sqrt} = 10$\n", + "* $\\mathit{f} = \\lambda \\mathit{x}\\qdot(\\mathit{x} \\in \\mathit{INTEGER}\\mid \\mathit{x} * \\mathit{x})$\n", + "* $\\mathit{r1} = 10000000000$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr2 = {1,4,9,16,25,36,49,64,81,100}\n", + "\tr3 = [4,9,25,49,121]\n", + "\tr4 = 256\n", + "\tsqrt = 10\n", + "\tf = λx·(x ∈ INTEGER∣x ∗ x)\n", + "\tr1 = 10000000000" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "f = %x.(x:INTEGER|x*x) &\n", "r1 = f(100000) &\n", @@ -3103,9 +3884,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 92, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\newcommand{\\cprod}{\\mathbin\\times}\\newcommand{\\cprod}{\\mathbin\\times}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r2} = \\{1,2,3,4\\}$\n", + "* $\\mathit{r3} = [2,2,3,3,4]$\n", + "* $\\mathit{r4} = 2$\n", + "* $\\mathit{r5} = \\{2,4,10,100\\}$\n", + "* $\\mathit{sqr} = 9802$\n", + "* $\\mathit{f} = \\{\\mathit{x},\\mathit{y}\\mid \\mathit{x} \\in \\mathit{NATURAL} \\land \\mathit{y} \\cprod 2 \\geq \\mathit{x} \\land (\\mathit{y} - 1) \\cprod 2 < \\mathit{x}\\}$\n", + "* $\\mathit{r1} = 317$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr2 = {1,2,3,4}\n", + "\tr3 = [2,2,3,3,4]\n", + "\tr4 = 2\n", + "\tr5 = {2,4,10,100}\n", + "\tsqr = 9802\n", + "\tf = {x,y∣x ∈ NATURAL ∧ y × 2 ≥ x ∧ (y − 1) × 2 < x}\n", + "\tr1 = 317" + ] + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "f = {x,y|x:NATURAL & y**2 >= x & (y-1)**2 <x } & // integer square root function\n", "r1 = f(100000) &\n", @@ -3134,9 +3947,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 93, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = 125$\n", + "* $\\mathit{ReifVar} = \\mathit{TRUE}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = 125\n", + "\tReifVar = TRUE" + ] + }, + "execution_count": 93, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "(x>100 <=> (ReifVar=TRUE)) & (x<125 <=> (ReifVar=FALSE)) & x<200" ] @@ -3174,9 +4009,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 94, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = \\{1,0\\}$\n", + "* $\\mathit{S} = \\{0\\}$\n", + "* $\\mathit{T} = \\{0\\}$\n", + "* $\\mathit{X} = 0$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tR = {1,0}\n", + "\tS = {0}\n", + "\tT = {0}\n", + "\tX = 0" + ] + }, + "execution_count": 94, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "1:R & 1/:S & R/\\S=T & T={X}" ] @@ -3202,9 +4063,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 95, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\renewcommand{\\emptyset}{\\mathord\\varnothing}\\{((4\\mapsto 4)\\mapsto\\{4\\}),((5\\mapsto 4)\\mapsto\\emptyset),((5\\mapsto 5)\\mapsto\\{5\\})\\}$" + ], + "text/plain": [ + "{((4↦4)↦{4}),((5↦4)↦∅),((5↦5)↦{5})}" + ] + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "{X,Y,R|X: 1..5 & Y: 4..10 & {X}/\\{Y}=R & X>=Y}" ] @@ -3226,9 +4101,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 96, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":eval: UNKNOWN (FALSE with enumeration warning)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:eval: UNKNOWN (FALSE with enumeration warning)\u001b[0m" + ] + } + ], "source": [ "A \\/ B = D & A /\\ C = {} & D=C & A /= {} & A:POW(STRING)" ] @@ -3247,28 +4131,65 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 97, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 97, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "A \\/ B = D & A /\\ C = {} & D=C & A /= {} & A:POW(BOOL)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 98, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 98, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":solve kodkod A \\/ B = D & A /\\ C = {} & D=C & A /= {} & A:POW(BOOL)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 99, "metadata": {}, - "outputs": [], - "source": [ + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], + "source": [ ":solve z3 A \\/ B = D & A /\\ C = {} & D=C & A /= {} & A:POW(BOOL)" ] }, @@ -3293,13 +4214,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 100, "metadata": { "slideshow": { "slide_type": "subslide" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.008830827 seconds" + ], + "text/plain": [ + "Execution time: 0.008830827 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{R} = \\{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tR = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200}" + ] + }, + "execution_count": 100, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time R= (1..200) \\ {50}" ] @@ -3313,16 +4266,16 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 101, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.005957963 seconds" + "Execution time: 0.017836851 seconds" ], "text/plain": [ - "Execution time: 0.005957963 seconds" + "Execution time: 0.017836851 seconds" ] }, "metadata": {}, @@ -3330,6 +4283,13 @@ }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{S} = \\{2,4,5,6,8,10\\}$\n", + "* $\\mathit{y} = 2$" + ], "text/plain": [ "TRUE\n", "\n", @@ -3338,7 +4298,7 @@ "\ty = 2" ] }, - "execution_count": 86, + "execution_count": 101, "metadata": {}, "output_type": "execute_result" } @@ -3349,11 +4309,18 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 102, "metadata": {}, "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{S} = \\{2,4,5,6,8,10\\}$\n", + "* $\\mathit{y} = 2$" + ], "text/plain": [ "TRUE\n", "\n", @@ -3362,7 +4329,7 @@ "\ty = 2" ] }, - "execution_count": 80, + "execution_count": 102, "metadata": {}, "output_type": "execute_result" } @@ -3445,45 +4412,113 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 103, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 x = 1..1000 /\\ (200..300)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 104, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 x = 1..40 /\\ (6..15)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 105, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 x = 1..60 /\\ (6..15)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 106, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 x = 1..80 /\\ (6..15)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 107, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.014306331 seconds" + ], + "text/plain": [ + "Execution time: 0.014306331 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{x} = (6 \\upto 15)$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tx = (6 ‥ 15)" + ] + }, + "execution_count": 107, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob x = 1..80 /\\ (6..15)" ] @@ -3501,18 +4536,53 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 108, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 s1 = {2,3,5,7,11} & s2 = {4,8,16,32} & c = s1*s2 & r=c~[{8}]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 109, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{2,3,5,7,11\\}$\n", + "* $\\mathit{c} = (\\{2,3,5,7,11\\} * \\{4,8,16,32\\})$\n", + "* $\\mathit{s1} = \\{2,3,5,7,11\\}$\n", + "* $\\mathit{s2} = \\{4,8,16,32\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr = {2,3,5,7,11}\n", + "\tc = ({2,3,5,7,11} ∗ {4,8,16,32})\n", + "\ts1 = {2,3,5,7,11}\n", + "\ts2 = {4,8,16,32}" + ] + }, + "execution_count": 109, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":solve prob s1 = {2,3,5,7,11} & s2 = {4,8,16,32} & c = s1*s2 & r=c~[{8}]" ] @@ -3531,27 +4601,80 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 110, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.027418161 seconds" + ], + "text/plain": [ + "Execution time: 0.027418161 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{f} = \\{(1\\mapsto 1),(2\\mapsto 2),(3\\mapsto 3),(4\\mapsto 4),(5\\mapsto 5),(6\\mapsto 6),(7\\mapsto 7),(8\\mapsto 8),(9\\mapsto 9),(10\\mapsto 10),(11\\mapsto 11),(12\\mapsto 12),(13\\mapsto 13),(14\\mapsto 14),(15\\mapsto 15),(16\\mapsto 16),(17\\mapsto 17),(18\\mapsto 18),(19\\mapsto 19),(20\\mapsto 20),(21\\mapsto 21),(22\\mapsto 22),(23\\mapsto 23),(24\\mapsto 24),(25\\mapsto 25),(26\\mapsto 26),(27\\mapsto 27),(28\\mapsto 28),(29\\mapsto 29),(30\\mapsto 30),(31\\mapsto 31),(32\\mapsto 32),(33\\mapsto 33),(34\\mapsto 34),(35\\mapsto 35),(36\\mapsto 36),(37\\mapsto 37),(38\\mapsto 38),(39\\mapsto 39),(40\\mapsto 40),(41\\mapsto 41),(42\\mapsto 42),(43\\mapsto 43),(44\\mapsto 44),(45\\mapsto 45),(46\\mapsto 46),(47\\mapsto 47),(48\\mapsto 48),(49\\mapsto 49),(50\\mapsto 50)\\}$\n", + "* $\\mathit{n} = 50$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tf = {(1↦1),(2↦2),(3↦3),(4↦4),(5↦5),(6↦6),(7↦7),(8↦8),(9↦9),(10↦10),(11↦11),(12↦12),(13↦13),(14↦14),(15↦15),(16↦16),(17↦17),(18↦18),(19↦19),(20↦20),(21↦21),(22↦22),(23↦23),(24↦24),(25↦25),(26↦26),(27↦27),(28↦28),(29↦29),(30↦30),(31↦31),(32↦32),(33↦33),(34↦34),(35↦35),(36↦36),(37↦37),(38↦38),(39↦39),(40↦40),(41↦41),(42↦42),(43↦43),(44↦44),(45↦45),(46↦46),(47↦47),(48↦48),(49↦49),(50↦50)}\n", + "\tn = 50" + ] + }, + "execution_count": 110, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob f: 1..n --> 1..n & !x.(x:2..n => f(x)=f(x-1)+1) & n=50" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 111, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "ProBError", + "evalue": "ProB reported Errors\nProB returned error messages:\nWarning: Kodkod SAT Solver Timeout for Problem Id: 8", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31mProB reported Errors\u001b[0m", + "\u001b[1m\u001b[31mWarning: Kodkod SAT Solver Timeout for Problem Id: 8\u001b[0m" + ] + } + ], "source": [ ":time :solve kodkod f: 1..n --> 1..n & !x.(x:2..n => f(x)=f(x-1)+1) & n=50" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 112, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 f: 1..n --> 1..n & !x.(x:2..n => f(x)=f(x-1)+1) & n=50" ] @@ -3571,36 +4694,95 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 113, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: time out", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: time out\u001b[0m" + ] + } + ], "source": [ ":time :solve prob r: 1..5 <-> 1..5 & (r;r) = r & r /= {} & dom(r)=1..5 & r[2..3]=3..4" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 114, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.084545001 seconds" + ], + "text/plain": [ + "Execution time: 0.084545001 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{(3\\mapsto 3),(3\\mapsto 4),(5\\mapsto 4),(1\\mapsto 4),(2\\mapsto 4),(4\\mapsto 4)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr = {(3↦3),(3↦4),(5↦4),(1↦4),(2↦4),(4↦4)}" + ] + }, + "execution_count": 114, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod r: 1..5 <-> 1..5 & (r;r) = r & r /= {} & dom(r)=1..5 & r[2..3]=3..4" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 115, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 r: 1..5 <-> 1..5 & (r;r) = r & r /= {} & dom(r)=1..5 & r[2..3]=3..4" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 116, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: time out", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: time out\u001b[0m" + ] + } + ], "source": [ ":time :solve prob r: 1..5 <-> 1..5 & (r;r) = r & r /= {} & dom(r)=1..5 & r[2..3]=3..4" ] @@ -3620,9 +4802,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 117, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "Loaded machine: GraphTheorem" + ] + }, + "execution_count": 117, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "::load\n", "MACHINE GraphTheorem\n", @@ -3633,9 +4826,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 118, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/latex": [ + "$\\mathit{edges} \\in \\mathit{NODES5} \\mathbin\\leftrightarrow \\mathit{NODES5} \\wedge \\mathit{edges}^{-1} = \\mathit{edges} \\wedge \\neg (\\exists (\\mathit{n1},\\mathit{n2})\\cdot (\\mathit{n1} \\in \\mathit{NODES5} \\wedge \\mathit{n2} \\in \\mathit{NODES5} \\wedge \\mathit{n2} \\neq \\mathit{n1} \\wedge \\mathit{card}(\\mathit{edges}[\\{\\mathit{n1}\\}]) = \\mathit{card}(\\mathit{edges}[\\{\\mathit{n2}\\}]))) \\wedge \\mathit{dom}(\\mathit{edges}) = \\mathit{NODES5} \\wedge id(\\mathit{NODES5}) \\cap \\mathit{edges} = \\emptyset $" + ], + "text/plain": [ + "edges ∈ NODES5 ↔ NODES5 ∧ edges⁻¹ = edges ∧ ¬(∃(n1,n2)·(n1 ∈ NODES5 ∧ n2 ∈ NODES5 ∧ n2 ≠ n1 ∧ card(edges[{n1}]) = card(edges[{n2}]))) ∧ dom(edges) = NODES5 ∧ id(NODES5) ∩ edges = ∅" + ] + }, + "execution_count": 118, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":prettyprint edges : NODES5 <-> NODES5 & \n", " edges~=edges &\n", @@ -3646,9 +4853,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 119, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: time out", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: time out\u001b[0m" + ] + } + ], "source": [ ":time :solve prob edges : NODES5 <-> NODES5 & \n", " edges~=edges &\n", @@ -3659,13 +4875,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 120, "metadata": { "slideshow": { "slide_type": "subslide" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 1.086896653 seconds" + ], + "text/plain": [ + "Execution time: 1.086896653 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 120, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod edges : NODES5 <-> NODES5 & \n", " edges~=edges &\n", @@ -3676,9 +4918,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 121, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 edges : NODES5 <-> NODES5 & \n", " edges~=edges &\n", @@ -3701,9 +4952,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 122, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.274634097 seconds" + ], + "text/plain": [ + "Execution time: 0.274634097 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{edges} = \\{(\\mathit{NODES51}\\mapsto \\mathit{NODES54}),(\\mathit{NODES52}\\mapsto \\mathit{NODES52}),(\\mathit{NODES52}\\mapsto \\mathit{NODES53}),(\\mathit{NODES52}\\mapsto \\mathit{NODES54}),(\\mathit{NODES53}\\mapsto \\mathit{NODES52}),(\\mathit{NODES53}\\mapsto \\mathit{NODES53}),(\\mathit{NODES53}\\mapsto \\mathit{NODES54}),(\\mathit{NODES53}\\mapsto \\mathit{NODES55}),(\\mathit{NODES54}\\mapsto \\mathit{NODES51}),(\\mathit{NODES54}\\mapsto \\mathit{NODES52}),(\\mathit{NODES54}\\mapsto \\mathit{NODES53}),(\\mathit{NODES54}\\mapsto \\mathit{NODES54}),(\\mathit{NODES54}\\mapsto \\mathit{NODES55}),(\\mathit{NODES55}\\mapsto \\mathit{NODES53}),(\\mathit{NODES55}\\mapsto \\mathit{NODES54})\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tedges = {(NODES51↦NODES54),(NODES52↦NODES52),(NODES52↦NODES53),(NODES52↦NODES54),(NODES53↦NODES52),(NODES53↦NODES53),(NODES53↦NODES54),(NODES53↦NODES55),(NODES54↦NODES51),(NODES54↦NODES52),(NODES54↦NODES53),(NODES54↦NODES54),(NODES54↦NODES55),(NODES55↦NODES53),(NODES55↦NODES54)}" + ] + }, + "execution_count": 122, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod edges : NODES5 <-> NODES5 & \n", " edges~=edges &\n", @@ -3714,9 +4997,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 123, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.136379966 seconds" + ], + "text/plain": [ + "Execution time: 0.136379966 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], + "text/plain": [ + "FALSE" + ] + }, + "execution_count": 123, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod edges : NODES5 <-> NODES5 & \n", " edges~=edges &\n", @@ -3740,9 +5049,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 124, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.111204369 seconds" + ], + "text/plain": [ + "Execution time: 0.111204369 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{queens} = \\{(1\\mapsto 4),(2\\mapsto 2),(3\\mapsto 7),(4\\mapsto 3),(5\\mapsto 6),(6\\mapsto 8),(7\\mapsto 5),(8\\mapsto 1)\\}$\n", + "* $\\mathit{n} = 8$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tqueens = {(1↦4),(2↦2),(3↦7),(4↦3),(5↦6),(6↦8),(7↦5),(8↦1)}\n", + "\tn = 8" + ] + }, + "execution_count": 124, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob n=8 &\n", " queens : 1..n >-> 1..n &\n", @@ -3751,9 +5094,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 125, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 n=8 &\n", " queens : 1..n >-> 1..n &\n", @@ -3762,9 +5114,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 126, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.775400724 seconds" + ], + "text/plain": [ + "Execution time: 0.775400724 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{queens} = \\{(3\\mapsto 2),(5\\mapsto 5),(6\\mapsto 1),(7\\mapsto 8),(1\\mapsto 3),(2\\mapsto 6),(4\\mapsto 7),(8\\mapsto 4)\\}$\n", + "* $\\mathit{n} = 8$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tqueens = {(3↦2),(5↦5),(6↦1),(7↦8),(1↦3),(2↦6),(4↦7),(8↦4)}\n", + "\tn = 8" + ] + }, + "execution_count": 126, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod n=8 &\n", " queens : 1..n >-> 1..n &\n", @@ -3784,9 +5170,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 127, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.077487479 seconds" + ], + "text/plain": [ + "Execution time: 0.077487479 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{bshp} = \\{(1\\mapsto 1),(1\\mapsto 2),(1\\mapsto 3)\\}$\n", + "* $\\mathit{n} = 3$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tbshp = {(1↦1),(1↦2),(1↦3)}\n", + "\tn = 3" + ] + }, + "execution_count": 127, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob n=3 & bshp <: (1..n)*(1..n) & \n", " !(i,j).({i,j}<:1..n => ( (i,j): bshp => (!k.(k:(i+1)..n => (k,j+k-i) /: bshp & (k,j-k+i) /: bshp )) )) &\n", @@ -3795,9 +5215,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 128, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 n=3 & bshp <: (1..n)*(1..n) & \n", " !(i,j).({i,j}<:1..n => ( (i,j): bshp => (!k.(k:(i+1)..n => (k,j+k-i) /: bshp & (k,j-k+i) /: bshp )) )) &\n", @@ -3813,9 +5242,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 129, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/latex": [ + "$\\mathit{n} = 3 \\wedge \\mathit{bshp} \\subseteq (1 .. \\mathit{n}) \\times (1 .. \\mathit{n}) \\wedge \\forall (\\mathit{i},\\mathit{j})\\cdot (\\{\\mathit{i},\\mathit{j}\\} \\subseteq 1 .. \\mathit{n} \\mathbin\\Rightarrow (\\mathit{i} \\mapsto \\mathit{j} \\in \\mathit{bshp} \\mathbin\\Rightarrow \\forall \\mathit{k}\\cdot (\\mathit{k} \\in \\mathit{i} + 1 .. \\mathit{n} \\mathbin\\Rightarrow (\\mathit{k} \\mapsto (\\mathit{j} + \\mathit{k}) - \\mathit{i}) \\not\\in \\mathit{bshp} \\wedge (\\mathit{k} \\mapsto (\\mathit{j} - \\mathit{k}) + \\mathit{i}) \\not\\in \\mathit{bshp}))) \\wedge \\mathit{card}(\\mathit{bshp}) = 3$" + ], + "text/plain": [ + "n = 3 ∧ bshp ⊆ (1 ‥ n) × (1 ‥ n) ∧ ∀(i,j)·({i,j} ⊆ 1 ‥ n ⇒ (i ↦ j ∈ bshp ⇒ ∀k·(k ∈ i + 1 ‥ n ⇒ (k ↦ (j + k) - i) ∉ bshp ∧ (k ↦ (j - k) + i) ∉ bshp))) ∧ card(bshp) = 3" + ] + }, + "execution_count": 129, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":prettyprint n=3 & bshp <: (1..n)*(1..n) & \n", " !(i,j).({i,j}<:1..n => ( (i,j): bshp => (!k.(k:(i+1)..n => (k,j+k-i) /: bshp & (k,j-k+i) /: bshp )) )) &\n", @@ -3835,18 +5278,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 130, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{(1\\mapsto 1),(1\\mapsto 2),(1\\mapsto 3),(2\\mapsto 1),(2\\mapsto 2),(2\\mapsto 3)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr = {(1↦1),(1↦2),(1↦3),(2↦1),(2↦2),(2↦3)}" + ] + }, + "execution_count": 130, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "!x.(x:1..2 => !y.(y:1..3 => (x,y):r)) " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 131, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 !x.(x:1..2 => !y.(y:1..3 => (x,y):r)) " ] @@ -3860,27 +5332,100 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 132, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":solve z3 !x.(x:1..2 => !y.(y:1..3 => (x,y):r)) & r<: (1..10)*(1..10)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 133, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.072570735 seconds" + ], + "text/plain": [ + "Execution time: 0.072570735 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{(1\\mapsto 3),(1\\mapsto 1),(1\\mapsto 2),(2\\mapsto 3),(2\\mapsto 1),(2\\mapsto 2)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr = {(1↦3),(1↦1),(1↦2),(2↦3),(2↦1),(2↦2)}" + ] + }, + "execution_count": 133, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod !x.(x:1..2 => !y.(y:1..3 => (x,y):r)) & r<: (1..10)*(1..10)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 134, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.012767386 seconds" + ], + "text/plain": [ + "Execution time: 0.012767386 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{r} = \\{(1\\mapsto 1),(1\\mapsto 2),(1\\mapsto 3),(2\\mapsto 1),(2\\mapsto 2),(2\\mapsto 3)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tr = {(1↦1),(1↦2),(1↦3),(2↦1),(2↦2),(2↦3)}" + ] + }, + "execution_count": 134, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob !x.(x:1..2 => !y.(y:1..3 => (x,y):r)) & r<: (1..10)*(1..10)" ] @@ -3898,9 +5443,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 135, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "Loaded machine: signals" + ] + }, + "execution_count": 135, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "::load\n", "MACHINE\n", @@ -3935,9 +5491,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 136, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.352645207 seconds" + ], + "text/plain": [ + "Execution time: 0.352645207 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{res} = \\{\\mathit{PL01},\\mathit{PL12}\\}$\n", + "* $\\mathit{nxt} = \\{(\\mathit{PL01}\\mapsto \\mathit{PL02}),(\\mathit{PL02}\\mapsto \\mathit{PL03}),(\\mathit{PL03}\\mapsto \\mathit{PL04}),(\\mathit{PL04}\\mapsto \\mathit{PL05}),(\\mathit{PL05}\\mapsto \\mathit{PL06}),(\\mathit{PL06}\\mapsto \\mathit{PL07}),(\\mathit{PL07}\\mapsto \\mathit{PL08}),(\\mathit{PL08}\\mapsto \\mathit{PL09}),(\\mathit{PL09}\\mapsto \\mathit{PL10}),(\\mathit{PL10}\\mapsto \\mathit{PL11}),(\\mathit{PL11}\\mapsto \\mathit{PL11}),(\\mathit{PL12}\\mapsto \\mathit{PL13}),(\\mathit{PL13}\\mapsto \\mathit{PL14}),(\\mathit{PL14}\\mapsto \\mathit{PL15}),(\\mathit{PL15}\\mapsto \\mathit{PL16}),(\\mathit{PL16}\\mapsto \\mathit{PL17}),(\\mathit{PL17}\\mapsto \\mathit{PL18}),(\\mathit{PL18}\\mapsto \\mathit{PL19}),(\\mathit{PL19}\\mapsto \\mathit{PL20}),(\\mathit{PL20}\\mapsto \\mathit{PL20})\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tres = {PL01,PL12}\n", + "\tnxt = {(PL01↦PL02),(PL02↦PL03),(PL03↦PL04),(PL04↦PL05),(PL05↦PL06),(PL06↦PL07),(PL07↦PL08),(PL08↦PL09),(PL09↦PL10),(PL10↦PL11),(PL11↦PL11),(PL12↦PL13),(PL13↦PL14),(PL14↦PL15),(PL15↦PL16),(PL16↦PL17),(PL17↦PL18),(PL18↦PL19),(PL19↦PL20),(PL20↦PL20)}" + ] + }, + "execution_count": 136, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob nxt = \n", " {PL01 |-> PL02, PL02 |-> PL03, PL03 |-> PL04, PL04 |-> PL05,\n", @@ -3950,9 +5540,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 137, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "CommandExecutionException", + "evalue": ":time: :solve: Computation not completed: no solution found (but one might exist)", + "output_type": "error", + "traceback": [ + "\u001b[1m\u001b[31m:time: :solve: Computation not completed: no solution found (but one might exist)\u001b[0m" + ] + } + ], "source": [ ":time :solve z3 nxt = \n", " {PL01 |-> PL02, PL02 |-> PL03, PL03 |-> PL04, PL04 |-> PL05,\n", @@ -3965,9 +5564,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 138, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 1.266580290 seconds" + ], + "text/plain": [ + "Execution time: 1.266580290 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{res} = \\{\\mathit{PL01},\\mathit{PL12}\\}$\n", + "* $\\mathit{nxt} = \\{(\\mathit{PL01}\\mapsto \\mathit{PL02}),(\\mathit{PL02}\\mapsto \\mathit{PL03}),(\\mathit{PL03}\\mapsto \\mathit{PL04}),(\\mathit{PL04}\\mapsto \\mathit{PL05}),(\\mathit{PL05}\\mapsto \\mathit{PL06}),(\\mathit{PL06}\\mapsto \\mathit{PL07}),(\\mathit{PL07}\\mapsto \\mathit{PL08}),(\\mathit{PL08}\\mapsto \\mathit{PL09}),(\\mathit{PL09}\\mapsto \\mathit{PL10}),(\\mathit{PL10}\\mapsto \\mathit{PL11}),(\\mathit{PL11}\\mapsto \\mathit{PL11}),(\\mathit{PL12}\\mapsto \\mathit{PL13}),(\\mathit{PL13}\\mapsto \\mathit{PL14}),(\\mathit{PL14}\\mapsto \\mathit{PL15}),(\\mathit{PL15}\\mapsto \\mathit{PL16}),(\\mathit{PL16}\\mapsto \\mathit{PL17}),(\\mathit{PL17}\\mapsto \\mathit{PL18}),(\\mathit{PL18}\\mapsto \\mathit{PL19}),(\\mathit{PL19}\\mapsto \\mathit{PL20}),(\\mathit{PL20}\\mapsto \\mathit{PL20})\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tres = {PL01,PL12}\n", + "\tnxt = {(PL01↦PL02),(PL02↦PL03),(PL03↦PL04),(PL04↦PL05),(PL05↦PL06),(PL06↦PL07),(PL07↦PL08),(PL08↦PL09),(PL09↦PL10),(PL10↦PL11),(PL11↦PL11),(PL12↦PL13),(PL13↦PL14),(PL14↦PL15),(PL15↦PL16),(PL16↦PL17),(PL17↦PL18),(PL18↦PL19),(PL19↦PL20),(PL20↦PL20)}" + ] + }, + "execution_count": 138, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod nxt = \n", " {PL01 |-> PL02, PL02 |-> PL03, PL03 |-> PL04, PL04 |-> PL05,\n", @@ -3980,9 +5613,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 139, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "Loaded machine: signals" + ] + }, + "execution_count": 139, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "::load\n", "MACHINE\n", @@ -4037,9 +5681,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 140, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.543225271 seconds" + ], + "text/plain": [ + "Execution time: 0.543225271 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{cl1} = \\#197\\in\\{(\\mathit{PL01}\\mapsto \\mathit{PL02}),(\\mathit{PL01}\\mapsto \\mathit{PL03}),\\ldots,(\\mathit{PL33}\\mapsto \\mathit{PL35}),(\\mathit{PL34}\\mapsto \\mathit{PL35})\\}$\n", + "* $\\mathit{mx} = \\{\\mathit{PL01}\\}$\n", + "* $\\mathit{nxt} = \\{(\\mathit{PL01}\\mapsto \\mathit{PL02}),(\\mathit{PL02}\\mapsto \\mathit{PL03}),(\\mathit{PL03}\\mapsto \\mathit{PL04}),(\\mathit{PL04}\\mapsto \\mathit{PL05}),(\\mathit{PL05}\\mapsto \\mathit{PL06}),(\\mathit{PL06}\\mapsto \\mathit{PL07}),(\\mathit{PL07}\\mapsto \\mathit{PL08}),(\\mathit{PL08}\\mapsto \\mathit{PL09}),(\\mathit{PL09}\\mapsto \\mathit{PL10}),(\\mathit{PL10}\\mapsto \\mathit{PL11}),(\\mathit{PL11}\\mapsto \\mathit{PL12}),(\\mathit{PL12}\\mapsto \\mathit{PL13}),(\\mathit{PL13}\\mapsto \\mathit{PL14}),(\\mathit{PL14}\\mapsto \\mathit{PL15}),(\\mathit{PL15}\\mapsto \\mathit{PL16}),(\\mathit{PL16}\\mapsto \\mathit{PL17}),(\\mathit{PL17}\\mapsto \\mathit{PL18}),(\\mathit{PL18}\\mapsto \\mathit{PL19}),(\\mathit{PL19}\\mapsto \\mathit{PL20}),(\\mathit{PL20}\\mapsto \\mathit{PL20}),(\\mathit{PL30}\\mapsto \\mathit{PL31}),(\\mathit{PL31}\\mapsto \\mathit{PL32}),(\\mathit{PL33}\\mapsto \\mathit{PL34}),(\\mathit{PL34}\\mapsto \\mathit{PL35})\\}$\n", + "* $\\mathit{nrs} = \\{(\\mathit{PL01}\\mapsto 19),(\\mathit{PL02}\\mapsto 18),(\\mathit{PL03}\\mapsto 17),(\\mathit{PL04}\\mapsto 16),(\\mathit{PL05}\\mapsto 15),(\\mathit{PL06}\\mapsto 14),(\\mathit{PL07}\\mapsto 13),(\\mathit{PL08}\\mapsto 12),(\\mathit{PL09}\\mapsto 11),(\\mathit{PL10}\\mapsto 10),(\\mathit{PL11}\\mapsto 9),(\\mathit{PL12}\\mapsto 8),(\\mathit{PL13}\\mapsto 7),(\\mathit{PL14}\\mapsto 6),(\\mathit{PL15}\\mapsto 5),(\\mathit{PL16}\\mapsto 4),(\\mathit{PL17}\\mapsto 3),(\\mathit{PL18}\\mapsto 2),(\\mathit{PL19}\\mapsto 1),(\\mathit{PL20}\\mapsto 1),(\\mathit{PL21}\\mapsto 0),(\\mathit{PL22}\\mapsto 0),(\\mathit{PL23}\\mapsto 0),(\\mathit{PL24}\\mapsto 0),(\\mathit{PL25}\\mapsto 0),(\\mathit{PL26}\\mapsto 0),(\\mathit{PL27}\\mapsto 0),(\\mathit{PL28}\\mapsto 0),(\\mathit{PL29}\\mapsto 0),(\\mathit{PL30}\\mapsto 2),(\\mathit{PL31}\\mapsto 1),(\\mathit{PL32}\\mapsto 0),(\\mathit{PL33}\\mapsto 2),(\\mathit{PL34}\\mapsto 1),(\\mathit{PL35}\\mapsto 0),(\\mathit{PL36}\\mapsto 0),(\\mathit{PL37}\\mapsto 0),(\\mathit{PL38}\\mapsto 0),(\\mathit{PL39}\\mapsto 0),(\\mathit{PL40}\\mapsto 0)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tcl1 = #197∈{(PL01↦PL02),(PL01↦PL03),…,(PL33↦PL35),(PL34↦PL35)}\n", + "\tmx = {PL01}\n", + "\tnxt = {(PL01↦PL02),(PL02↦PL03),(PL03↦PL04),(PL04↦PL05),(PL05↦PL06),(PL06↦PL07),(PL07↦PL08),(PL08↦PL09),(PL09↦PL10),(PL10↦PL11),(PL11↦PL12),(PL12↦PL13),(PL13↦PL14),(PL14↦PL15),(PL15↦PL16),(PL16↦PL17),(PL17↦PL18),(PL18↦PL19),(PL19↦PL20),(PL20↦PL20),(PL30↦PL31),(PL31↦PL32),(PL33↦PL34),(PL34↦PL35)}\n", + "\tnrs = {(PL01↦19),(PL02↦18),(PL03↦17),(PL04↦16),(PL05↦15),(PL06↦14),(PL07↦13),(PL08↦12),(PL09↦11),(PL10↦10),(PL11↦9),(PL12↦8),(PL13↦7),(PL14↦6),(PL15↦5),(PL16↦4),(PL17↦3),(PL18↦2),(PL19↦1),(PL20↦1),(PL21↦0),(PL22↦0),(PL23↦0),(PL24↦0),(PL25↦0),(PL26↦0),(PL27↦0),(PL28↦0),(PL29↦0),(PL30↦2),(PL31↦1),(PL32↦0),(PL33↦2),(PL34↦1),(PL35↦0),(PL36↦0),(PL37↦0),(PL38↦0),(PL39↦0),(PL40↦0)}" + ] + }, + "execution_count": 140, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve kodkod nxt = \n", " {PL01 |-> PL02, PL02 |-> PL03, PL03 |-> PL04, PL04 |-> PL05,\n", @@ -4055,9 +5737,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 141, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.058528192 seconds" + ], + "text/plain": [ + "Execution time: 0.058528192 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{cl1} = \\#197\\in\\{(\\mathit{PL01}\\mapsto \\mathit{PL02}),(\\mathit{PL01}\\mapsto \\mathit{PL03}),\\ldots,(\\mathit{PL33}\\mapsto \\mathit{PL35}),(\\mathit{PL34}\\mapsto \\mathit{PL35})\\}$\n", + "* $\\mathit{mx} = \\{\\mathit{PL01}\\}$\n", + "* $\\mathit{nxt} = \\{(\\mathit{PL01}\\mapsto \\mathit{PL02}),(\\mathit{PL02}\\mapsto \\mathit{PL03}),(\\mathit{PL03}\\mapsto \\mathit{PL04}),(\\mathit{PL04}\\mapsto \\mathit{PL05}),(\\mathit{PL05}\\mapsto \\mathit{PL06}),(\\mathit{PL06}\\mapsto \\mathit{PL07}),(\\mathit{PL07}\\mapsto \\mathit{PL08}),(\\mathit{PL08}\\mapsto \\mathit{PL09}),(\\mathit{PL09}\\mapsto \\mathit{PL10}),(\\mathit{PL10}\\mapsto \\mathit{PL11}),(\\mathit{PL11}\\mapsto \\mathit{PL12}),(\\mathit{PL12}\\mapsto \\mathit{PL13}),(\\mathit{PL13}\\mapsto \\mathit{PL14}),(\\mathit{PL14}\\mapsto \\mathit{PL15}),(\\mathit{PL15}\\mapsto \\mathit{PL16}),(\\mathit{PL16}\\mapsto \\mathit{PL17}),(\\mathit{PL17}\\mapsto \\mathit{PL18}),(\\mathit{PL18}\\mapsto \\mathit{PL19}),(\\mathit{PL19}\\mapsto \\mathit{PL20}),(\\mathit{PL20}\\mapsto \\mathit{PL20}),(\\mathit{PL30}\\mapsto \\mathit{PL31}),(\\mathit{PL31}\\mapsto \\mathit{PL32}),(\\mathit{PL33}\\mapsto \\mathit{PL34}),(\\mathit{PL34}\\mapsto \\mathit{PL35})\\}$\n", + "* $\\mathit{nrs} = \\{(\\mathit{PL01}\\mapsto 19),(\\mathit{PL02}\\mapsto 18),(\\mathit{PL03}\\mapsto 17),(\\mathit{PL04}\\mapsto 16),(\\mathit{PL05}\\mapsto 15),(\\mathit{PL06}\\mapsto 14),(\\mathit{PL07}\\mapsto 13),(\\mathit{PL08}\\mapsto 12),(\\mathit{PL09}\\mapsto 11),(\\mathit{PL10}\\mapsto 10),(\\mathit{PL11}\\mapsto 9),(\\mathit{PL12}\\mapsto 8),(\\mathit{PL13}\\mapsto 7),(\\mathit{PL14}\\mapsto 6),(\\mathit{PL15}\\mapsto 5),(\\mathit{PL16}\\mapsto 4),(\\mathit{PL17}\\mapsto 3),(\\mathit{PL18}\\mapsto 2),(\\mathit{PL19}\\mapsto 1),(\\mathit{PL20}\\mapsto 1),(\\mathit{PL21}\\mapsto 0),(\\mathit{PL22}\\mapsto 0),(\\mathit{PL23}\\mapsto 0),(\\mathit{PL24}\\mapsto 0),(\\mathit{PL25}\\mapsto 0),(\\mathit{PL26}\\mapsto 0),(\\mathit{PL27}\\mapsto 0),(\\mathit{PL28}\\mapsto 0),(\\mathit{PL29}\\mapsto 0),(\\mathit{PL30}\\mapsto 2),(\\mathit{PL31}\\mapsto 1),(\\mathit{PL32}\\mapsto 0),(\\mathit{PL33}\\mapsto 2),(\\mathit{PL34}\\mapsto 1),(\\mathit{PL35}\\mapsto 0),(\\mathit{PL36}\\mapsto 0),(\\mathit{PL37}\\mapsto 0),(\\mathit{PL38}\\mapsto 0),(\\mathit{PL39}\\mapsto 0),(\\mathit{PL40}\\mapsto 0)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tcl1 = #197∈{(PL01↦PL02),(PL01↦PL03),…,(PL33↦PL35),(PL34↦PL35)}\n", + "\tmx = {PL01}\n", + "\tnxt = {(PL01↦PL02),(PL02↦PL03),(PL03↦PL04),(PL04↦PL05),(PL05↦PL06),(PL06↦PL07),(PL07↦PL08),(PL08↦PL09),(PL09↦PL10),(PL10↦PL11),(PL11↦PL12),(PL12↦PL13),(PL13↦PL14),(PL14↦PL15),(PL15↦PL16),(PL16↦PL17),(PL17↦PL18),(PL18↦PL19),(PL19↦PL20),(PL20↦PL20),(PL30↦PL31),(PL31↦PL32),(PL33↦PL34),(PL34↦PL35)}\n", + "\tnrs = {(PL01↦19),(PL02↦18),(PL03↦17),(PL04↦16),(PL05↦15),(PL06↦14),(PL07↦13),(PL08↦12),(PL09↦11),(PL10↦10),(PL11↦9),(PL12↦8),(PL13↦7),(PL14↦6),(PL15↦5),(PL16↦4),(PL17↦3),(PL18↦2),(PL19↦1),(PL20↦1),(PL21↦0),(PL22↦0),(PL23↦0),(PL24↦0),(PL25↦0),(PL26↦0),(PL27↦0),(PL28↦0),(PL29↦0),(PL30↦2),(PL31↦1),(PL32↦0),(PL33↦2),(PL34↦1),(PL35↦0),(PL36↦0),(PL37↦0),(PL38↦0),(PL39↦0),(PL40↦0)}" + ] + }, + "execution_count": 141, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob nxt = \n", " {PL01 |-> PL02, PL02 |-> PL03, PL03 |-> PL04, PL04 |-> PL05,\n", @@ -4073,9 +5793,72 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 142, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "|prj1|prj2|\n", + "|---|---|\n", + "|$\\mathit{PL01}$|$\\mathit{PL02}$|\n", + "|$\\mathit{PL02}$|$\\mathit{PL03}$|\n", + "|$\\mathit{PL03}$|$\\mathit{PL04}$|\n", + "|$\\mathit{PL04}$|$\\mathit{PL05}$|\n", + "|$\\mathit{PL05}$|$\\mathit{PL06}$|\n", + "|$\\mathit{PL06}$|$\\mathit{PL07}$|\n", + "|$\\mathit{PL07}$|$\\mathit{PL08}$|\n", + "|$\\mathit{PL08}$|$\\mathit{PL09}$|\n", + "|$\\mathit{PL09}$|$\\mathit{PL10}$|\n", + "|$\\mathit{PL10}$|$\\mathit{PL11}$|\n", + "|$\\mathit{PL11}$|$\\mathit{PL12}$|\n", + "|$\\mathit{PL12}$|$\\mathit{PL13}$|\n", + "|$\\mathit{PL13}$|$\\mathit{PL14}$|\n", + "|$\\mathit{PL14}$|$\\mathit{PL15}$|\n", + "|$\\mathit{PL15}$|$\\mathit{PL16}$|\n", + "|$\\mathit{PL16}$|$\\mathit{PL17}$|\n", + "|$\\mathit{PL17}$|$\\mathit{PL18}$|\n", + "|$\\mathit{PL18}$|$\\mathit{PL19}$|\n", + "|$\\mathit{PL19}$|$\\mathit{PL20}$|\n", + "|$\\mathit{PL20}$|$\\mathit{PL20}$|\n", + "|$\\mathit{PL30}$|$\\mathit{PL31}$|\n", + "|$\\mathit{PL31}$|$\\mathit{PL32}$|\n", + "|$\\mathit{PL33}$|$\\mathit{PL34}$|\n", + "|$\\mathit{PL34}$|$\\mathit{PL35}$|\n" + ], + "text/plain": [ + "prj1\tprj2\n", + "PL01\tPL02\n", + "PL02\tPL03\n", + "PL03\tPL04\n", + "PL04\tPL05\n", + "PL05\tPL06\n", + "PL06\tPL07\n", + "PL07\tPL08\n", + "PL08\tPL09\n", + "PL09\tPL10\n", + "PL10\tPL11\n", + "PL11\tPL12\n", + "PL12\tPL13\n", + "PL13\tPL14\n", + "PL14\tPL15\n", + "PL15\tPL16\n", + "PL16\tPL17\n", + "PL17\tPL18\n", + "PL18\tPL19\n", + "PL19\tPL20\n", + "PL20\tPL20\n", + "PL30\tPL31\n", + "PL31\tPL32\n", + "PL33\tPL34\n", + "PL34\tPL35\n" + ] + }, + "execution_count": 142, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":table {PL01 |-> PL02, PL02 |-> PL03, PL03 |-> PL04, PL04 |-> PL05,\n", " PL05 |-> PL06, PL06 |-> PL07, PL07 |-> PL08, PL08 |-> PL09,\n", @@ -4087,13 +5870,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 143, "metadata": { "slideshow": { "slide_type": "subslide" } }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "Loaded machine: SlotSolver_KodkodTest" + ] + }, + "execution_count": 143, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "::load\n", "MACHINE SlotSolver_KodkodTest\n", @@ -4107,9 +5901,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 144, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Execution time: 0.550161868 seconds" + ], + "text/plain": [ + "Execution time: 0.550161868 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{cs} = \\{\\mathit{kom},\\mathit{lin},\\mathit{pol},\\mathit{rom}\\}$\n", + "* $\\mathit{mapping} = \\#235\\in\\{(((\\mathit{ang}\\mapsto 1)\\mapsto \\mathit{T\\_KF})\\mapsto 1),(((\\mathit{ang}\\mapsto 1)\\mapsto \\mathit{T\\_KF})\\mapsto 5),\\ldots,(((\\mathit{soz}\\mapsto 2)\\mapsto \\mathit{T\\_EF})\\mapsto 156),(((\\mathit{soz}\\mapsto 2)\\mapsto \\mathit{T\\_EF})\\mapsto 158)\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tcs = {kom,lin,pol,rom}\n", + "\tmapping = #235∈{(((ang↦1)↦T_KF)↦1),(((ang↦1)↦T_KF)↦5),…,(((soz↦2)↦T_EF)↦156),(((soz↦2)↦T_EF)↦158)}" + ] + }, + "execution_count": 144, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ ":time :solve prob mapping = {\n", " (lin, 1, T_EF, 102),\n", @@ -4353,36 +6181,41 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 145, "metadata": {}, "outputs": [ { - "ename": "CliError", - "evalue": "Error during communication with Prolog core.", - "output_type": "error", - "traceback": [ - "\u001b[1m\u001b[31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1m\u001b[31mde.prob.exception.CliError: Error during communication with Prolog core.\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.cli.ProBInstance.send(ProBInstance.java:78)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.animator.CommandProcessor.sendCommand(CommandProcessor.java:48)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.animator.AnimatorImpl.execute(AnimatorImpl.java:68)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.execute(StateSpace.java:549)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.SolveCommand.run(SolveCommand.java:76)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:109)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:124)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.TimeCommand.run(TimeCommand.java:32)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:109)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:124)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$0(ShellChannel.java:50)\u001b[0m", - "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:39)\u001b[0m", - "\u001b[1m\u001b[31mCaused by: java.io.IOException: ProB binary returned nothing - it might have crashed\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.cli.ProBConnection.getAnswer(ProBConnection.java:75)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.cli.ProBConnection.send(ProBConnection.java:62)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob.cli.ProBInstance.send(ProBInstance.java:76)\u001b[0m", - "\u001b[1m\u001b[31m\t... 13 more\u001b[0m" - ] + "data": { + "text/markdown": [ + "Execution time: 12.114749666 seconds" + ], + "text/plain": [ + "Execution time: 12.114749666 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{res} = \\{802\\}$\n", + "* $\\mathit{f} = \\{(3\\mapsto 4),(5\\mapsto 6),(7\\mapsto 8),(9\\mapsto 10),(11\\mapsto 12),(13\\mapsto 14),(15\\mapsto 16),(17\\mapsto 18),(19\\mapsto 20),(21\\mapsto 22),(23\\mapsto 24),(25\\mapsto 26),(27\\mapsto 28),(29\\mapsto 30),(31\\mapsto 32),(33\\mapsto 34),(35\\mapsto 36),(37\\mapsto 38),(39\\mapsto 40),(41\\mapsto 42),(43\\mapsto 44),(45\\mapsto 46),(47\\mapsto 48),(49\\mapsto 50),(51\\mapsto 52),(53\\mapsto 54),(55\\mapsto 56),(57\\mapsto 58),(59\\mapsto 60),(61\\mapsto 62),(63\\mapsto 64),(65\\mapsto 66),(67\\mapsto 68),(69\\mapsto 70),(71\\mapsto 72),(73\\mapsto 74),(75\\mapsto 76),(77\\mapsto 78),(79\\mapsto 80),(81\\mapsto 82),(83\\mapsto 84),(85\\mapsto 86),(87\\mapsto 88),(89\\mapsto 90),(91\\mapsto 92),(93\\mapsto 94),(95\\mapsto 96),(97\\mapsto 98),(99\\mapsto 100),(101\\mapsto 102),(103\\mapsto 104),(105\\mapsto 106),(107\\mapsto 108),(109\\mapsto 110),(111\\mapsto 112),(113\\mapsto 114),(115\\mapsto 116),(117\\mapsto 118),(119\\mapsto 120),(121\\mapsto 122),(123\\mapsto 124),(125\\mapsto 126),(127\\mapsto 128),(129\\mapsto 130),(131\\mapsto 132),(133\\mapsto 134),(135\\mapsto 136),(137\\mapsto 138),(139\\mapsto 140),(141\\mapsto 142),(143\\mapsto 144),(145\\mapsto 146),(147\\mapsto 148),(149\\mapsto 150),(151\\mapsto 152),(153\\mapsto 154),(155\\mapsto 156),(157\\mapsto 158),(159\\mapsto 160),(161\\mapsto 162),(163\\mapsto 164),(165\\mapsto 166),(167\\mapsto 168),(169\\mapsto 170),(171\\mapsto 172),(173\\mapsto 174),(175\\mapsto 176),(177\\mapsto 178),(179\\mapsto 180),(181\\mapsto 182),(183\\mapsto 184),(185\\mapsto 186),(187\\mapsto 188),(189\\mapsto 190),(191\\mapsto 192),(193\\mapsto 194),(195\\mapsto 196),(197\\mapsto 198),(199\\mapsto 200),(201\\mapsto 202),\\ldots\\}$" + ], + "text/plain": [ + "TRUE\n", + "\n", + "Solution:\n", + "\tres = {802}\n", + "\tf = {(3↦4),(5↦6),(7↦8),(9↦10),(11↦12),(13↦14),(15↦16),(17↦18),(19↦20),(21↦22),(23↦24),(25↦26),(27↦28),(29↦30),(31↦32),(33↦34),(35↦36),(37↦38),(39↦40),(41↦42),(43↦44),(45↦46),(47↦48),(49↦50),(51↦52),(53↦54),(55↦56),(57↦58),(59↦60),(61↦62),(63↦64),(65↦66),(67↦68),(69↦70),(71↦72),(73↦74),(75↦76),(77↦78),(79↦80),(81↦82),(83↦84),(85↦86),(87↦88),(89↦90),(91↦92),(93↦94),(95↦96),(97↦98),(99↦100),(101↦102),(103↦104),(105↦106),(107↦108),(109↦110),(111↦112),(113↦114),(115↦116),(117↦118),(119↦120),(121↦122),(123↦124),(125↦126),(127↦128),(129↦130),(131↦132),(133↦134),(135↦136),(137↦138),(139↦140),(141↦142),(143↦144),(145↦146),(147↦148),(149↦150),(151↦152),(153↦154),(155↦156),(157↦158),(159↦160),(161↦162),(163↦164),(165↦166),(167↦168),(169↦170),(171↦172),(173↦174),(175↦176),(177↦178),(179↦180),(181↦182),(183↦184),(185↦186),(187↦188),(189↦190),(191↦192),(193↦194),(195↦196),(197↦198),(199↦200),(201↦202),…}" + ] + }, + "execution_count": 145, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -4398,16 +6231,16 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 146, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 0.053545046 seconds" + "Execution time: 0.162360296 seconds" ], "text/plain": [ - "Execution time: 0.053545046 seconds" + "Execution time: 0.162360296 seconds" ] }, "metadata": {}, @@ -4415,15 +6248,22 @@ }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{res} = \\{802\\}$\n", + "* $\\mathit{f} = \\#1000\\in\\{(1\\mapsto 2),(3\\mapsto 4),\\ldots,(1997\\mapsto 1998),(1999\\mapsto 2000)\\}$" + ], "text/plain": [ "TRUE\n", "\n", "Solution:\n", "\tres = {802}\n", - "\tf = ∃1000∈{(1↦2),(3↦4),…,(1997↦1998),(1999↦2000)}" + "\tf = #1000∈{(1↦2),(3↦4),…,(1997↦1998),(1999↦2000)}" ] }, - "execution_count": 99, + "execution_count": 146, "metadata": {}, "output_type": "execute_result" } @@ -4431,13 +6271,6 @@ "source": [ ":time :solve prob f = %x.(x:1..2000 & x mod 2 = 1|x+1) & f[800..802] = res" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -4448,8 +6281,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/presentations/SlotSolverKodkodTest2.ipynb b/notebooks/presentations/SlotSolverKodkodTest2.ipynb index 36b063d0895192ede2acf08b35a094bf2cb380d6..7fec2ec793dc5ebc0f7e6388af3e66023c408f16 100644 --- a/notebooks/presentations/SlotSolverKodkodTest2.ipynb +++ b/notebooks/presentations/SlotSolverKodkodTest2.ipynb @@ -12,21 +12,10 @@ "execution_count": 1, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-04 13:25:20,918, T+55460] \"Shell-0\" de.prob.cli.PrologProcessProvider.makeProcess(PrologProcessProvider.java:64): [INFO] Starting ProB's Prolog Core. Path is /Users/leuschel/git_root/prob_prolog/probcli.sh\n", - "[2018-06-04 13:25:22,045, T+56587] \"Shell-0\" de.prob.cli.PortPattern.setValue(PortPattern.java:30): [INFO] Server has started and listens on port 59788\n", - "[2018-06-04 13:25:22,045, T+56587] \"Shell-0\" de.prob.cli.InterruptRefPattern.setValue(InterruptRefPattern.java:29): [INFO] Server can receive user interrupts via reference 46681\n", - "[2018-06-04 13:25:22,048, T+56590] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] -- starting command loop --\u001b[0m\n", - "[2018-06-04 13:25:22,066, T+56608] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Connected: 127.0.0.1\u001b[0m\n" - ] - }, { "data": { "text/plain": [ - "Loaded machine: MAIN_MACHINE_FOR_WiWiSolver : []\n" + "Loaded machine: MAIN_MACHINE_FOR_WiWiSolver" ] }, "execution_count": 1, @@ -64,40 +53,31 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2018-06-04 13:27:22,528, T+177070] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] kodkod.engine.CapacityExceededException: Arity too large (7) for a universe of size 309\u001b[0m\n", - "[2018-06-04 13:27:22,529, T+177071] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat kodkod.instance.TupleFactory.checkCapacity(TupleFactory.java:266)\u001b[0m\n", - "[2018-06-04 13:27:22,530, T+177072] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat kodkod.instance.TupleFactory$IntTuple.<init>(TupleFactory.java:325)\u001b[0m\n", - "[2018-06-04 13:27:22,531, T+177073] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat kodkod.instance.TupleFactory.tuple(TupleFactory.java:88)\u001b[0m\n", - "[2018-06-04 13:27:22,533, T+177075] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.types.TupleType.createAllTuples(TupleType.java:93)\u001b[0m\n", - "[2018-06-04 13:27:22,534, T+177076] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.KodkodAnalysis.extractTupleSet(KodkodAnalysis.java:708)\u001b[0m\n", - "[2018-06-04 13:27:22,535, T+177077] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.KodkodAnalysis.addRelations(KodkodAnalysis.java:657)\u001b[0m\n", - "[2018-06-04 13:27:22,535, T+177077] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.KodkodAnalysis.caseAProblem(KodkodAnalysis.java:238)\u001b[0m\n", - "[2018-06-04 13:27:22,536, T+177078] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.parser.node.AProblem.apply(AProblem.java:90)\u001b[0m\n", - "[2018-06-04 13:27:22,536, T+177078] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.parser.analysis.DepthFirstAdapter.caseAProblemAction(DepthFirstAdapter.java:58)\u001b[0m\n", - "[2018-06-04 13:27:22,537, T+177079] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.parser.node.AProblemAction.apply(AProblemAction.java:34)\u001b[0m\n", - "[2018-06-04 13:27:22,537, T+177079] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.parser.analysis.DepthFirstAdapter.caseStart(DepthFirstAdapter.java:37)\u001b[0m\n", - "[2018-06-04 13:27:22,544, T+177086] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.parser.node.Start.apply(Start.java:35)\u001b[0m\n", - "[2018-06-04 13:27:22,544, T+177086] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.KodkodInteraction.interaction(KodkodInteraction.java:56)\u001b[0m\n", - "[2018-06-04 13:27:22,546, T+177088] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] \tat de.stups.probkodkod.KodkodInteraction.main(KodkodInteraction.java:97)\u001b[0m\n", - "[2018-06-04 13:27:22,625, T+177167] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] kodkod ok: bu = {b,u|#(n,bb,P,n1,n2).(b |-> n |-> bb |-> P |-... ints: irange(0,220), intatoms: irange(0,220)\u001b[0m\n", - "[2018-06-04 13:27:22,627, T+177169] \"ProB Output Logger for instance 39020865\" de.prob.cli.ProBInstance.readAndLog(ConsoleListener.java:48): [INFO] Kodkod module started up successfully (SAT solver SAT4J with timeout of 1500 ms).\u001b[0m\n", - "Execution time: 16.409082568 seconds\n" - ] + "data": { + "text/markdown": [ + "Execution time: 23.283731450 seconds" + ], + "text/plain": [ + "Execution time: 23.283731450 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" }, { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] }, - "execution_count": 4, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -181,27 +161,39 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "Execution time: 0.566783923 seconds\n" - ] + "data": { + "text/markdown": [ + "Execution time: 1.830645821 seconds" + ], + "text/plain": [ + "Execution time: 1.830645821 seconds" + ] + }, + "metadata": {}, + "output_type": "display_data" }, { "data": { + "text/markdown": [ + "$\\mathit{TRUE}$\n", + "\n", + "**Solution:**\n", + "* $\\mathit{mapping} = \\#905\\in\\{((((((\\mathit{BM02}\\mapsto 1)\\mapsto \\mathit{bwl\\_bachelor})\\mapsto \\mathit{P})\\mapsto 0)\\mapsto 2)\\mapsto 215),((((((\\mathit{BM02}\\mapsto 1)\\mapsto \\mathit{vwl\\_bachelor})\\mapsto \\mathit{P})\\mapsto 0)\\mapsto 2)\\mapsto 215),\\ldots,((((((\\mathit{BW18}\\mapsto 3)\\mapsto \\mathit{vwl\\_bachelor})\\mapsto \\mathit{W})\\mapsto 0)\\mapsto 3)\\mapsto 88),((((((\\mathit{BW18}\\mapsto 3)\\mapsto \\mathit{vwl\\_bachelor})\\mapsto \\mathit{W})\\mapsto 0)\\mapsto 4)\\mapsto 88)\\}$\n", + "* $\\mathit{bu} = \\#229\\in\\{(\\mathit{BM02}\\mapsto 212),(\\mathit{BM02}\\mapsto 215),\\ldots,(\\mathit{BW18}\\mapsto 88),(\\mathit{BW18}\\mapsto 142)\\}$" + ], "text/plain": [ "TRUE\n", "\n", "Solution:\n", - "\tmapping = ∃905∈{((((((BM02↦1)↦bwl_bachelor)↦P)↦0)↦2)↦215),((((((BM02↦1)↦vwl_bachelor)↦P)↦0)↦2)↦215),…,((((((BW18↦3)↦vwl_bachelor)↦W)↦0)↦3)↦88),((((((BW18↦3)↦vwl_bachelor)↦W)↦0)↦4)↦88)}\n", - "\tbu = ∃229∈{(BM02↦212),(BM02↦215),…,(BW18↦88),(BW18↦142)}" + "\tmapping = #905∈{((((((BM02↦1)↦bwl_bachelor)↦P)↦0)↦2)↦215),((((((BM02↦1)↦vwl_bachelor)↦P)↦0)↦2)↦215),…,((((((BW18↦3)↦vwl_bachelor)↦W)↦0)↦3)↦88),((((((BW18↦3)↦vwl_bachelor)↦W)↦0)↦4)↦88)}\n", + "\tbu = #229∈{(BM02↦212),(BM02↦215),…,(BW18↦88),(BW18↦142)}" ] }, - "execution_count": 5, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -282,13 +274,6 @@ " ((((((BW18|->2)|->bwl_bachelor)|->W)|->0)|->4)|->88),((((((BW18|->2)|->vwl_bachelor)|->W)|->0)|->3)|->88),((((((BW18|->2)|->vwl_bachelor)|->W)|->0)|->4)|->88),((((((BW18|->3)|->bwl_bachelor)|->W)|->0)|->3)|->88),((((((BW18|->3)|->bwl_bachelor)|->W)|->0)|->4)|->88),\n", " ((((((BW18|->3)|->vwl_bachelor)|->W)|->0)|->3)|->88),((((((BW18|->3)|->vwl_bachelor)|->W)|->0)|->4)|->88)}" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -298,8 +283,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/tests/animate.ipynb b/notebooks/tests/animate.ipynb index ca4c457eb86a5f88411a45bd0ceb66dc53d72e18..7fa9ce80026596831cac1f57aee9965e5c772990 100644 --- a/notebooks/tests/animate.ipynb +++ b/notebooks/tests/animate.ipynb @@ -17,10 +17,7 @@ "The output shows the names of all sets, constants, and variables defined by the current machine, as well as a list of transitions that are available in the current state." ], "text/plain": [ - "```\n", ":browse\n", - "```\n", - "\n", "Show information about the current state.\n", "\n", "The output shows the names of all sets, constants, and variables defined by the current machine, as well as a list of transitions that are available in the current state." @@ -52,10 +49,7 @@ "A transition for the given operation is found and executed. If the optional predicate is specified, a transition is found for which the predicate is $\\mathit{TRUE}$. The predicate can be used to restrict what values the operation's parameters or the variables in the next state may have." ], "text/plain": [ - "```\n", ":exec OPERATION [PREDICATE]\n", - "```\n", - "\n", "Execute an operation.\n", "\n", "A transition for the given operation is found and executed. If the optional predicate is specified, a transition is found for which the predicate is $\\mathit{TRUE}$. The predicate can be used to restrict what values the operation's parameters or the variables in the next state may have." @@ -87,10 +81,7 @@ "This is a shorthand for `:exec SETUP_CONSTANTS [PREDICATE]`." ], "text/plain": [ - "```\n", ":constants [PREDICATE]\n", - "```\n", - "\n", "Set up the current machine's constants.\n", "\n", "This is a shorthand for `:exec SETUP_CONSTANTS [PREDICATE]`." @@ -122,10 +113,7 @@ "This is a shorthand for `:exec INITIALISATION [PREDICATE]`." ], "text/plain": [ - "```\n", ":init [PREDICATE]\n", - "```\n", - "\n", "Initialise the current machine with the specified predicate\n", "\n", "This is a shorthand for `:exec INITIALISATION [PREDICATE]`." @@ -276,10 +264,10 @@ "\u001b[1m\u001b[31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1m\u001b[31mjava.lang.IllegalArgumentException: Executing operation $setup_constants with predicate min_value=5 & max_value=-5 produced errors: Could not execute operation SETUP_CONSTANTS with additional predicate\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.transitionFromPredicate(StateSpace.java:279)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ConstantsCommand.run(ConstantsCommand.java:47)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:226)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:249)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:303)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ConstantsCommand.run(ConstantsCommand.java:48)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:228)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:251)\u001b[0m", + "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)\u001b[0m", "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)\u001b[0m" @@ -587,10 +575,10 @@ "\u001b[1m\u001b[31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1m\u001b[31mjava.lang.IllegalArgumentException: Executing operation $setup_constants with predicate 1=1 produced errors: Machine is already initialised, cannot execute SETUP_CONSTANTS\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.transitionFromPredicate(StateSpace.java:279)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ConstantsCommand.run(ConstantsCommand.java:47)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:226)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:249)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:303)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ConstantsCommand.run(ConstantsCommand.java:48)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:228)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:251)\u001b[0m", + "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)\u001b[0m", "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)\u001b[0m" @@ -614,10 +602,10 @@ "\u001b[1m\u001b[31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1m\u001b[31mjava.lang.IllegalArgumentException: Executing operation $initialise_machine with predicate 1=1 produced errors: Machine is already initialised, cannot execute INITIALISATION\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.transitionFromPredicate(StateSpace.java:279)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.InitialiseCommand.run(InitialiseCommand.java:47)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:226)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:249)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:303)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.InitialiseCommand.run(InitialiseCommand.java:48)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:228)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:251)\u001b[0m", + "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)\u001b[0m", "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)\u001b[0m" @@ -642,9 +630,9 @@ "\u001b[1m\u001b[31mjava.lang.IllegalArgumentException: Executing operation nope with predicate 1=1 produced errors: Unknown Operation nope\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.transitionFromPredicate(StateSpace.java:279)\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ExecCommand.run(ExecCommand.java:53)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:226)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:249)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:303)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:228)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:251)\u001b[0m", + "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)\u001b[0m", "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)\u001b[0m" @@ -669,9 +657,9 @@ "\u001b[1m\u001b[31mjava.lang.IllegalArgumentException: Executing operation add with predicate 1=0 produced errors: Could not execute operation add with additional predicate\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.transitionFromPredicate(StateSpace.java:279)\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ExecCommand.run(ExecCommand.java:53)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:226)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:249)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:303)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:228)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:251)\u001b[0m", + "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)\u001b[0m", "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)\u001b[0m" @@ -720,10 +708,10 @@ "\u001b[1m\u001b[31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1m\u001b[31mjava.lang.IllegalArgumentException: Executing operation $setup_constants with predicate 1=1 produced errors: Could not execute operation SETUP_CONSTANTS\u001b[0m", "\u001b[1m\u001b[31m\tat de.prob.statespace.StateSpace.transitionFromPredicate(StateSpace.java:279)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ConstantsCommand.run(ConstantsCommand.java:47)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:226)\u001b[0m", - "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:249)\u001b[0m", - "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:303)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.commands.ConstantsCommand.run(ConstantsCommand.java:48)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.executeCommand(ProBKernel.java:228)\u001b[0m", + "\u001b[1m\u001b[31m\tat de.prob2.jupyter.ProBKernel.eval(ProBKernel.java:251)\u001b[0m", + "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)\u001b[0m", "\u001b[1m\u001b[31m\tat java.lang.Thread.run(Thread.java:748)\u001b[0m", "\u001b[1m\u001b[31m\tat io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)\u001b[0m" diff --git a/notebooks/tests/assert.ipynb b/notebooks/tests/assert.ipynb index 6ae6b79e5f3e81f33d3b062247810e87d33bbf4d..c7b71024b992a4c7f513f12351a9fcee261480d7 100644 --- a/notebooks/tests/assert.ipynb +++ b/notebooks/tests/assert.ipynb @@ -19,10 +19,7 @@ "Only predicates and $\\mathit{BOOL}$ expressions are accepted. Expressions of other types cause an error." ], "text/plain": [ - "```\n", ":assert PREDICATE\n", - "```\n", - "\n", "Ensure that the predicate is true, and show an error otherwise.\n", "\n", "This command is intended for verifying that a predicate is always true at a certain point in a notebook. Unlike normal evaluation (`:eval`), this command treats a $\\mathit{FALSE}$ result as an error. If the result is $\\mathit{TRUE}$, solutions for free variables (if any) are not displayed.\n", diff --git a/notebooks/tests/chr_tests.ipynb b/notebooks/tests/chr_tests.ipynb index 65f3abcd0f9f3ef47caf7da9f55ad9069985ce48..2249959231dac2a197d8cc29c051fd8dfd242d4f 100644 --- a/notebooks/tests/chr_tests.ipynb +++ b/notebooks/tests/chr_tests.ipynb @@ -67,6 +67,9 @@ "outputs": [ { "data": { + "text/markdown": [ + "$\\mathit{FALSE}$" + ], "text/plain": [ "FALSE" ] @@ -128,8 +131,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/tests/dot.ipynb b/notebooks/tests/dot.ipynb index 0b94af53aa03a033a534d9fe2ddbde6cca697184..459e2fa2296c2a8b11c31f31ed3127281de011f3 100644 --- a/notebooks/tests/dot.ipynb +++ b/notebooks/tests/dot.ipynb @@ -39,10 +39,7 @@ "* `predicate_dependency` - Predicate Dependency Graph: Show dependence graph of conjuncts of a predicate\n" ], "text/plain": [ - "```\n", ":dot COMMAND [FORMULA]\n", - "```\n", - "\n", "Execute and show a dot visualisation.\n", "\n", "The following dot visualisation commands are available:\n", @@ -83,26 +80,6 @@ "cell_type": "code", "execution_count": 2, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Preference changed: DOT = /usr/local/bin/dot\n" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - ":pref DOT=/usr/local/bin/dot" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, "outputs": [ { "data": { @@ -110,18 +87,19 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: visited_states Pages: 1 -->\n", - "<svg width=\"98pt\" height=\"54pt\"\n", - " viewBox=\"0.00 0.00 98.00 54.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 50)\">\n", + "<svg width=\"97pt\" height=\"50pt\"\n", + " viewBox=\"0.00 0.00 96.64 50.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 46)\">\n", "<title>visited_states</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-50 95,-50 95,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-46 92.6445,-46 92.6445,4 -4,4\"/>\n", "<!-- root -->\n", - "<g id=\"node1\" class=\"node\"><title>root</title>\n", - "<polygon fill=\"none\" stroke=\"#f4e3c1\" stroke-width=\"2\" points=\"45,-0.699556 90.1952,-34.1502 -0.195189,-34.1502 45,-0.699556\"/>\n", - "<text text-anchor=\"middle\" x=\"45\" y=\"-19.4\" font-family=\"Times,serif\" font-size=\"12.00\">root</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>root</title>\n", + "<polygon fill=\"none\" stroke=\"#f4e3c1\" stroke-width=\"2\" points=\"44.3223,0 88.4675,-31.5 .177,-31.5 44.3223,0\"/>\n", + "<text text-anchor=\"middle\" x=\"44.3223\" y=\"-17.9\" font-family=\"Times,serif\" font-size=\"12.00\" fill=\"#000000\">root</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -130,7 +108,7 @@ "<Dot visualization: state_space []>" ] }, - "execution_count": 3, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -141,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -150,7 +128,7 @@ "Machine initialised using operation 0: $initialise_machine()" ] }, - "execution_count": 4, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -161,7 +139,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": { "scrolled": false }, @@ -172,29 +150,32 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: visited_states Pages: 1 -->\n", - "<svg width=\"145pt\" height=\"220pt\"\n", - " viewBox=\"0.00 0.00 144.95 220.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 216)\">\n", + "<svg width=\"144pt\" height=\"215pt\"\n", + " viewBox=\"0.00 0.00 144.32 215.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 211)\">\n", "<title>visited_states</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-216 141.951,-216 141.951,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-211 140.3223,-211 140.3223,4 -4,4\"/>\n", "<!-- root -->\n", - "<g id=\"node1\" class=\"node\"><title>root</title>\n", - "<polygon fill=\"none\" stroke=\"#f4e3c1\" stroke-width=\"2\" points=\"45,-166.7 90.1952,-200.15 -0.195189,-200.15 45,-166.7\"/>\n", - "<text text-anchor=\"middle\" x=\"45\" y=\"-185.4\" font-family=\"Times,serif\" font-size=\"12.00\">root</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>root</title>\n", + "<polygon fill=\"none\" stroke=\"#f4e3c1\" stroke-width=\"2\" points=\"44.3223,-165 88.4675,-196.5 .177,-196.5 44.3223,-165\"/>\n", + "<text text-anchor=\"middle\" x=\"44.3223\" y=\"-182.9\" font-family=\"Times,serif\" font-size=\"12.00\" fill=\"#000000\">root</text>\n", "</g>\n", "<!-- 0 -->\n", - "<g id=\"node3\" class=\"node\"><title>0</title>\n", - "<polygon fill=\"none\" stroke=\"#99bf38\" stroke-width=\"2\" points=\"72,-14.5442 72,-29.4558 56.1838,-40 33.8162,-40 18,-29.4558 18,-14.5442 33.8162,-4 56.1838,-4 72,-14.5442\"/>\n", - "<polygon fill=\"none\" stroke=\"#99bf38\" stroke-width=\"2\" points=\"76,-12.4034 76,-31.5966 57.3949,-44 32.6051,-44 14,-31.5966 14,-12.4034 32.6051,-3.55271e-15 57.3949,-0 76,-12.4034\"/>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>0</title>\n", + "<polygon fill=\"none\" stroke=\"#99bf38\" stroke-width=\"2\" points=\"71.3223,-14.5442 71.3223,-29.4558 55.506,-40 33.1385,-40 17.3223,-29.4558 17.3223,-14.5442 33.1385,-4 55.506,-4 71.3223,-14.5442\"/>\n", + "<polygon fill=\"none\" stroke=\"#99bf38\" stroke-width=\"2\" points=\"75.3223,-12.4034 75.3223,-31.5966 56.7171,-44 31.9274,-44 13.3223,-31.5966 13.3223,-12.4034 31.9274,0 56.7171,0 75.3223,-12.4034\"/>\n", "</g>\n", "<!-- root->0 -->\n", - "<g id=\"edge2\" class=\"edge\"><title>root->0</title>\n", - "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"1,5\" d=\"M45,-166.429C45,-137.862 45,-87.272 45,-54.4477\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"48.5001,-54.0544 45,-44.0545 41.5001,-54.0545 48.5001,-54.0544\"/>\n", - "<text text-anchor=\"middle\" x=\"90.9756\" y=\"-101.4\" font-family=\"Times,serif\" font-size=\"12.00\">INITIALISATION</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>root->0</title>\n", + "<path fill=\"none\" stroke=\"#000000\" stroke-dasharray=\"1,5\" d=\"M44.3223,-164.8956C44.3223,-136.9146 44.3223,-87.2613 44.3223,-54.4833\"/>\n", + "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"47.8224,-54.0698 44.3223,-44.0699 40.8224,-54.0699 47.8224,-54.0698\"/>\n", + "<text text-anchor=\"middle\" x=\"90.3223\" y=\"-101.4\" font-family=\"Times,serif\" font-size=\"12.00\" fill=\"#000000\">INITIALISATION</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -203,7 +184,7 @@ "<Dot visualization: state_space []>" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -214,7 +195,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -223,19 +204,20 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: g Pages: 1 -->\n", - "<svg width=\"156pt\" height=\"66pt\"\n", - " viewBox=\"0.00 0.00 156.00 66.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 62)\">\n", + "<svg width=\"155pt\" height=\"62pt\"\n", + " viewBox=\"0.00 0.00 155.08 61.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 57.7401)\">\n", "<title>g</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-62 153,-62 153,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-57.7401 151.0782,-57.7401 151.0782,4 -4,4\"/>\n", "<!-- Noderoot -->\n", - "<g id=\"node1\" class=\"node\"><title>Noderoot</title>\n", - "<ellipse fill=\"#b3ee3a\" stroke=\"black\" cx=\"74\" cy=\"-29\" rx=\"73.3839\" ry=\"29.3315\"/>\n", - "<text text-anchor=\"middle\" x=\"74\" y=\"-33.2\" font-family=\"Times,serif\" font-size=\"14.00\">(TRUE:BOOL)</text>\n", - "<text text-anchor=\"middle\" x=\"74\" y=\"-16.4\" font-family=\"Times,serif\" font-size=\"14.00\"> true</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>Noderoot</title>\n", + "<ellipse fill=\"#b3ee3a\" stroke=\"#000000\" cx=\"73.5391\" cy=\"-26.8701\" rx=\"73.5782\" ry=\"26.7407\"/>\n", + "<text text-anchor=\"middle\" x=\"73.5391\" y=\"-30.6701\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">(TRUE:BOOL)</text>\n", + "<text text-anchor=\"middle\" x=\"73.5391\" y=\"-15.6701\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> true</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -244,7 +226,7 @@ "<Dot visualization: invariant []>" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -255,7 +237,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -264,46 +246,52 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: state Pages: 1 -->\n", - "<svg width=\"127pt\" height=\"224pt\"\n", - " viewBox=\"0.00 0.00 127.32 224.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 220)\">\n", + "<svg width=\"128pt\" height=\"218pt\"\n", + " viewBox=\"0.00 0.00 128.00 218.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 214)\">\n", "<title>state</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-220 124.321,-220 124.321,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-214 124,-214 124,4 -4,4\"/>\n", "<!-- 3 -->\n", - "<g id=\"node1\" class=\"node\"><title>3</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"90,-216 36,-216 36,-180 90,-180 90,-216\"/>\n", - "<text text-anchor=\"middle\" x=\"63\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>3</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"90,-210 36,-210 36,-174 90,-174 90,-210\"/>\n", + "<text text-anchor=\"middle\" x=\"63\" y=\"-188.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n", "</g>\n", "<!-- 1 -->\n", - "<g id=\"node3\" class=\"node\"><title>1</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-126 0,-126 0,-90 54,-90 54,-126\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>1</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-123 0,-123 0,-87 54,-87 54,-123\"/>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n", "</g>\n", "<!-- 3->1 -->\n", - "<g id=\"edge2\" class=\"edge\"><title>3->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M49.2014,-179.992C45.3133,-174.512 41.4054,-168.238 38.6788,-162 35.1373,-153.898 32.6229,-144.614 30.8585,-136.103\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"34.2966,-135.447 29.0596,-126.237 27.4101,-136.703 34.2966,-135.447\"/>\n", - "<text text-anchor=\"middle\" x=\"56.6606\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">[2,3,1]</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>3->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M48.2776,-173.7725C44.455,-168.3152 40.6674,-162.1419 38,-156 34.9241,-148.9173 32.677,-140.8962 31.0477,-133.3471\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"34.4794,-132.6574 29.1892,-123.4779 27.6003,-133.9529 34.4794,-132.6574\"/>\n", + "<text text-anchor=\"middle\" x=\"57\" y=\"-144.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">[2,3,1]</text>\n", "</g>\n", "<!-- 2 -->\n", - "<g id=\"node4\" class=\"node\"><title>2</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"88,-36 34,-36 34,-0 88,-0 88,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"61\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>2</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"85,-36 31,-36 31,0 85,0 85,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"58\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n", "</g>\n", "<!-- 1->2 -->\n", - "<g id=\"edge6\" class=\"edge\"><title>1->2</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M29.219,-89.8308C30.9674,-79.2243 33.9239,-65.4924 38.6788,-54 39.9462,-50.9367 41.4789,-47.8441 43.1405,-44.8318\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"46.2118,-46.5164 48.3761,-36.145 40.2165,-42.903 46.2118,-46.5164\"/>\n", - "<text text-anchor=\"middle\" x=\"56.6606\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">[2,3,1]</text>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>1->2</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M29.6039,-86.69C31.3415,-76.8067 34.0458,-64.5126 38,-54 39.0973,-51.0827 40.4008,-48.115 41.8086,-45.1988\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"44.9918,-46.6647 46.5353,-36.1829 38.7922,-43.4144 44.9918,-46.6647\"/>\n", + "<text text-anchor=\"middle\" x=\"57\" y=\"-57.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">[2,3,1]</text>\n", "</g>\n", "<!-- 2->3 -->\n", - "<g id=\"edge4\" class=\"edge\"><title>2->3</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M70.075,-36.3529C72.4959,-41.8463 74.7771,-48.0422 76,-54 85.6512,-101.02 84.4904,-114.757 76,-162 75.5116,-164.717 74.8259,-167.499 74.022,-170.249\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"70.6475,-169.301 70.7342,-179.896 77.2732,-171.56 70.6475,-169.301\"/>\n", - "<text text-anchor=\"middle\" x=\"100.661\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[2,3,1]</text>\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>2->3</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M69.0675,-36.0594C71.9014,-41.6127 74.5551,-47.8793 76,-54 86.4155,-98.1206 83.8156,-111.3455 76,-156 75.5328,-158.6693 74.8845,-161.4018 74.1248,-164.1095\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"70.7862,-163.0583 71.0089,-173.6508 77.4404,-165.2314 70.7862,-163.0583\"/>\n", + "<text text-anchor=\"middle\" x=\"101\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">[2,3,1]</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -312,7 +300,7 @@ "<Dot visualization: expr_as_graph [{(1,2),(2,3),(3,1)}]>" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -323,7 +311,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -332,110 +320,127 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: state Pages: 1 -->\n", - "<svg width=\"219pt\" height=\"404pt\"\n", - " viewBox=\"0.00 0.00 218.84 404.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 400)\">\n", + "<svg width=\"220pt\" height=\"392pt\"\n", + " viewBox=\"0.00 0.00 220.34 392.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 388)\">\n", "<title>state</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-400 215.838,-400 215.838,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-388 216.3366,-388 216.3366,4 -4,4\"/>\n", "<!-- 4 -->\n", - "<g id=\"node1\" class=\"node\"><title>4</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"124.948,-306 70.9475,-306 70.9475,-270 124.948,-270 124.948,-306\"/>\n", - "<text text-anchor=\"middle\" x=\"97.9475\" y=\"-283.8\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>4</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"126.3366,-297 72.3366,-297 72.3366,-261 126.3366,-261 126.3366,-297\"/>\n", + "<text text-anchor=\"middle\" x=\"99.3366\" y=\"-275.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n", "</g>\n", "<!-- 2 -->\n", - "<g id=\"node3\" class=\"node\"><title>2</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"58.9475,-126 4.94753,-126 4.94753,-90 58.9475,-90 58.9475,-126\"/>\n", - "<text text-anchor=\"middle\" x=\"31.9475\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>2</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"60.3366,-123 6.3366,-123 6.3366,-87 60.3366,-87 60.3366,-123\"/>\n", + "<text text-anchor=\"middle\" x=\"33.3366\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n", "</g>\n", "<!-- 4->2 -->\n", - "<g id=\"edge2\" class=\"edge\"><title>4->2</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M79.4272,-269.961C66.2891,-256.654 49.5582,-236.956 41.1817,-216 30.8927,-190.26 29.44,-158.329 30.0304,-136.079\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"33.5307,-136.142 30.4545,-126.004 26.5369,-135.848 33.5307,-136.142\"/>\n", - "<text text-anchor=\"middle\" x=\"52.8304\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">half</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>4->2</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M79.0579,-260.9061C66.1479,-248.0804 50.3898,-229.7049 42.3366,-210 32.3296,-185.5146 30.755,-155.197 31.28,-133.4438\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"34.7864,-133.3549 31.6954,-123.221 27.7922,-133.0707 34.7864,-133.3549\"/>\n", + "<text text-anchor=\"middle\" x=\"53.3366\" y=\"-188.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">half</text>\n", "</g>\n", "<!-- 4->2 -->\n", - "<g id=\"edge16\" class=\"edge\"><title>4->2</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M70.9473,-272.847C51.4272,-260.789 26.9824,-241.382 18.0569,-216 8.83003,-189.761 14.9797,-157.963 21.7727,-135.882\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"25.1635,-136.776 24.9901,-126.183 18.5195,-134.573 25.1635,-136.776\"/>\n", - "<text text-anchor=\"middle\" x=\"24.3928\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge8\" class=\"edge\">\n", + "<title>4->2</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M72.3052,-265.4238C52.6988,-253.802 27.9955,-234.9838 18.3366,-210 8.649,-184.9421 14.8751,-154.3426 22.0229,-132.6563\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"25.3751,-133.6757 25.4287,-123.081 18.7798,-131.3298 25.3751,-133.6757\"/>\n", + "<text text-anchor=\"middle\" x=\"23.8366\" y=\"-188.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 1 -->\n", - "<g id=\"node5\" class=\"node\"><title>1</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"129.948,-36 75.9475,-36 75.9475,-0 129.948,-0 129.948,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"102.948\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>1</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"131.3366,-36 77.3366,-36 77.3366,0 131.3366,0 131.3366,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"104.3366\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n", "</g>\n", "<!-- 4->1 -->\n", - "<g id=\"edge18\" class=\"edge\"><title>4->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M109.897,-269.857C118.764,-256.032 130.12,-235.711 134.948,-216 149.703,-155.756 128.178,-83.4427 113.895,-45.3934\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"117.149,-44.1048 110.27,-36.0468 110.623,-46.6358 117.149,-44.1048\"/>\n", - "<text text-anchor=\"middle\" x=\"144.393\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge9\" class=\"edge\">\n", + "<title>4->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M112.2011,-260.991C120.9171,-247.6323 131.6672,-228.5883 136.3366,-210 150.7854,-152.4801 130.3844,-83.5902 116.1253,-45.9526\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"119.2103,-44.2325 112.3004,-36.201 112.6936,-46.7886 119.2103,-44.2325\"/>\n", + "<text text-anchor=\"middle\" x=\"145.8366\" y=\"-144.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 3 -->\n", - "<g id=\"node9\" class=\"node\"><title>3</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"125.948,-216 71.9475,-216 71.9475,-180 125.948,-180 125.948,-216\"/>\n", - "<text text-anchor=\"middle\" x=\"98.9475\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n", + "<g id=\"node5\" class=\"node\">\n", + "<title>3</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"127.3366,-210 73.3366,-210 73.3366,-174 127.3366,-174 127.3366,-210\"/>\n", + "<text text-anchor=\"middle\" x=\"100.3366\" y=\"-188.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n", "</g>\n", "<!-- 4->3 -->\n", - "<g id=\"edge14\" class=\"edge\"><title>4->3</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M98.1451,-269.614C98.2857,-257.24 98.4774,-240.369 98.6382,-226.22\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"102.14,-226.09 98.7538,-216.05 95.1403,-226.01 102.14,-226.09\"/>\n", - "<text text-anchor=\"middle\" x=\"104.393\" y=\"-238.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge7\" class=\"edge\">\n", + "<title>4->3</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M99.5438,-260.9735C99.6792,-249.1918 99.8589,-233.5607 100.0129,-220.1581\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"103.5144,-220.043 100.1296,-210.0034 96.5148,-219.9624 103.5144,-220.043\"/>\n", + "<text text-anchor=\"middle\" x=\"104.8366\" y=\"-231.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 2->1 -->\n", - "<g id=\"edge4\" class=\"edge\"><title>2->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M42.193,-89.6496C48.8044,-78.9749 57.8815,-65.2349 67.1817,-54 70.1283,-50.4405 73.3943,-46.8493 76.7199,-43.3931\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"79.4053,-45.6571 83.9943,-36.1077 74.4518,-40.7111 79.4053,-45.6571\"/>\n", - "<text text-anchor=\"middle\" x=\"78.8304\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">half</text>\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>2->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M44.556,-86.9526C51.0742,-76.9232 59.6881,-64.4059 68.3366,-54 71.2761,-50.4631 74.5079,-46.8768 77.7917,-43.4073\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"80.4832,-45.6608 84.9702,-36.063 75.4773,-40.7679 80.4832,-45.6608\"/>\n", + "<text text-anchor=\"middle\" x=\"79.3366\" y=\"-57.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">half</text>\n", "</g>\n", "<!-- 2->1 -->\n", - "<g id=\"edge24\" class=\"edge\"><title>2->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M30.8599,-89.8335C30.9946,-78.7035 32.8318,-64.3952 40.0569,-54 46.609,-44.5732 56.5585,-37.4047 66.6229,-32.0877\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"68.2814,-35.1745 75.8038,-27.7137 65.2706,-28.8551 68.2814,-35.1745\"/>\n", - "<text text-anchor=\"middle\" x=\"46.3928\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge12\" class=\"edge\">\n", + "<title>2->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M32.4527,-86.5835C32.8248,-76.1947 34.8248,-63.4447 41.3366,-54 47.9062,-44.4715 57.8746,-37.1455 67.9562,-31.6684\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"69.722,-34.7005 77.1524,-27.1481 66.634,-28.4184 69.722,-34.7005\"/>\n", + "<text text-anchor=\"middle\" x=\"46.8366\" y=\"-57.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5 -->\n", - "<g id=\"node6\" class=\"node\"><title>5</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"164.948,-396 110.948,-396 110.948,-360 164.948,-360 164.948,-396\"/>\n", - "<text text-anchor=\"middle\" x=\"137.948\" y=\"-373.8\" font-family=\"Times,serif\" font-size=\"14.00\">5</text>\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>5</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"173.3366,-384 119.3366,-384 119.3366,-348 173.3366,-348 173.3366,-384\"/>\n", + "<text text-anchor=\"middle\" x=\"146.3366\" y=\"-362.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n", "</g>\n", "<!-- 5->4 -->\n", - "<g id=\"edge6\" class=\"edge\"><title>5->4</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M130.045,-359.614C124.31,-346.998 116.45,-329.705 109.943,-315.391\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"113.022,-313.706 105.698,-306.05 106.65,-316.602 113.022,-313.706\"/>\n", - "<text text-anchor=\"middle\" x=\"127.393\" y=\"-328.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>5->4</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M136.5981,-347.9735C130.0442,-335.8418 121.2854,-319.6287 113.9065,-305.9698\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"116.895,-304.138 109.0625,-297.0034 110.7362,-307.4652 116.895,-304.138\"/>\n", + "<text text-anchor=\"middle\" x=\"130.8366\" y=\"-318.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5->2 -->\n", - "<g id=\"edge10\" class=\"edge\"><title>5->2</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M111.655,-359.97C81.5625,-338.779 33.7685,-299.527 13.0569,-252 -6.11999,-207.994 -1.65568,-190.035 11.9475,-144 12.8313,-141.009 14.0135,-137.999 15.3633,-135.067\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"18.5295,-136.566 20.0865,-126.086 12.334,-133.307 18.5295,-136.566\"/>\n", - "<text text-anchor=\"middle\" x=\"19.3928\" y=\"-238.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge5\" class=\"edge\">\n", + "<title>5->2</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M119.2819,-350.2868C87.3875,-330.0614 35.8753,-291.6572 13.3366,-243 -5.7213,-201.8576 -2.2595,-184.2556 11.3366,-141 12.2728,-138.0215 13.5071,-135.0369 14.9144,-132.1306\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"18.0667,-133.6627 19.8453,-123.2183 11.9416,-130.2739 18.0667,-133.6627\"/>\n", + "<text text-anchor=\"middle\" x=\"18.8366\" y=\"-231.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5->1 -->\n", - "<g id=\"edge12\" class=\"edge\"><title>5->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M159.632,-359.929C177.511,-343.78 199.948,-317.781 199.948,-289 199.948,-289 199.948,-289 199.948,-107 199.948,-72.8845 166.628,-48.5304 139.045,-34.2143\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"140.485,-31.0219 129.967,-29.7444 137.393,-37.3019 140.485,-31.0219\"/>\n", - "<text text-anchor=\"middle\" x=\"205.393\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge6\" class=\"edge\">\n", + "<title>5->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M166.5042,-347.7161C182.2012,-331.4029 201.3366,-305.9826 201.3366,-279 201.3366,-279 201.3366,-279 201.3366,-105 201.3366,-71.059 168.0169,-47.0183 140.4342,-32.9318\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"141.8822,-29.7442 131.3565,-28.5363 138.8316,-36.0445 141.8822,-29.7442\"/>\n", + "<text text-anchor=\"middle\" x=\"206.8366\" y=\"-188.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5->3 -->\n", - "<g id=\"edge8\" class=\"edge\"><title>5->3</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M139.495,-359.637C140.907,-338.206 141.741,-300.818 133.948,-270 129.962,-254.24 122.187,-237.885 114.975,-224.851\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"117.906,-222.925 109.886,-216.002 111.838,-226.415 117.906,-222.925\"/>\n", - "<text text-anchor=\"middle\" x=\"144.393\" y=\"-283.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge4\" class=\"edge\">\n", + "<title>5->3</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M146.4197,-347.7778C146.0646,-326.5243 144.0504,-290.5339 135.3366,-261 131.0657,-246.5246 123.8015,-231.4639 116.9944,-219.1202\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"119.9349,-217.2116 111.9351,-210.2651 113.857,-220.6842 119.9349,-217.2116\"/>\n", + "<text text-anchor=\"middle\" x=\"147.8366\" y=\"-275.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 3->2 -->\n", - "<g id=\"edge20\" class=\"edge\"><title>3->2</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M85.7105,-179.614C75.8278,-166.634 62.1765,-148.704 51.1031,-134.16\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"53.7716,-131.887 44.9291,-126.05 48.2021,-136.127 53.7716,-131.887\"/>\n", - "<text text-anchor=\"middle\" x=\"77.3928\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge10\" class=\"edge\">\n", + "<title>3->2</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M86.4541,-173.9735C76.9316,-161.6085 64.1439,-145.0036 53.5018,-131.1847\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"56.0758,-128.7907 47.2012,-123.0034 50.5298,-133.0618 56.0758,-128.7907\"/>\n", + "<text text-anchor=\"middle\" x=\"75.8366\" y=\"-144.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 3->1 -->\n", - "<g id=\"edge22\" class=\"edge\"><title>3->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M99.3311,-179.933C100.027,-148.966 101.503,-83.2989 102.338,-46.1292\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"105.84,-46.0919 102.565,-36.0157 98.8413,-45.9345 105.84,-46.0919\"/>\n", - "<text text-anchor=\"middle\" x=\"107.393\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge11\" class=\"edge\">\n", + "<title>3->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M100.7571,-173.7078C101.4551,-143.3436 102.8579,-82.3226 103.6849,-46.3464\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"107.1908,-46.1249 103.9217,-36.0471 100.1927,-45.964 107.1908,-46.1249\"/>\n", + "<text text-anchor=\"middle\" x=\"107.8366\" y=\"-101.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -444,7 +449,7 @@ "<Dot visualization: expr_as_graph [(\"gt\",{x,y|x:1..5 & y:1..5 & x>y})]>" ] }, - "execution_count": 8, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -455,7 +460,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -464,7 +469,7 @@ "Preference changed: DOT_ENGINE = circo\n" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -475,7 +480,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -484,110 +489,127 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: state Pages: 1 -->\n", "<svg width=\"243pt\" height=\"235pt\"\n", " viewBox=\"0.00 0.00 243.39 234.72\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 230.72)\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 230.7203)\">\n", "<title>state</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-230.72 240.386,-230.72 240.386,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-230.7203 239.3858,-230.7203 239.3858,4 -4,4\"/>\n", "<!-- 4 -->\n", - "<g id=\"node1\" class=\"node\"><title>4</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.103,-36 112.103,-36 112.103,-0 166.103,-0 166.103,-36\"/>\n", - "<text text-anchor=\"middle\" x=\"139.103\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>4</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.1026,-36 112.1026,-36 112.1026,0 166.1026,0 166.1026,-36\"/>\n", + "<text text-anchor=\"middle\" x=\"139.1026\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n", "</g>\n", "<!-- 2 -->\n", - "<g id=\"node3\" class=\"node\"><title>2</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"235.386,-131.36 181.386,-131.36 181.386,-95.3602 235.386,-95.3602 235.386,-131.36\"/>\n", - "<text text-anchor=\"middle\" x=\"208.386\" y=\"-109.16\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>2</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"235.3858,-131.3602 181.3858,-131.3602 181.3858,-95.3602 235.3858,-95.3602 235.3858,-131.3602\"/>\n", + "<text text-anchor=\"middle\" x=\"208.3858\" y=\"-109.6602\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n", "</g>\n", "<!-- 4->2 -->\n", - "<g id=\"edge2\" class=\"edge\"><title>4->2</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M146.096,-36.3277C154.534,-50.7471 168.707,-70.9379 181.466,-87.0605\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"178.949,-89.5137 187.971,-95.0686 184.383,-85.1 178.949,-89.5137\"/>\n", - "<text text-anchor=\"middle\" x=\"151.781\" y=\"-65.4941\" font-family=\"Times,serif\" font-size=\"14.00\">half</text>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>4->2</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M146.0962,-36.3277C154.5341,-50.7471 168.707,-70.9379 181.4659,-87.0605\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"178.9494,-89.5137 187.9712,-95.0686 184.3826,-85.1 178.9494,-89.5137\"/>\n", + "<text text-anchor=\"middle\" x=\"152.781\" y=\"-65.4941\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">half</text>\n", "</g>\n", "<!-- 4->2 -->\n", - "<g id=\"edge16\" class=\"edge\"><title>4->2</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M159.485,-36.2526C171.39,-50.4825 185.902,-70.3727 196.114,-86.4179\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"193.373,-88.6448 201.577,-95.3489 199.344,-84.992 193.373,-88.6448\"/>\n", - "<text text-anchor=\"middle\" x=\"169.799\" y=\"-63.1352\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge8\" class=\"edge\">\n", + "<title>4->2</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M159.4846,-36.2526C171.3905,-50.4825 185.9022,-70.3727 196.1137,-86.4179\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"193.373,-88.6448 201.577,-95.3489 199.3444,-84.992 193.373,-88.6448\"/>\n", + "<text text-anchor=\"middle\" x=\"172.2992\" y=\"-65.1352\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 1 -->\n", - "<g id=\"node5\" class=\"node\"><title>1</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-190.296 1.42109e-14,-190.296 1.42109e-14,-154.296 54,-154.296 54,-190.296\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-168.096\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>1</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-190.296 0,-190.296 0,-154.296 54,-154.296 54,-190.296\"/>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-168.596\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n", "</g>\n", "<!-- 4->1 -->\n", - "<g id=\"edge18\" class=\"edge\"><title>4->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M126.024,-36.0017C106.385,-63.0326 69.1556,-114.274 46.3626,-145.646\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"43.3895,-143.783 40.3432,-153.931 49.0526,-147.898 43.3895,-143.783\"/>\n", - "<text text-anchor=\"middle\" x=\"94.1931\" y=\"-92.6237\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge9\" class=\"edge\">\n", + "<title>4->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M126.0236,-36.0017C106.3845,-63.0326 69.1556,-114.2737 46.3626,-145.6457\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"43.3895,-143.7832 40.3432,-153.9307 49.0526,-147.8978 43.3895,-143.7832\"/>\n", + "<text text-anchor=\"middle\" x=\"80.6931\" y=\"-94.6237\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 3 -->\n", - "<g id=\"node9\" class=\"node\"><title>3</title>\n", + "<g id=\"node5\" class=\"node\">\n", + "<title>3</title>\n", "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"54,-72.4243 0,-72.4243 0,-36.4243 54,-36.4243 54,-72.4243\"/>\n", - "<text text-anchor=\"middle\" x=\"27\" y=\"-50.2243\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n", + "<text text-anchor=\"middle\" x=\"27\" y=\"-50.7243\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n", "</g>\n", "<!-- 4->3 -->\n", - "<g id=\"edge14\" class=\"edge\"><title>4->3</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M111.966,-26.8173C97.6137,-31.4806 79.779,-37.2754 64.1603,-42.3502\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"62.7045,-39.143 54.2756,-45.562 64.8677,-45.8004 62.7045,-39.143\"/>\n", - "<text text-anchor=\"middle\" x=\"91.063\" y=\"-40.3838\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge7\" class=\"edge\">\n", + "<title>4->3</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M111.9657,-26.8173C97.6137,-31.4806 79.779,-37.2754 64.1603,-42.3502\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"62.7045,-39.143 54.2756,-45.562 64.8677,-45.8004 62.7045,-39.143\"/>\n", + "<text text-anchor=\"middle\" x=\"82.563\" y=\"-38.3838\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 2->1 -->\n", - "<g id=\"edge4\" class=\"edge\"><title>2->1</title>\n", - "<path fill=\"none\" stroke=\"firebrick\" d=\"M181.277,-117.045C149.974,-124.882 98.3616,-141.388 63.5383,-154.508\"/>\n", - "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"62.2655,-151.247 54.1924,-158.108 64.7821,-157.779 62.2655,-151.247\"/>\n", - "<text text-anchor=\"middle\" x=\"125.407\" y=\"-142.576\" font-family=\"Times,serif\" font-size=\"14.00\">half</text>\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>2->1</title>\n", + "<path fill=\"none\" stroke=\"#b22222\" d=\"M181.2766,-117.0448C149.9737,-124.8821 98.3616,-141.3877 63.5383,-154.5076\"/>\n", + "<polygon fill=\"#b22222\" stroke=\"#b22222\" points=\"62.2655,-151.2472 54.1924,-158.1083 64.7821,-157.7792 62.2655,-151.2472\"/>\n", + "<text text-anchor=\"middle\" x=\"111.4074\" y=\"-139.5762\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">half</text>\n", "</g>\n", "<!-- 2->1 -->\n", - "<g id=\"edge24\" class=\"edge\"><title>2->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M181.217,-127.538C150.038,-139.854 98.7636,-156.649 63.9685,-166.04\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"62.974,-162.682 54.1813,-168.593 64.741,-169.456 62.974,-162.682\"/>\n", - "<text text-anchor=\"middle\" x=\"125.593\" y=\"-152.589\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge12\" class=\"edge\">\n", + "<title>2->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M181.2172,-127.5384C150.0376,-139.8543 98.7636,-156.6493 63.9685,-166.0402\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"62.974,-162.6824 54.1813,-168.5933 64.741,-169.4557 62.974,-162.6824\"/>\n", + "<text text-anchor=\"middle\" x=\"128.0929\" y=\"-150.5893\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5 -->\n", - "<g id=\"node6\" class=\"node\"><title>5</title>\n", - "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.103,-226.72 112.103,-226.72 112.103,-190.72 166.103,-190.72 166.103,-226.72\"/>\n", - "<text text-anchor=\"middle\" x=\"139.103\" y=\"-204.52\" font-family=\"Times,serif\" font-size=\"14.00\">5</text>\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>5</title>\n", + "<polygon fill=\"#cdba96\" stroke=\"#cdba96\" points=\"166.1026,-226.7203 112.1026,-226.7203 112.1026,-190.7203 166.1026,-190.7203 166.1026,-226.7203\"/>\n", + "<text text-anchor=\"middle\" x=\"139.1026\" y=\"-205.0203\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n", "</g>\n", "<!-- 5->4 -->\n", - "<g id=\"edge6\" class=\"edge\"><title>5->4</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M139.103,-190.433C139.103,-157.04 139.103,-85.9864 139.103,-46.3026\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"142.603,-46.2317 139.103,-36.2317 135.603,-46.2317 142.603,-46.2317\"/>\n", - "<text text-anchor=\"middle\" x=\"133.103\" y=\"-114.168\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>5->4</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M139.1026,-190.4333C139.1026,-157.0404 139.1026,-85.9864 139.1026,-46.3026\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"142.6027,-46.2317 139.1026,-36.2317 135.6027,-46.2317 142.6027,-46.2317\"/>\n", + "<text text-anchor=\"middle\" x=\"133.6026\" y=\"-122.1679\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5->2 -->\n", - "<g id=\"edge10\" class=\"edge\"><title>5->2</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M152.461,-190.334C162.879,-175.995 177.49,-155.885 189.165,-139.816\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"192.257,-141.514 195.303,-131.367 186.594,-137.4 192.257,-141.514\"/>\n", - "<text text-anchor=\"middle\" x=\"162.813\" y=\"-154.875\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge5\" class=\"edge\">\n", + "<title>5->2</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M152.4611,-190.3339C162.879,-175.9949 177.4897,-155.885 189.1646,-139.8159\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"192.257,-141.5142 195.3033,-131.3667 186.5938,-137.3997 192.257,-141.5142\"/>\n", + "<text text-anchor=\"middle\" x=\"165.3128\" y=\"-168.8749\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5->1 -->\n", - "<g id=\"edge12\" class=\"edge\"><title>5->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M111.966,-199.903C97.6137,-195.24 79.779,-189.445 64.1603,-184.37\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"64.8677,-180.92 54.2756,-181.158 62.7045,-187.577 64.8677,-180.92\"/>\n", - "<text text-anchor=\"middle\" x=\"85.063\" y=\"-197.937\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge6\" class=\"edge\">\n", + "<title>5->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M111.9657,-199.903C97.6137,-195.2398 79.779,-189.4449 64.1603,-184.3701\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"64.8677,-180.9199 54.2756,-181.1584 62.7045,-187.5773 64.8677,-180.9199\"/>\n", + "<text text-anchor=\"middle\" x=\"82.563\" y=\"-195.9366\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 5->3 -->\n", - "<g id=\"edge8\" class=\"edge\"><title>5->3</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M126.024,-190.719C106.385,-163.688 69.1556,-112.447 46.3626,-81.0746\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"49.0526,-78.8226 40.3432,-72.7896 43.3895,-82.9371 49.0526,-78.8226\"/>\n", - "<text text-anchor=\"middle\" x=\"78.1931\" y=\"-137.697\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge4\" class=\"edge\">\n", + "<title>5->3</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M126.0236,-190.7187C106.3845,-163.6878 69.1556,-112.4466 46.3626,-81.0746\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"49.0526,-78.8226 40.3432,-72.7896 43.3895,-82.9371 49.0526,-78.8226\"/>\n", + "<text text-anchor=\"middle\" x=\"80.6931\" y=\"-139.6966\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 3->2 -->\n", - "<g id=\"edge20\" class=\"edge\"><title>3->2</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M54.1553,-63.2476C85.368,-73.3892 136.758,-90.0869 171.557,-101.394\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"170.749,-104.811 181.342,-104.573 172.913,-98.154 170.749,-104.811\"/>\n", - "<text text-anchor=\"middle\" x=\"115.856\" y=\"-68.1207\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge10\" class=\"edge\">\n", + "<title>3->2</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M54.1553,-63.2476C85.368,-73.3892 136.7581,-90.0869 171.5567,-101.3937\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"170.7494,-104.8114 181.3415,-104.5729 172.9125,-98.154 170.7494,-104.8114\"/>\n", + "<text text-anchor=\"middle\" x=\"107.356\" y=\"-86.1207\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "<!-- 3->1 -->\n", - "<g id=\"edge22\" class=\"edge\"><title>3->1</title>\n", - "<path fill=\"none\" stroke=\"sienna\" d=\"M27,-72.5835C27,-91.5634 27,-121.61 27,-143.764\"/>\n", - "<polygon fill=\"sienna\" stroke=\"sienna\" points=\"23.5001,-143.922 27,-153.922 30.5001,-143.922 23.5001,-143.922\"/>\n", - "<text text-anchor=\"middle\" x=\"33\" y=\"-103.974\" font-family=\"Times,serif\" font-size=\"14.00\">gt</text>\n", + "<g id=\"edge11\" class=\"edge\">\n", + "<title>3->1</title>\n", + "<path fill=\"none\" stroke=\"#a0522d\" d=\"M27,-72.5835C27,-91.5634 27,-121.6099 27,-143.7637\"/>\n", + "<polygon fill=\"#a0522d\" stroke=\"#a0522d\" points=\"23.5001,-143.922 27,-153.922 30.5001,-143.9221 23.5001,-143.922\"/>\n", + "<text text-anchor=\"middle\" x=\"21.5\" y=\"-111.9736\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">gt</text>\n", "</g>\n", "</g>\n", "</svg>" @@ -596,7 +618,7 @@ "<Dot visualization: expr_as_graph [(\"gt\",{x,y|x:1..5 & y:1..5 & x>y})]>" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -607,7 +629,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -616,7 +638,7 @@ "Preference changed: DOT_ENGINE = dot\n" ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -627,7 +649,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -636,113 +658,57 @@ "<?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.28.0 (20110509.1545)\n", + "<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n", " -->\n", "<!-- Title: g Pages: 1 -->\n", - "<svg width=\"336pt\" height=\"215pt\"\n", - " viewBox=\"0.00 0.00 336.00 215.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", - "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 211)\">\n", + "<svg width=\"247pt\" height=\"100pt\"\n", + " viewBox=\"0.00 0.00 247.40 100.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 96)\">\n", "<title>g</title>\n", - "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-211 333,-211 333,5 -4,5\"/>\n", + "<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-96 243.397,-96 243.397,4 -4,4\"/>\n", "<!-- Noderoot -->\n", - "<g id=\"node1\" class=\"node\"><title>Noderoot</title>\n", - "<ellipse fill=\"#b3ee3a\" stroke=\"black\" cx=\"29\" cy=\"-50\" rx=\"29.3598\" ry=\"29.3315\"/>\n", - "<text text-anchor=\"middle\" x=\"29\" y=\"-54.2\" font-family=\"Times,serif\" font-size=\"14.00\">=</text>\n", - "<text text-anchor=\"middle\" x=\"29\" y=\"-37.4\" font-family=\"Times,serif\" font-size=\"14.00\"> true</text>\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>Noderoot</title>\n", + "<ellipse fill=\"#b3ee3a\" stroke=\"#000000\" cx=\"29.6985\" cy=\"-46\" rx=\"29.8983\" ry=\"26.7407\"/>\n", + "<text text-anchor=\"middle\" x=\"29.6985\" y=\"-49.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">=</text>\n", + "<text text-anchor=\"middle\" x=\"29.6985\" y=\"-34.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> true</text>\n", "</g>\n", "<!-- Node1 -->\n", - "<g id=\"node2\" class=\"node\"><title>Node1</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"148,-100.602 94,-100.602 94,-59.3981 148,-59.3981 148,-100.602\"/>\n", - "<text text-anchor=\"middle\" x=\"121\" y=\"-84.2\" font-family=\"Times,serif\" font-size=\"14.00\">+</text>\n", - "<text text-anchor=\"middle\" x=\"121\" y=\"-67.4\" font-family=\"Times,serif\" font-size=\"14.00\"> 2</text>\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>Node1</title>\n", + "<polygon fill=\"#ffffff\" stroke=\"#000000\" points=\"149.397,-92 95.397,-92 95.397,-56 149.397,-56 149.397,-92\"/>\n", + "<text text-anchor=\"middle\" x=\"122.397\" y=\"-70.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n", "</g>\n", "<!-- Node1->Noderoot -->\n", - "<g id=\"edge2\" class=\"edge\"><title>Node1->Noderoot</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M93.9683,-71.3228C85.4283,-68.4761 75.7727,-65.2576 66.5999,-62.2\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"67.5052,-58.8125 56.9115,-58.9705 65.2915,-65.4532 67.5052,-58.8125\"/>\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>Node1->Noderoot</title>\n", + "<path fill=\"none\" stroke=\"#000000\" d=\"M95.0857,-65.7505C86.5358,-63.168 76.9398,-60.2694 67.7877,-57.505\"/>\n", + "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"68.6865,-54.1204 58.1016,-54.5793 66.6624,-60.8214 68.6865,-54.1204\"/>\n", "</g>\n", "<!-- Node2 -->\n", - "<g id=\"node4\" class=\"node\"><title>Node2</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"238,-158.602 184,-158.602 184,-117.398 238,-117.398 238,-158.602\"/>\n", - "<text text-anchor=\"middle\" x=\"211\" y=\"-142.2\" font-family=\"Times,serif\" font-size=\"14.00\">*</text>\n", - "<text text-anchor=\"middle\" x=\"211\" y=\"-125.4\" font-family=\"Times,serif\" font-size=\"14.00\"> 2</text>\n", - "</g>\n", - "<!-- Node2->Node1 -->\n", - "<g id=\"edge4\" class=\"edge\"><title>Node2->Node1</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M183.597,-120.598C175.08,-114.984 165.51,-108.677 156.498,-102.737\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"158.357,-99.7706 148.081,-97.1898 154.504,-105.615 158.357,-99.7706\"/>\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>Node2</title>\n", + "<polygon fill=\"#ffffff\" stroke=\"#000000\" points=\"149.397,-38 95.397,-38 95.397,0 149.397,0 149.397,-38\"/>\n", + "<text text-anchor=\"middle\" x=\"122.397\" y=\"-22.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">card</text>\n", + "<text text-anchor=\"middle\" x=\"122.397\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> 2</text>\n", + "</g>\n", + "<!-- Node2->Noderoot -->\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>Node2->Noderoot</title>\n", + "<path fill=\"none\" stroke=\"#000000\" d=\"M95.0857,-26.9549C86.5358,-29.4452 76.9398,-32.2402 67.7877,-34.9059\"/>\n", + "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.7238,-31.5702 58.1016,-37.7271 68.6814,-38.2909 66.7238,-31.5702\"/>\n", "</g>\n", "<!-- Node3 -->\n", - "<g id=\"node6\" class=\"node\"><title>Node3</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"328,-207 274,-207 274,-171 328,-171 328,-207\"/>\n", - "<text text-anchor=\"middle\" x=\"301\" y=\"-184.8\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>Node3</title>\n", + "<polygon fill=\"#ffffff\" stroke=\"#000000\" points=\"239.397,-37 185.397,-37 185.397,-1 239.397,-1 239.397,-37\"/>\n", + "<text text-anchor=\"middle\" x=\"212.397\" y=\"-15.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">{1,2}</text>\n", "</g>\n", "<!-- Node3->Node2 -->\n", - "<g id=\"edge6\" class=\"edge\"><title>Node3->Node2</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M273.597,-173.698C265.168,-168.813 255.707,-163.33 246.776,-158.155\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"248.488,-155.101 238.081,-153.115 244.978,-161.158 248.488,-155.101\"/>\n", - "</g>\n", - "<!-- Node4 -->\n", - "<g id=\"node8\" class=\"node\"><title>Node4</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"328,-153 274,-153 274,-117 328,-117 328,-153\"/>\n", - "<text text-anchor=\"middle\" x=\"301\" y=\"-130.8\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n", - "</g>\n", - "<!-- Node4->Node2 -->\n", - "<g id=\"edge8\" class=\"edge\"><title>Node4->Node2</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M273.597,-135.9C265.607,-136.172 256.689,-136.476 248.176,-136.767\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"247.956,-133.272 238.081,-137.111 248.194,-140.268 247.956,-133.272\"/>\n", - "</g>\n", - "<!-- Node5 -->\n", - "<g id=\"node10\" class=\"node\"><title>Node5</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"238,-98.6019 184,-98.6019 184,-57.3981 238,-57.3981 238,-98.6019\"/>\n", - "<text text-anchor=\"middle\" x=\"211\" y=\"-82.2\" font-family=\"Times,serif\" font-size=\"14.00\">/</text>\n", - "<text text-anchor=\"middle\" x=\"211\" y=\"-65.4\" font-family=\"Times,serif\" font-size=\"14.00\"> 0</text>\n", - "</g>\n", - "<!-- Node5->Node1 -->\n", - "<g id=\"edge10\" class=\"edge\"><title>Node5->Node1</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M183.597,-78.6001C175.607,-78.7817 166.689,-78.9843 158.176,-79.1778\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"157.999,-75.6808 148.081,-79.4072 158.158,-82.679 157.999,-75.6808\"/>\n", - "</g>\n", - "<!-- Node6 -->\n", - "<g id=\"node12\" class=\"node\"><title>Node6</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"328,-98 274,-98 274,-62 328,-62 328,-98\"/>\n", - "<text text-anchor=\"middle\" x=\"301\" y=\"-75.8\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n", - "</g>\n", - "<!-- Node6->Node5 -->\n", - "<g id=\"edge12\" class=\"edge\"><title>Node6->Node5</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M273.597,-79.3999C265.607,-79.2183 256.689,-79.0157 248.176,-78.8222\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"248.158,-75.321 238.081,-78.5928 247.999,-82.3192 248.158,-75.321\"/>\n", - "</g>\n", - "<!-- Node7 -->\n", - "<g id=\"node14\" class=\"node\"><title>Node7</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"328,-44 274,-44 274,-8 328,-8 328,-44\"/>\n", - "<text text-anchor=\"middle\" x=\"301\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n", - "</g>\n", - "<!-- Node7->Node5 -->\n", - "<g id=\"edge14\" class=\"edge\"><title>Node7->Node5</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M273.597,-41.6017C265.168,-46.5827 255.707,-52.1733 246.776,-57.4503\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"244.91,-54.4879 238.081,-62.5885 248.471,-60.5144 244.91,-54.4879\"/>\n", - "</g>\n", - "<!-- Node8 -->\n", - "<g id=\"node16\" class=\"node\"><title>Node8</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"148,-40.6019 94,-40.6019 94,0.601905 148,0.601905 148,-40.6019\"/>\n", - "<text text-anchor=\"middle\" x=\"121\" y=\"-24.2\" font-family=\"Times,serif\" font-size=\"14.00\">card</text>\n", - "<text text-anchor=\"middle\" x=\"121\" y=\"-7.4\" font-family=\"Times,serif\" font-size=\"14.00\"> 2</text>\n", - "</g>\n", - "<!-- Node8->Noderoot -->\n", - "<g id=\"edge16\" class=\"edge\"><title>Node8->Noderoot</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M93.9683,-28.6772C85.4283,-31.5239 75.7727,-34.7424 66.5999,-37.8\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"65.2915,-34.5468 56.9115,-41.0295 67.5052,-41.1875 65.2915,-34.5468\"/>\n", - "</g>\n", - "<!-- Node9 -->\n", - "<g id=\"node18\" class=\"node\"><title>Node9</title>\n", - "<polygon fill=\"white\" stroke=\"black\" points=\"238,-38 184,-38 184,-2 238,-2 238,-38\"/>\n", - "<text text-anchor=\"middle\" x=\"211\" y=\"-15.8\" font-family=\"Times,serif\" font-size=\"14.00\">{1,2}</text>\n", - "</g>\n", - "<!-- Node9->Node8 -->\n", - "<g id=\"edge18\" class=\"edge\"><title>Node9->Node8</title>\n", - "<path fill=\"none\" stroke=\"black\" d=\"M183.597,-20C175.607,-20 166.689,-20 158.176,-20\"/>\n", - "<polygon fill=\"black\" stroke=\"black\" points=\"158.081,-16.5001 148.081,-20 158.081,-23.5001 158.081,-16.5001\"/>\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>Node3->Node2</title>\n", + "<path fill=\"none\" stroke=\"#000000\" d=\"M185.394,-19C177.3693,-19 168.4304,-19 159.8661,-19\"/>\n", + "<polygon fill=\"#000000\" stroke=\"#000000\" points=\"159.692,-15.5001 149.6919,-19 159.6919,-22.5001 159.692,-15.5001\"/>\n", "</g>\n", "</g>\n", "</svg>" @@ -751,7 +717,7 @@ "<Dot visualization: formula_tree [1*2+3/4=card({1,2})]>" ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -759,13 +725,6 @@ "source": [ ":dot formula_tree 1*2 + 3/4 = card({1, 2})" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/notebooks/tests/eval.ipynb b/notebooks/tests/eval.ipynb index d3bc3854db27001ea9223f51170e9024a3b39c83..c1b1ac008e8c5a985af0a28eaa141064d42c5423 100644 --- a/notebooks/tests/eval.ipynb +++ b/notebooks/tests/eval.ipynb @@ -19,10 +19,7 @@ "If the formula is a $\\mathit{TRUE}$ predicate with free variables, the variable values found while solving are displayed." ], "text/plain": [ - "```\n", ":eval FORMULA\n", - "```\n", - "\n", "Evaluate a formula and display the result.\n", "\n", "This is equivalent to inputting the formula without a command name.\n", diff --git a/notebooks/tests/external_functions.ipynb b/notebooks/tests/external_functions.ipynb index 5b579522709f9f4ec2f148019990a5a159ba5ae7..af4fb075bd5161a6308d4a5bcce7b78c6c44a90b 100644 --- a/notebooks/tests/external_functions.ipynb +++ b/notebooks/tests/external_functions.ipynb @@ -31,10 +31,10 @@ { "data": { "text/markdown": [ - "$\\text{\"1.8.1-beta5\"}$" + "$\\text{\"1.8.2-beta2\"}$" ], "text/plain": [ - "\"1.8.1-beta5\"" + "\"1.8.2-beta2\"" ] }, "execution_count": 2, @@ -77,10 +77,10 @@ { "data": { "text/markdown": [ - "$\\text{\"6cab2e5307bb683bbd71b9482804663da21d9ba7\"}$" + "$\\text{\"ce702ba99f667cb03de8ed41ab58ba72db9112c3\"}$" ], "text/plain": [ - "\"6cab2e5307bb683bbd71b9482804663da21d9ba7\"" + "\"ce702ba99f667cb03de8ed41ab58ba72db9112c3\"" ] }, "execution_count": 4, @@ -123,10 +123,10 @@ { "data": { "text/markdown": [ - "$150833600$" + "$150958128$" ], "text/plain": [ - "150833600" + "150958128" ] }, "execution_count": 6, @@ -152,7 +152,7 @@ "outputs": [ { "ename": "CommandExecutionException", - "evalue": ":eval: NOT-WELL-DEFINED: \nUnexpected error while parsing machine: \n\n\nAdditional information: Fehler: Hauptklasse de.prob.cliparser.CliBParser konnte nicht gefunden oder geladen werden\n\n\nJava B parser (probcliparser.jar) is missing from lib directory in: /Users/david/.prob/prob2-3.2.10-SNAPSHOT/\n\n", + "evalue": ":eval: NOT-WELL-DEFINED: \nUnexpected error while parsing machine: \n\n\nAdditional information: Fehler: Hauptklasse de.prob.cliparser.CliBParser konnte nicht gefunden oder geladen werden\n\n\nJava B parser (probcliparser.jar) is missing from lib directory in: /Users/david/.prob/prob2-3.2.11/\n\n", "output_type": "error", "traceback": [ "\u001b[1m\u001b[31m:eval: NOT-WELL-DEFINED: \u001b[0m", @@ -162,7 +162,7 @@ "\u001b[1m\u001b[31mAdditional information: Fehler: Hauptklasse de.prob.cliparser.CliBParser konnte nicht gefunden oder geladen werden\u001b[0m", "\u001b[1m\u001b[31m\u001b[0m", "\u001b[1m\u001b[31m\u001b[0m", - "\u001b[1m\u001b[31mJava B parser (probcliparser.jar) is missing from lib directory in: /Users/david/.prob/prob2-3.2.10-SNAPSHOT/\u001b[0m" + "\u001b[1m\u001b[31mJava B parser (probcliparser.jar) is missing from lib directory in: /Users/david/.prob/prob2-3.2.11/\u001b[0m" ] } ], diff --git a/notebooks/tests/groovy.ipynb b/notebooks/tests/groovy.ipynb index d4838cdce7ea9d15daaa1589e2220a1b73a763a8..81a479ce15669483b6ba441090a3445a2cd56241 100644 --- a/notebooks/tests/groovy.ipynb +++ b/notebooks/tests/groovy.ipynb @@ -17,10 +17,7 @@ "The standard ProB 2 Groovy environment is used to evaluate the expression, so ProB 2's global `api` and `animations` objects may be used to load machines and manipulate traces." ], "text/plain": [ - "```\n", ":groovy EXPRESSION\n", - "```\n", - "\n", "Evaluate the given Groovy expression.\n", "\n", "The standard ProB 2 Groovy environment is used to evaluate the expression, so ProB 2's global `api` and `animations` objects may be used to load machines and manipulate traces." diff --git a/notebooks/tests/help.ipynb b/notebooks/tests/help.ipynb index c37e3a789dedc49cfff5b296ff8f4e63787ded03..d941068d066705085b817b25590a264234e6744e 100644 --- a/notebooks/tests/help.ipynb +++ b/notebooks/tests/help.ipynb @@ -96,10 +96,7 @@ "Display help for a specific command, or general help about the REPL." ], "text/plain": [ - "```\n", ":help [COMMAND]\n", - "```\n", - "\n", "Display help for a specific command, or general help about the REPL." ] }, @@ -131,10 +128,7 @@ "Any number of preference assignments may be included after the file path. Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded." ], "text/plain": [ - "```\n", ":load FILENAME [PREF=VALUE ...]\n", - "```\n", - "\n", "Load the machine from the given path.\n", "\n", "The path is relative to the kernel's current directory (i. e. the directory in which the notebook is located).\n", @@ -173,13 +167,10 @@ "Any number of preference assignments may be included after `::load` (only on the first line). Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded." ], "text/plain": [ - "```\n", "::load [PREF=VALUE ...]\n", "MACHINE\n", "...\n", "END\n", - "```\n", - "\n", "Load the machine source code given in the cell body.\n", "\n", "There must be a newline between the `::load` command name and the machine code.\n", @@ -218,10 +209,7 @@ "Display help for a specific command, or general help about the REPL." ], "text/plain": [ - "```\n", ":help [COMMAND]\n", - "```\n", - "\n", "Display help for a specific command, or general help about the REPL." ] }, @@ -253,10 +241,7 @@ "Any number of preference assignments may be included after the file path. Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded." ], "text/plain": [ - "```\n", ":load FILENAME [PREF=VALUE ...]\n", - "```\n", - "\n", "Load the machine from the given path.\n", "\n", "The path is relative to the kernel's current directory (i. e. the directory in which the notebook is located).\n", diff --git a/notebooks/tests/load_cell.ipynb b/notebooks/tests/load_cell.ipynb index 20c55c7a974f9bcc6366c9cd3f182aea4035cf7c..936659ac6e1800c66b017be8557c1442ee4c9bfd 100644 --- a/notebooks/tests/load_cell.ipynb +++ b/notebooks/tests/load_cell.ipynb @@ -22,13 +22,10 @@ "Any number of preference assignments may be included after `::load` (only on the first line). Preferences can also be changed on a loaded machine using the `:pref` command, however certain preferences do not take full effect when set using `:pref` and must be set when the machine is loaded." ], "text/plain": [ - "```\n", "::load [PREF=VALUE ...]\n", "MACHINE\n", "...\n", "END\n", - "```\n", - "\n", "Load the machine source code given in the cell body.\n", "\n", "There must be a newline between the `::load` command name and the machine code.\n", @@ -164,11 +161,12 @@ "outputs": [ { "ename": "WithSourceCodeException", - "evalue": "de.prob.exception.ProBError: ProB returned error messages:\nError: [1,20] expecting: 'ABSTRACT_CONSTANTS', 'ABSTRACT_VARIABLES', 'ASSERTIONS', 'CONCRETE_CONSTANTS', 'CONCRETE_VARIABLES', 'CONSTANTS', 'CONSTRAINTS', 'DEFINITIONS', 'EXPRESSIONS', 'PREDICATES', 'END', 'EXTENDS', 'IMPORTS', 'INCLUDES', initialisation, 'INVARIANT', 'LOCAL_OPERATIONS', operations, 'PROMOTES', 'PROPERTIES', 'SEES', 'SETS', 'USES', 'VALUES', 'VARIABLES', 'FREETYPES', 'REFERENCES'", + "evalue": "de.prob.exception.ProBError: ProB returned error messages:\nError: [1,20] expecting: 'ABSTRACT_CONSTANTS', 'ABSTRACT_VARIABLES', 'ASSERTIONS', 'CONCRETE_CONSTANTS', 'CONCRETE_VARIABLES', 'CONSTANTS', 'CONSTRAINTS', 'DEFINITIONS', 'EXPRESSIONS', 'PREDICATES', 'END', 'EXTENDS', 'IMPORTS', 'INCLUDES', initialisation, 'INVARIANT', 'LOCAL_OPERATIONS', operations, 'PROMOTES', 'PROPERTIES', 'SEES', 'SETS', 'USES', 'VALUES', 'VARIABLES', 'FREETYPES', 'REFERENCES' ((machine from Jupyter cell):1:20)", "output_type": "error", "traceback": [ "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31mnull\u001b[0m", - "\u001b[1m\u001b[31mError: [1,20] expecting: 'ABSTRACT_CONSTANTS', 'ABSTRACT_VARIABLES', 'ASSERTIONS', 'CONCRETE_CONSTANTS', 'CONCRETE_VARIABLES', 'CONSTANTS', 'CONSTRAINTS', 'DEFINITIONS', 'EXPRESSIONS', 'PREDICATES', 'END', 'EXTENDS', 'IMPORTS', 'INCLUDES', initialisation, 'INVARIANT', 'LOCAL_OPERATIONS', operations, 'PROMOTES', 'PROPERTIES', 'SEES', 'SETS', 'USES', 'VALUES', 'VARIABLES', 'FREETYPES', 'REFERENCES'\u001b[0m" + "\u001b[1m\u001b[31mError: [1,20] expecting: 'ABSTRACT_CONSTANTS', 'ABSTRACT_VARIABLES', 'ASSERTIONS', 'CONCRETE_CONSTANTS', 'CONCRETE_VARIABLES', 'CONSTANTS', 'CONSTRAINTS', 'DEFINITIONS', 'EXPRESSIONS', 'PREDICATES', 'END', 'EXTENDS', 'IMPORTS', 'INCLUDES', initialisation, 'INVARIANT', 'LOCAL_OPERATIONS', operations, 'PROMOTES', 'PROPERTIES', 'SEES', 'SETS', 'USES', 'VALUES', 'VARIABLES', 'FREETYPES', 'REFERENCES' ((machine from Jupyter cell):1:20)\u001b[0m", + "\u001b[1m\u001b[31mError start column 20 out of bounds (0..18)\u001b[0m" ] } ], @@ -192,9 +190,9 @@ "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31mProlog said no.\u001b[0m", "\u001b[1m\u001b[30m2 errors:\u001b[0m", "\u001b[1m\u001b[31mError: Could not infer type of x (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests/(machine from Jupyter cell).mch:2:17 to 2:19)\u001b[0m", - "\u001b[1m\u001b[31mError end column 19 out of bounds (0..18)\u001b[0m", + "\u001b[1m\u001b[31mError end column 19 out of bounds (0..17)\u001b[0m", "\u001b[1m\u001b[31mError: Identifier 'x' declared twice at (Line:Col[:File]) (Line:2 Col:17) and (Line:2 Col:14) (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests/(machine from Jupyter cell).mch:2:17 to 2:19)\u001b[0m", - "\u001b[1m\u001b[31mError end column 19 out of bounds (0..18)\u001b[0m" + "\u001b[1m\u001b[31mError end column 19 out of bounds (0..17)\u001b[0m" ] } ], @@ -219,7 +217,7 @@ "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31mProlog said no.\u001b[0m", "\u001b[1m\u001b[30m3 errors:\u001b[0m", "\u001b[1m\u001b[31mError: Could not infer type of x (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests/(machine from Jupyter cell).mch:2:14 to 2:16)\u001b[0m", - "\u001b[1m\u001b[31mError end column 16 out of bounds (0..15)\u001b[0m", + "\u001b[1m\u001b[31mError end column 16 out of bounds (0..14)\u001b[0m", "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was STRING in '\"string\" ^ \"string\" ^ \"string\"' (/Users/Shared/Uni/SHK/ProB2/prob2-jupyter-kernel/notebooks/tests/(machine from Jupyter cell).mch:3:35 to 5:17)\u001b[0m", "\u001b[1m\u001b[30m PROPERTIES 1 = \"string\" & 1 = (\u001b[0m\u001b[1m\u001b[30m\u001b[41m\"string\"\u001b[0m", "\u001b[1m\u001b[30m\u001b[41m ^ \"string\"\u001b[0m", diff --git a/notebooks/tests/pref.ipynb b/notebooks/tests/pref.ipynb index 692439ad151b92fd37b64ee18ebdb704caf83d44..38d15556e48bcce4700a2f5bec5abb12f40c290e 100644 --- a/notebooks/tests/pref.ipynb +++ b/notebooks/tests/pref.ipynb @@ -20,11 +20,8 @@ "Certain preference changes do not take full effect when performed on a loaded machine. Such preferences must be assigned when the machine is loaded using the `::load` or `:load` command." ], "text/plain": [ - "```\n", ":pref [NAME ...]\n", ":pref NAME=VALUE [NAME=VALUE ...]\n", - "```\n", - "\n", "View or change the value of one or more preferences.\n", "\n", "In the first form, the values of all given preferences are displayed (or all preferences, if none are given). In the second form, the given preference assignments are performed. The two forms cannot be mixed; it is not possible to view and change preferences in a single command.\n", @@ -78,7 +75,7 @@ "DEFAULT_SETSIZE = 2\n", "DETECT_LAMBDAS = false\n", "DISPROVER_MODE = false\n", - "DOT = dot\n", + "DOT = /opt/local/bin/dot\n", "DOT_ARGUMENTS = true\n", "DOT_COLOR_ARC = #006391\n", "DOT_COLOR_NODE = #99BF38\n", @@ -86,6 +83,7 @@ "DOT_COLOR_NODE_GOAL = orange\n", "DOT_COLOR_NODE_OPEN = #F4E3C1\n", "DOT_EDGE_LABELS = true\n", + "DOT_ENGINE = dot\n", "DOT_FUNCTIONS = false\n", "DOT_IDS = false\n", "DOT_INFO = true\n", @@ -144,9 +142,7 @@ "REPL_CACHE_PARSING = false\n", "REPL_UNICODE = false\n", "REQUIRE_OUTPUT_ASSIGNMENT = false\n", - "SFDP = sfdp\n", "SHOW_EVENTB_ANY_VALUES = false\n", - "SHOW_FULL_ERROR_LOCATIONS = true\n", "SMT = false\n", "SMT_SUPPORTED_INTERPRETER = false\n", "SOLVER_STRENGTH = 0\n", @@ -160,6 +156,8 @@ "SYMBOLIC_MC_TRY_OTHER_SOLVERS = false\n", "SYMMETRY_MODE = off\n", "TIME_OUT = 2500\n", + "TK_CUSTOM_STATE_VIEW_FONT_NAME = \n", + "TK_CUSTOM_STATE_VIEW_FONT_SIZE = 0\n", "TK_CUSTOM_STATE_VIEW_PADDING = 0\n", "TK_CUSTOM_STATE_VIEW_STRING_PADDING = 10\n", "TLC_WORKERS = 2\n", diff --git a/notebooks/tests/prettyprint.ipynb b/notebooks/tests/prettyprint.ipynb index 4cdc1fc28a186cf9b28e2c7f592dd4447b05cbfd..76b025e58698bae3a943f0eafc99c69fa0e164b2 100644 --- a/notebooks/tests/prettyprint.ipynb +++ b/notebooks/tests/prettyprint.ipynb @@ -19,10 +19,7 @@ "Expressions cannot be pretty-printed, only predicates." ], "text/plain": [ - "```\n", ":prettyprint PREDICATE\n", - "```\n", - "\n", "Pretty-print a predicate.\n", "\n", "The predicate is not evaluated or simplified, it is only reformatted and converted to Unicode/$\\LaTeX$ form.\n", diff --git a/notebooks/tests/render.ipynb b/notebooks/tests/render.ipynb index b7853e991697b2ade37fd7830ee3793799f74c6b..283f29a3532d72c08be07a84010ff58d90ba8176 100644 --- a/notebooks/tests/render.ipynb +++ b/notebooks/tests/render.ipynb @@ -20,11 +20,8 @@ "The command does not place any restrictions on the MIME type or content. A plain text fallback with the raw content is always included, and will be displayed if the frontend does not support the given MIME type." ], "text/plain": [ - "```\n", "::render MIMETYPE\n", "CONTENT\n", - "```\n", - "\n", "Render some content with the specified MIME type.\n", "\n", "This command is intended for debugging the rendering behavior of Jupyter and the kernel, it should not be used in regular notebooks. To include text or images in a notebook, Markdown cells should be used instead.\n", diff --git a/notebooks/tests/show.ipynb b/notebooks/tests/show.ipynb index 5dacc6b6dfb4234930c0c52a6144909a296027ec..ddaf7debbe0a81588fd50d03cfaeb1b4adf173a3 100644 --- a/notebooks/tests/show.ipynb +++ b/notebooks/tests/show.ipynb @@ -17,10 +17,7 @@ "The visualisation is static, any defined right-click options cannot be viewed or used." ], "text/plain": [ - "```\n", ":show\n", - "```\n", - "\n", "Show the machine's animation function visualisation for the current state.\n", "\n", "The visualisation is static, any defined right-click options cannot be viewed or used." @@ -141,29 +138,29 @@ "text/markdown": [ "<table style=\"font-family:monospace\"><tbody>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"1\" src=\"images/Disc1.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"2\" src=\"images/Disc2.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"3\" src=\"images/Disc3.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"4\" src=\"images/Disc4.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"5\" src=\"images/Disc5.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "</tbody></table>" ], @@ -188,7 +185,7 @@ { "data": { "text/plain": [ - "Executed operation 2: Move(orig,dest,1)" + "Executed operation: Move(orig,dest,1)" ] }, "execution_count": 8, @@ -210,29 +207,29 @@ "text/markdown": [ "<table style=\"font-family:monospace\"><tbody>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"2\" src=\"images/Disc2.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"3\" src=\"images/Disc3.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"4\" src=\"images/Disc4.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"5\" src=\"images/Disc5.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"1\" src=\"images/Disc1.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "</tbody></table>" ], @@ -257,7 +254,7 @@ { "data": { "text/plain": [ - "Executed operation 4: Move(orig,Stakes3,2)" + "Executed operation: Move(orig,Stakes3,2)" ] }, "execution_count": 10, @@ -279,29 +276,29 @@ "text/markdown": [ "<table style=\"font-family:monospace\"><tbody>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"3\" src=\"images/Disc3.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"4\" src=\"images/Disc4.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"5\" src=\"images/Disc5.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"1\" src=\"images/Disc1.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"2\" src=\"images/Disc2.gif\"/></td>\n", "</tr>\n", "</tbody></table>" ], @@ -355,29 +352,29 @@ "text/markdown": [ "<table style=\"font-family:monospace\"><tbody>\n", "<tr>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", + "<td style=\"padding:8px\"><img alt=\"3\" src=\"images/Disc3.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", + "<td style=\"padding:8px\"><img alt=\"4\" src=\"images/Disc4.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"0\" src=\"images/Disc_empty.gif\"/></td>\n", "</tr>\n", "<tr>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", - "<td style=\"padding:8px\"></td>\n", + "<td style=\"padding:8px\"><img alt=\"5\" src=\"images/Disc5.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"1\" src=\"images/Disc1.gif\"/></td>\n", + "<td style=\"padding:8px\"><img alt=\"2\" src=\"images/Disc2.gif\"/></td>\n", "</tr>\n", "</tbody></table>" ], @@ -755,13 +752,13 @@ "</tr>\n", "<tr>\n", "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/small_empty_w.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"1\" src=\"images/small_wqueen_w.gif\"/></td>\n", "</tr>\n", "<tr>\n", "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", - "<td style=\"padding:0px\"></td>\n", + "<td style=\"padding:0px\"><img alt=\"1\" src=\"images/small_wqueen_w.gif\"/></td>\n", + "<td style=\"padding:0px\"><img alt=\"0\" src=\"images/small_empty_w.gif\"/></td>\n", "</tr>\n", "</tbody></table>" ], diff --git a/notebooks/tests/solve.ipynb b/notebooks/tests/solve.ipynb index 6831829d419a04cd3845420c83b826101208f5d2..6a78c898679a57d244a87e5380391f17838e8ce6 100644 --- a/notebooks/tests/solve.ipynb +++ b/notebooks/tests/solve.ipynb @@ -23,10 +23,7 @@ "* `z3`\n" ], "text/plain": [ - "```\n", ":solve SOLVER PREDICATE\n", - "```\n", - "\n", "Solve a predicate with the specified solver.\n", "\n", "The following solvers are currently available:\n", @@ -123,10 +120,10 @@ "outputs": [ { "ename": "ProBError", - "evalue": "(error(existence_error(procedure,:(z3interface,/(pop_frame,0))),existence_error($@(:(z3interface,pop_frame),4375289388),0,procedure,:(z3interface,/(pop_frame,0)),0)))", + "evalue": "(error(existence_error(procedure,:(z3interface,/(pop_frame,0))),existence_error($@(:(z3interface,pop_frame),4531520732),0,procedure,:(z3interface,/(pop_frame,0)),0)))", "output_type": "error", "traceback": [ - "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31m(error(existence_error(procedure,:(z3interface,/(pop_frame,0))),existence_error($@(:(z3interface,pop_frame),4375289388),0,procedure,:(z3interface,/(pop_frame,0)),0)))\u001b[0m" + "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31m(error(existence_error(procedure,:(z3interface,/(pop_frame,0))),existence_error($@(:(z3interface,pop_frame),4531520732),0,procedure,:(z3interface,/(pop_frame,0)),0)))\u001b[0m" ] } ], @@ -168,7 +165,7 @@ { "data": { "text/plain": [ - "Loaded machine: SolveTest : []\n" + "Loaded machine: SolveTest" ] }, "execution_count": 6, diff --git a/notebooks/tests/table.ipynb b/notebooks/tests/table.ipynb index caddf312f0789d4d4ea8852759af5c360ab61106..37f853ecad9f7f1bcd6555f2b34fb7e3c7d31e6e 100644 --- a/notebooks/tests/table.ipynb +++ b/notebooks/tests/table.ipynb @@ -17,10 +17,7 @@ "Although any expression is accepted, this command is most useful for sets of tuples." ], "text/plain": [ - "```\n", ":table EXPRESSION\n", - "```\n", - "\n", "Display an expression as a table.\n", "\n", "Although any expression is accepted, this command is most useful for sets of tuples." diff --git a/notebooks/tests/time.ipynb b/notebooks/tests/time.ipynb index a0e147634d93d339dfa74d8482cbbc7f99afa287..ff5eb7669bfc397acba9ff2a15bbb82a2d63f7af 100644 --- a/notebooks/tests/time.ipynb +++ b/notebooks/tests/time.ipynb @@ -19,10 +19,7 @@ "As with any measurement of execution time, there will likely be small differences between two measurements of the same command. The time is measured by the kernel rather than ProB, so it will include some overhead due to processing of the command by the kernel and communication with ProB." ], "text/plain": [ - "```\n", ":time COMMAND [ARGS ...]\n", - "```\n", - "\n", "Execute the given command and measure how long it takes to execute.\n", "\n", "The time is measured using Java's [`System.nanoTime()`](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--) method. The measured time is displayed with the full number of decimal places, but no guarantees are made about the actual resolution of the time measurement.\n", @@ -54,10 +51,10 @@ { "data": { "text/markdown": [ - "Execution time: 1.054965314 seconds" + "Execution time: 1.029510290 seconds" ], "text/plain": [ - "Execution time: 1.054965314 seconds" + "Execution time: 1.029510290 seconds" ] }, "metadata": {}, @@ -93,10 +90,10 @@ { "data": { "text/markdown": [ - "Execution time: 1.105035884 seconds" + "Execution time: 1.156164498 seconds" ], "text/plain": [ - "Execution time: 1.105035884 seconds" + "Execution time: 1.156164498 seconds" ] }, "metadata": {}, diff --git a/notebooks/tests/trace.ipynb b/notebooks/tests/trace.ipynb index fe26a11fb91e23c0cb0918ae842845ec63d2a686..11f303594509723d88d430274e5f11f3b183dc50 100644 --- a/notebooks/tests/trace.ipynb +++ b/notebooks/tests/trace.ipynb @@ -19,10 +19,7 @@ "The first state (index -1) is always the root state. All other states are reached from the root state by following (previously executed) transitions." ], "text/plain": [ - "```\n", ":trace\n", - "```\n", - "\n", "Display all states and transitions in the current trace.\n", "\n", "Each state has an index, which can be passed to the `:goto` command to go to that state.\n", @@ -58,10 +55,7 @@ "Going backwards in the current trace does *not* discard any parts of the trace, so it is possible to go forward again afterwards. However, executing an operation in a state *will* discard any parts of the trace after that state (and replace them with the destination state of the executed transition)." ], "text/plain": [ - "```\n", ":goto INDEX\n", - "```\n", - "\n", "Go to the state with the specified index in the current trace.\n", "\n", "Use the `:trace` command to view the current trace and the indices of its states. Index -1 refers to the root state and is always available.\n", diff --git a/notebooks/tests/type.ipynb b/notebooks/tests/type.ipynb index 2173cc3699f69e865e5d929166011bd1c21bc726..32a7041af45d258ca05fa0c6658ab3b5540268c4 100644 --- a/notebooks/tests/type.ipynb +++ b/notebooks/tests/type.ipynb @@ -17,10 +17,7 @@ "The returned types are *not* standard B types. They are human-readable, but cannot be used in code." ], "text/plain": [ - "```\n", ":type FORMULA\n", - "```\n", - "\n", "Display the type of a formula.\n", "\n", "The returned types are *not* standard B types. They are human-readable, but cannot be used in code." @@ -229,8 +226,11 @@ "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31mType errors in formula\u001b[0m", "\u001b[1m\u001b[30m3 errors:\u001b[0m", "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was BOOL in 'TRUE' (:1:4 to 1:8)\u001b[0m", + "\u001b[1m\u001b[30m// Source code not known\u001b[0m", "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was STRING in '\"string\"' (:1:10 to 1:16)\u001b[0m", - "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was POW(_A) in '{}' (:1:20 to 1:22)\u001b[0m" + "\u001b[1m\u001b[30m// Source code not known\u001b[0m", + "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was POW(_A) in '{}' (:1:20 to 1:22)\u001b[0m", + "\u001b[1m\u001b[30m// Source code not known\u001b[0m" ] } ], @@ -249,7 +249,8 @@ "output_type": "error", "traceback": [ "\u001b[1m\u001b[30mError from ProB: \u001b[0m\u001b[1m\u001b[31mType errors in formula\u001b[0m", - "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was POW(_A) in '{}' (:1:4 to 1:6)\u001b[0m" + "\u001b[1m\u001b[31mError: Type mismatch: Expected INTEGER, but was POW(_A) in '{}' (:1:4 to 1:6)\u001b[0m", + "\u001b[1m\u001b[30m// Source code not known\u001b[0m" ] } ], diff --git a/notebooks/tests/version.ipynb b/notebooks/tests/version.ipynb index e33dd0f6b79c315f89dbb3b09ee882f714c35fc4..f2945abcff027eec29185d73af4e0c84bc6fb41f 100644 --- a/notebooks/tests/version.ipynb +++ b/notebooks/tests/version.ipynb @@ -15,10 +15,7 @@ "Display version info about the ProB CLI and ProB 2." ], "text/plain": [ - "```\n", ":version\n", - "```\n", - "\n", "Display version info about the ProB CLI and ProB 2." ] }, @@ -39,8 +36,8 @@ { "data": { "text/plain": [ - "ProB CLI: 1.8.1-beta5 (c72b1a169223d7a37e2bc4313a57da091c8e23e7)\n", - "ProB 2: 3.2.10-SNAPSHOT (01c9043ddb8ad69e4e9063a98f0ce132faf030a2)" + "ProB CLI: 1.8.2-beta2 (ce702ba99f667cb03de8ed41ab58ba72db9112c3)\n", + "ProB 2: 3.2.11 (f854ed1becc47dd98c4b75d8b1d5c000d6f9e185)" ] }, "execution_count": 2, diff --git a/notebooks/tutorials/Functional_Programming_in_B.ipynb b/notebooks/tutorials/Functional_Programming_in_B.ipynb index c21b7f75e52a8d6b3317197551c8059f35028a9c..4b09952e1ebb7b4914a93cf6551686bde0d01c3d 100644 --- a/notebooks/tutorials/Functional_Programming_in_B.ipynb +++ b/notebooks/tutorials/Functional_Programming_in_B.ipynb @@ -23,12 +23,12 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\qdot}{\\mathord{\\mkern1mu\\cdot\\mkern1mu}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r2 = \\{1,4,9,16,25,36,49,64,81,100\\}$\n", - "* $f = \\lambdax\\qdot(x \\in INTEGER\\midx * x)$\n", - "* $r1 = 10000000000$" + "* $\\mathit{r2} = \\{1,4,9,16,25,36,49,64,81,100\\}$\n", + "* $\\mathit{f} = \\lambda \\mathit{x}\\qdot(\\mathit{x} \\in \\mathit{INTEGER}\\mid \\mathit{x} * \\mathit{x})$\n", + "* $\\mathit{r1} = 10000000000$" ], "text/plain": [ "TRUE\n", @@ -65,11 +65,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\qdot}{\\mathord{\\mkern1mu\\cdot\\mkern1mu}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r3 = [4,9,25,49,121]$\n", - "* $f = \\lambdax\\qdot(x \\in INTEGER\\midx * x)$" + "* $\\mathit{r3} = [4,9,25,49,121]$\n", + "* $\\mathit{f} = \\lambda \\mathit{x}\\qdot(\\mathit{x} \\in \\mathit{INTEGER}\\mid \\mathit{x} * \\mathit{x})$" ], "text/plain": [ "TRUE\n", @@ -104,11 +104,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\qdot}{\\mathord{\\mkern1mu\\cdot\\mkern1mu}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r4 = 256$\n", - "* $f = \\lambdax\\qdot(x \\in INTEGER\\midx * x)$" + "* $\\mathit{r4} = 256$\n", + "* $\\mathit{f} = \\lambda \\mathit{x}\\qdot(\\mathit{x} \\in \\mathit{INTEGER}\\mid \\mathit{x} * \\mathit{x})$" ], "text/plain": [ "TRUE\n", @@ -143,11 +143,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\qdot}{\\mathord{\\mkern1mu\\cdot\\mkern1mu}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $sqrt = 10$\n", - "* $f = \\lambdax\\qdot(x \\in INTEGER\\midx * x)$" + "* $\\mathit{sqrt} = 10$\n", + "* $\\mathit{f} = \\lambda \\mathit{x}\\qdot(\\mathit{x} \\in \\mathit{INTEGER}\\mid \\mathit{x} * \\mathit{x})$" ], "text/plain": [ "TRUE\n", @@ -182,11 +182,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\cprod}{\\mathbin\\times}\\newcommand{\\cprod}{\\mathbin\\times}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $f = \\{x,y\\midx \\in NATURAL \\land y \\cprod 2 \\geq x \\land (y - 1) \\cprod 2 < x\\}$\n", - "* $r1 = 317$" + "* $\\mathit{f} = \\{\\mathit{x},\\mathit{y}\\mid \\mathit{x} \\in \\mathit{NATURAL} \\land \\mathit{y} \\cprod 2 \\geq \\mathit{x} \\land (\\mathit{y} - 1) \\cprod 2 < \\mathit{x}\\}$\n", + "* $\\mathit{r1} = 317$" ], "text/plain": [ "TRUE\n", @@ -221,15 +221,15 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\cprod}{\\mathbin\\times}\\newcommand{\\cprod}{\\mathbin\\times}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r2 = \\{1,2,3,4\\}$\n", - "* $r3 = [2,2,3,3,4]$\n", - "* $r4 = 2$\n", - "* $sqr = 9802$\n", - "* $f = \\{x,y\\midx \\in NATURAL \\land y \\cprod 2 \\geq x \\land (y - 1) \\cprod 2 < x\\}$\n", - "* $r1 = 317$" + "* $\\mathit{r2} = \\{1,2,3,4\\}$\n", + "* $\\mathit{r3} = [2,2,3,3,4]$\n", + "* $\\mathit{r4} = 2$\n", + "* $\\mathit{sqr} = 9802$\n", + "* $\\mathit{f} = \\{\\mathit{x},\\mathit{y}\\mid \\mathit{x} \\in \\mathit{NATURAL} \\land \\mathit{y} \\cprod 2 \\geq \\mathit{x} \\land (\\mathit{y} - 1) \\cprod 2 < \\mathit{x}\\}$\n", + "* $\\mathit{r1} = 317$" ], "text/plain": [ "TRUE\n", @@ -272,11 +272,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\cprod}{\\mathbin\\times}\\newcommand{\\cprod}{\\mathbin\\times}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $r5 = \\{2,4,10,100\\}$\n", - "* $f = \\{x,y\\midx \\in NATURAL \\land y \\cprod 2 \\geq x \\land (y - 1) \\cprod 2 < x\\}$" + "* $\\mathit{r5} = \\{2,4,10,100\\}$\n", + "* $\\mathit{f} = \\{\\mathit{x},\\mathit{y}\\mid \\mathit{x} \\in \\mathit{NATURAL} \\land \\mathit{y} \\cprod 2 \\geq \\mathit{x} \\land (\\mathit{y} - 1) \\cprod 2 < \\mathit{x}\\}$" ], "text/plain": [ "TRUE\n", @@ -305,52 +305,52 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "|Nr|x|isqrt|\n", - "|---|---|---|\n", - "|1|1|1|\n", - "|2|2|2|\n", - "|3|3|2|\n", - "|4|4|2|\n", - "|5|5|3|\n", - "|6|6|3|\n", - "|7|7|3|\n", - "|8|8|3|\n", - "|9|9|3|\n", - "|10|10|4|\n", - "|11|11|4|\n", - "|12|12|4|\n", - "|13|13|4|\n", - "|14|14|4|\n", - "|15|15|4|\n", - "|16|16|4|\n" + "|x|isqrt|\n", + "|---|---|\n", + "|$1$|$1$|\n", + "|$2$|$2$|\n", + "|$3$|$2$|\n", + "|$4$|$2$|\n", + "|$5$|$3$|\n", + "|$6$|$3$|\n", + "|$7$|$3$|\n", + "|$8$|$3$|\n", + "|$9$|$3$|\n", + "|$10$|$4$|\n", + "|$11$|$4$|\n", + "|$12$|$4$|\n", + "|$13$|$4$|\n", + "|$14$|$4$|\n", + "|$15$|$4$|\n", + "|$16$|$4$|\n" ], "text/plain": [ - "Nr\tx\tisqrt\n", - "1\t1\t1\n", - "2\t2\t2\n", - "3\t3\t2\n", - "4\t4\t2\n", - "5\t5\t3\n", - "6\t6\t3\n", - "7\t7\t3\n", - "8\t8\t3\n", - "9\t9\t3\n", - "10\t10\t4\n", - "11\t11\t4\n", - "12\t12\t4\n", - "13\t13\t4\n", - "14\t14\t4\n", - "15\t15\t4\n", - "16\t16\t4\n" + "x\tisqrt\n", + "1\t1\n", + "2\t2\n", + "3\t2\n", + "4\t2\n", + "5\t3\n", + "6\t3\n", + "7\t3\n", + "8\t3\n", + "9\t3\n", + "10\t4\n", + "11\t4\n", + "12\t4\n", + "13\t4\n", + "14\t4\n", + "15\t4\n", + "16\t4\n" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -361,7 +361,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -373,7 +373,7 @@ "f = λx.(x ∈ ℤ|x * x) ∧ r1 = f(100000) ∧ r2 = f[1 ‥ 10]" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -383,13 +383,6 @@ "r1 = f(100000) &\n", "r2 = f[1..10] " ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -399,8 +392,9 @@ "name": "prob2" }, "language_info": { + "codemirror_mode": "prob2_jupyter_repl", "file_extension": ".prob", - "mimetype": "text/x-prob", + "mimetype": "text/x-prob2-jupyter-repl", "name": "prob" } }, diff --git a/notebooks/tutorials/prob_solver_intro.ipynb b/notebooks/tutorials/prob_solver_intro.ipynb index 85b339ba32413ac4dbd463744c41f2d685be1c14..512fcd47e6f698b480776e8858c6837b7ec7a4ac 100644 --- a/notebooks/tutorials/prob_solver_intro.ipynb +++ b/notebooks/tutorials/prob_solver_intro.ipynb @@ -80,7 +80,7 @@ { "data": { "text/markdown": [ - "$TRUE$" + "$\\mathit{TRUE}$" ], "text/plain": [ "TRUE" @@ -111,10 +111,10 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $x = -10$" + "* $\\mathit{x} = -10$" ], "text/plain": [ "TRUE\n", @@ -179,17 +179,17 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $R = 8$\n", - "* $S = 9$\n", - "* $D = 7$\n", - "* $E = 5$\n", - "* $Y = 2$\n", - "* $M = 1$\n", - "* $N = 6$\n", - "* $O = 0$" + "* $\\mathit{R} = 8$\n", + "* $\\mathit{S} = 9$\n", + "* $\\mathit{D} = 7$\n", + "* $\\mathit{E} = 5$\n", + "* $\\mathit{Y} = 2$\n", + "* $\\mathit{M} = 1$\n", + "* $\\mathit{N} = 6$\n", + "* $\\mathit{O} = 0$" ], "text/plain": [ "TRUE\n", @@ -234,17 +234,17 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $R = 0$\n", - "* $S = 9$\n", - "* $D = 0$\n", - "* $E = 0$\n", - "* $Y = 0$\n", - "* $M = 1$\n", - "* $N = 0$\n", - "* $O = 0$" + "* $\\mathit{R} = 0$\n", + "* $\\mathit{S} = 9$\n", + "* $\\mathit{D} = 0$\n", + "* $\\mathit{E} = 0$\n", + "* $\\mathit{Y} = 0$\n", + "* $\\mathit{M} = 1$\n", + "* $\\mathit{N} = 0$\n", + "* $\\mathit{O} = 0$" ], "text/plain": [ "TRUE\n", @@ -324,16 +324,16 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $P = 4$\n", - "* $A = 1$\n", - "* $S = 3$\n", - "* $I = 0$\n", - "* $K = 2$\n", - "* $N = 9$\n", - "* $O = 8$" + "* $\\mathit{P} = 4$\n", + "* $\\mathit{A} = 1$\n", + "* $\\mathit{S} = 3$\n", + "* $\\mathit{I} = 0$\n", + "* $\\mathit{K} = 2$\n", + "* $\\mathit{N} = 9$\n", + "* $\\mathit{O} = 8$" ], "text/plain": [ "TRUE\n", @@ -377,11 +377,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $queens = \\{(1\\mapsto 1),(2\\mapsto 5),(3\\mapsto 8),(4\\mapsto 6),(5\\mapsto 3),(6\\mapsto 7),(7\\mapsto 2),(8\\mapsto 4)\\}$\n", - "* $n = 8$" + "* $\\mathit{queens} = \\{(1\\mapsto 1),(2\\mapsto 5),(3\\mapsto 8),(4\\mapsto 6),(5\\mapsto 3),(6\\mapsto 7),(7\\mapsto 2),(8\\mapsto 4)\\}$\n", + "* $\\mathit{n} = 8$" ], "text/plain": [ "TRUE\n", @@ -412,27 +412,27 @@ { "data": { "text/markdown": [ - "|Nr|prj1|prj2|\n", - "|---|---|---|\n", - "|1|1|1|\n", - "|2|2|5|\n", - "|3|3|8|\n", - "|4|4|6|\n", - "|5|5|3|\n", - "|6|6|7|\n", - "|7|7|2|\n", - "|8|8|4|\n" + "|prj1|prj2|\n", + "|---|---|\n", + "|$1$|$1$|\n", + "|$2$|$5$|\n", + "|$3$|$8$|\n", + "|$4$|$6$|\n", + "|$5$|$3$|\n", + "|$6$|$7$|\n", + "|$7$|$2$|\n", + "|$8$|$4$|\n" ], "text/plain": [ - "Nr\tprj1\tprj2\n", - "1\t1\t1\n", - "2\t2\t5\n", - "3\t3\t8\n", - "4\t4\t6\n", - "5\t5\t3\n", - "6\t6\t7\n", - "7\t7\t2\n", - "8\t8\t4\n" + "prj1\tprj2\n", + "1\t1\n", + "2\t5\n", + "3\t8\n", + "4\t6\n", + "5\t3\n", + "6\t7\n", + "7\t2\n", + "8\t4\n" ] }, "execution_count": 11, @@ -452,11 +452,11 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $queens = \\{(1\\mapsto 1),(2\\mapsto 3),(3\\mapsto 5),(4\\mapsto 13),(5\\mapsto 11),(6\\mapsto 4),(7\\mapsto 15),(8\\mapsto 7),(9\\mapsto 16),(10\\mapsto 14),(11\\mapsto 2),(12\\mapsto 8),(13\\mapsto 6),(14\\mapsto 9),(15\\mapsto 12),(16\\mapsto 10)\\}$\n", - "* $n = 16$" + "* $\\mathit{queens} = \\{(1\\mapsto 1),(2\\mapsto 3),(3\\mapsto 5),(4\\mapsto 13),(5\\mapsto 11),(6\\mapsto 4),(7\\mapsto 15),(8\\mapsto 7),(9\\mapsto 16),(10\\mapsto 14),(11\\mapsto 2),(12\\mapsto 8),(13\\mapsto 6),(14\\mapsto 9),(15\\mapsto 12),(16\\mapsto 10)\\}$\n", + "* $\\mathit{n} = 16$" ], "text/plain": [ "TRUE\n", @@ -505,12 +505,12 @@ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $A = TRUE$\n", - "* $B = TRUE$\n", - "* $C = FALSE$" + "* $\\mathit{A} = \\mathit{TRUE}$\n", + "* $\\mathit{B} = \\mathit{TRUE}$\n", + "* $\\mathit{C} = \\mathit{FALSE}$" ], "text/plain": [ "TRUE\n", @@ -547,7 +547,7 @@ { "data": { "text/markdown": [ - "$\\{((TRUE\\mapsto TRUE)\\mapsto FALSE)\\}$" + "$\\{((\\mathit{TRUE}\\mapsto \\mathit{TRUE})\\mapsto \\mathit{FALSE})\\}$" ], "text/plain": [ "{((TRUE↦TRUE)↦FALSE)}" @@ -566,22 +566,22 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "|Nr|A|B|C|\n", - "|---|---|---|---|\n", - "|1|TRUE|TRUE|FALSE|\n" + "|A|B|C|\n", + "|---|---|---|\n", + "|$\\mathit{TRUE}$|$\\mathit{TRUE}$|$\\mathit{FALSE}$|\n" ], "text/plain": [ - "Nr\tA\tB\tC\n", - "1\tTRUE\tTRUE\tFALSE\n" + "A\tB\tC\n", + "TRUE\tTRUE\tFALSE\n" ] }, - "execution_count": 20, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -600,18 +600,18 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\newcommand{\\upto}{\\mathbin{.\\mkern1mu.}}\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $DOM = (1 \\ldots 9)$\n", - "* $Board = \\{(1\\mapsto\\{(1\\mapsto 7),(2\\mapsto 8),(3\\mapsto 1),(4\\mapsto 6),(5\\mapsto 3),(6\\mapsto 2),(7\\mapsto 9),(8\\mapsto 4),(9\\mapsto 5)\\}),(2\\mapsto\\{(1\\mapsto 9),(2\\mapsto 5),(3\\mapsto 2),(4\\mapsto 7),(5\\mapsto 1),(6\\mapsto 4),(7\\mapsto 6),(8\\mapsto 3),(9\\mapsto 8)\\}),(3\\mapsto\\{(1\\mapsto 4),(2\\mapsto 3),(3\\mapsto 6),(4\\mapsto 8),(5\\mapsto 9),(6\\mapsto 5),(7\\mapsto 7),(8\\mapsto 1),(9\\mapsto 2)\\}),(4\\mapsto\\{(1\\mapsto 2),(2\\mapsto 4),(3\\mapsto 9),(4\\mapsto 3),(5\\mapsto 7),(6\\mapsto 6),(7\\mapsto 8),(8\\mapsto 5),(9\\mapsto 1)\\}),(5\\mapsto\\{(1\\mapsto 6),(2\\mapsto 7),(3\\mapsto 3),(4\\mapsto 5),(5\\mapsto 8),(6\\mapsto 1),(7\\mapsto 2),(8\\mapsto 9),(9\\mapsto 4)\\}),(6\\mapsto\\{(1\\mapsto 5),(2\\mapsto 1),(3\\mapsto 8),(4\\mapsto 4),(5\\mapsto 2),(6\\mapsto 9),(7\\mapsto 3),(8\\mapsto 6),(9\\mapsto 7)\\}),(7\\mapsto\\{(1\\mapsto 1),(2\\mapsto 9),(3\\mapsto 4),(4\\mapsto 2),(5\\mapsto 6),(6\\mapsto 7),(7\\mapsto 5),(8\\mapsto 8),(9\\mapsto 3)\\}),(8\\mapsto\\{(1\\mapsto 8),(2\\mapsto 6),(3\\mapsto 7),(4\\mapsto 1),(5\\mapsto 5),(6\\mapsto 3),(7\\mapsto 4),(8\\mapsto 2),(9\\mapsto 9)\\}),(9\\mapsto\\{(1\\mapsto 3),(2\\mapsto 2),(3\\mapsto 5),(4\\mapsto 9),(5\\mapsto 4),(6\\mapsto 8),(7\\mapsto 1),(8\\mapsto 7),(9\\mapsto 6)\\})\\}$\n", - "* $SUBSQ = \\{\\{1,2,3\\},\\{4,5,6\\},\\{7,8,9\\}\\}$" + "* $\\mathit{DOM} = (1 \\upto 9)$\n", + "* $\\mathit{Board} = \\{(1\\mapsto\\{(1\\mapsto 7),(2\\mapsto 8),(3\\mapsto 1),(4\\mapsto 6),(5\\mapsto 3),(6\\mapsto 2),(7\\mapsto 9),(8\\mapsto 4),(9\\mapsto 5)\\}),(2\\mapsto\\{(1\\mapsto 9),(2\\mapsto 5),(3\\mapsto 2),(4\\mapsto 7),(5\\mapsto 1),(6\\mapsto 4),(7\\mapsto 6),(8\\mapsto 3),(9\\mapsto 8)\\}),(3\\mapsto\\{(1\\mapsto 4),(2\\mapsto 3),(3\\mapsto 6),(4\\mapsto 8),(5\\mapsto 9),(6\\mapsto 5),(7\\mapsto 7),(8\\mapsto 1),(9\\mapsto 2)\\}),(4\\mapsto\\{(1\\mapsto 2),(2\\mapsto 4),(3\\mapsto 9),(4\\mapsto 3),(5\\mapsto 7),(6\\mapsto 6),(7\\mapsto 8),(8\\mapsto 5),(9\\mapsto 1)\\}),(5\\mapsto\\{(1\\mapsto 6),(2\\mapsto 7),(3\\mapsto 3),(4\\mapsto 5),(5\\mapsto 8),(6\\mapsto 1),(7\\mapsto 2),(8\\mapsto 9),(9\\mapsto 4)\\}),(6\\mapsto\\{(1\\mapsto 5),(2\\mapsto 1),(3\\mapsto 8),(4\\mapsto 4),(5\\mapsto 2),(6\\mapsto 9),(7\\mapsto 3),(8\\mapsto 6),(9\\mapsto 7)\\}),(7\\mapsto\\{(1\\mapsto 1),(2\\mapsto 9),(3\\mapsto 4),(4\\mapsto 2),(5\\mapsto 6),(6\\mapsto 7),(7\\mapsto 5),(8\\mapsto 8),(9\\mapsto 3)\\}),(8\\mapsto\\{(1\\mapsto 8),(2\\mapsto 6),(3\\mapsto 7),(4\\mapsto 1),(5\\mapsto 5),(6\\mapsto 3),(7\\mapsto 4),(8\\mapsto 2),(9\\mapsto 9)\\}),(9\\mapsto\\{(1\\mapsto 3),(2\\mapsto 2),(3\\mapsto 5),(4\\mapsto 9),(5\\mapsto 4),(6\\mapsto 8),(7\\mapsto 1),(8\\mapsto 7),(9\\mapsto 6)\\})\\}$\n", + "* $\\mathit{SUBSQ} = \\{\\{1,2,3\\},\\{4,5,6\\},\\{7,8,9\\}\\}$" ], "text/plain": [ "TRUE\n", @@ -622,7 +622,7 @@ "\tSUBSQ = {{1,2,3},{4,5,6},{7,8,9}}" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -673,17 +673,17 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $stolen = \\{(16\\mapsto 2),(17\\mapsto 4),(23\\mapsto 0),(24\\mapsto 0),(39\\mapsto 0),(40\\mapsto 0)\\}$\n", - "* $coins = \\{16,17,23,24,39,40\\}$" + "* $\\mathit{stolen} = \\{(16\\mapsto 2),(17\\mapsto 4),(23\\mapsto 0),(24\\mapsto 0),(39\\mapsto 0),(40\\mapsto 0)\\}$\n", + "* $\\mathit{coins} = \\{16,17,23,24,39,40\\}$" ], "text/plain": [ "TRUE\n", @@ -693,7 +693,7 @@ "\tcoins = {16,17,23,24,39,40}" ] }, - "execution_count": 16, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -713,20 +713,20 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $Persons = \\{\"Agatha\",\"Charles\",\"butler\"\\}$\n", - "* $richer = \\{(\"Agatha\"\\mapsto\"Charles\"),(\"butler\"\\mapsto\"Agatha\"),(\"butler\"\\mapsto\"Charles\")\\}$\n", - "* $victim = \"Agatha\"$\n", - "* $killer = \"Agatha\"$\n", - "* $hates = \\{(\"Agatha\"\\mapsto\"Agatha\"),(\"Agatha\"\\mapsto\"Charles\"),(\"Charles\"\\mapsto\"butler\"),(\"butler\"\\mapsto\"Agatha\"),(\"butler\"\\mapsto\"Charles\")\\}$" + "* $\\mathit{Persons} = \\{\\text{\"Agatha\"},\\text{\"Charles\"},\\text{\"butler\"}\\}$\n", + "* $\\mathit{richer} = \\{(\\text{\"Agatha\"}\\mapsto\\text{\"Charles\"}),(\\text{\"butler\"}\\mapsto\\text{\"Agatha\"}),(\\text{\"butler\"}\\mapsto\\text{\"Charles\"})\\}$\n", + "* $\\mathit{victim} = \\text{\"Agatha\"}$\n", + "* $\\mathit{killer} = \\text{\"Agatha\"}$\n", + "* $\\mathit{hates} = \\{(\\text{\"Agatha\"}\\mapsto\\text{\"Agatha\"}),(\\text{\"Agatha\"}\\mapsto\\text{\"Charles\"}),(\\text{\"Charles\"}\\mapsto\\text{\"butler\"}),(\\text{\"butler\"}\\mapsto\\text{\"Agatha\"}),(\\text{\"butler\"}\\mapsto\\text{\"Charles\"})\\}$" ], "text/plain": [ "TRUE\n", @@ -739,7 +739,7 @@ "\thates = {(\"Agatha\"↦\"Agatha\"),(\"Agatha\"↦\"Charles\"),(\"Charles\"↦\"butler\"),(\"butler\"↦\"Agatha\"),(\"butler\"↦\"Charles\")}" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -775,18 +775,18 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $a = \\{(1\\mapsto 0),(2\\mapsto 2),(3\\mapsto 6),(4\\mapsto 9),(5\\mapsto 14),(6\\mapsto 24),(7\\mapsto 25)\\}$\n", - "* $len = 25$\n", - "* $n = 7$" + "* $\\mathit{a} = \\{(1\\mapsto 0),(2\\mapsto 2),(3\\mapsto 6),(4\\mapsto 9),(5\\mapsto 14),(6\\mapsto 24),(7\\mapsto 25)\\}$\n", + "* $\\mathit{len} = 25$\n", + "* $\\mathit{n} = 7$" ], "text/plain": [ "TRUE\n", @@ -797,7 +797,7 @@ "\tn = 7" ] }, - "execution_count": 18, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -818,26 +818,26 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "$TRUE$\n", + "$\\mathit{TRUE}$\n", "\n", "**Solution:**\n", - "* $n1 = \"a\"$\n", - "* $iso = \\{(1\\mapsto\"c\"),(2\\mapsto\"a\"),(3\\mapsto\"b\")\\}$\n", - "* $n2 = \"b\"$\n", - "* $n3 = \"c\"$\n", - "* $V = \\{1,2,3\\}$\n", - "* $g1 = \\{(1\\mapsto 2),(1\\mapsto 3),(2\\mapsto 3)\\}$\n", - "* $g2 = \\{(\"a\"\\mapsto\"b\"),(\"c\"\\mapsto\"a\"),(\"c\"\\mapsto\"b\")\\}$\n", - "* $v1 = 1$\n", - "* $v2 = 2$\n", - "* $v3 = 3$\n", - "* $N = \\{\"a\",\"b\",\"c\"\\}$" + "* $\\mathit{n1} = \\text{\"a\"}$\n", + "* $\\mathit{iso} = \\{(1\\mapsto\\text{\"c\"}),(2\\mapsto\\text{\"a\"}),(3\\mapsto\\text{\"b\"})\\}$\n", + "* $\\mathit{n2} = \\text{\"b\"}$\n", + "* $\\mathit{n3} = \\text{\"c\"}$\n", + "* $\\mathit{V} = \\{1,2,3\\}$\n", + "* $\\mathit{g1} = \\{(1\\mapsto 2),(1\\mapsto 3),(2\\mapsto 3)\\}$\n", + "* $\\mathit{g2} = \\{(\\text{\"a\"}\\mapsto\\text{\"b\"}),(\\text{\"c\"}\\mapsto\\text{\"a\"}),(\\text{\"c\"}\\mapsto\\text{\"b\"})\\}$\n", + "* $\\mathit{v1} = 1$\n", + "* $\\mathit{v2} = 2$\n", + "* $\\mathit{v3} = 3$\n", + "* $\\mathit{N} = \\{\\text{\"a\"},\\text{\"b\"},\\text{\"c\"}\\}$" ], "text/plain": [ "TRUE\n", @@ -856,7 +856,7 @@ "\tN = {\"a\",\"b\",\"c\"}" ] }, - "execution_count": 19, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -880,7 +880,7 @@ { "data": { "text/markdown": [ - "$\"abc\"$" + "$\\text{\"abc\"}$" ], "text/plain": [ "\"abc\"" @@ -894,13 +894,6 @@ "source": [ "\"abc\"" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {