diff --git a/docs/notebooks/functionDemonstration.ipynb b/docs/notebooks/functionDemonstration.ipynb index e0aadfbb7..06d0cd213 100644 --- a/docs/notebooks/functionDemonstration.ipynb +++ b/docs/notebooks/functionDemonstration.ipynb @@ -3,8 +3,8 @@ { "cell_type": "markdown", "metadata": { - "colab_type": "text", - "id": "view-in-github" + "id": "view-in-github", + "colab_type": "text" }, "source": [ "\"Open" @@ -21,19 +21,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/", - "height": 139 + "height": 138 }, "id": "LXXtCG_TAc82", - "outputId": "96847a67-34c8-4678-e519-96cd5b9345e2" + "outputId": "cfd1cec5-6faf-4533-dcf1-e1a13a0cfc3e" }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "Installing Conjure version v2.5.0 and Conjure Notebook version v0.0.8...\n", "Downloading...\n", @@ -43,18 +43,231 @@ ] }, { + "output_type": "display_data", "data": { - "application/javascript": "\"use strict\";\n\nCodeMirror.defineMode(\"text/conjure\", function (config) {\n\n var isOperatorChar = /[+\\-*=<>%^\\/]/;\n\n var keywords = {\n \"forall\": true,\n \"allDifferent\": true,\n \"allDiff\": true,\n \"alldifferent_except\": true,\n \"dim\": true,\n \"toSet\": true,\n \"toMSet\": true,\n \"toRelation\": true,\n \"maximising\": true,\n \"minimising\": true,\n \"forAll\": true,\n \"exists\": true,\n \"toInt\": true,\n \"sum\": true,\n \"be\": true,\n \"bijective\": true,\n \"bool\": true,\n \"by\": true,\n \"complete\": true,\n \"defined\": true,\n \"domain\": true,\n \"in\": true,\n \"or\": true,\n \"and\": true,\n \"false\": true,\n \"find\": true,\n \"from\": true,\n \"function\": true,\n \"given\": true,\n \"image\": true,\n \"indexed\": true,\n \"injective\": true,\n \"int\": true,\n \"intersect\": true,\n \"freq\": true,\n \"lambda\": true,\n \"language\": true,\n \"letting\": true,\n \"matrix\": true,\n \"maxNumParts\": true,\n \"maxOccur\": true,\n \"maxPartSize\": true,\n \"maxSize\": true,\n \"minNumParts\": true,\n \"minOccur\": true,\n \"minPartSize\": true,\n \"minSize\": true,\n \"mset\": true,\n \"numParts\": true,\n \"of\": true,\n \"partial\": true,\n \"partition\": true,\n \"partSize\": true,\n \"preImage\": true,\n \"quantifier\": true,\n \"range\": true,\n \"regular\": true,\n \"relation\": true,\n \"representation\": true,\n \"set\": true,\n \"size\": true,\n \"subset\": true,\n \"subsetEq\": true,\n \"such\": true,\n \"supset\": true,\n \"supsetEq\": true,\n \"surjective\": true,\n \"that\": true,\n \"together\": true,\n \"enum\": true,\n \"total\": true,\n \"true\": true,\n \"new\": true,\n \"type\": true,\n \"tuple\": true,\n \"union\": true,\n \"where\": true,\n \"branching\": true,\n \"on\": true\n }; \n var punc = \":;,.(){}[]\";\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"') {\n state.tokenize.push(tokenString);\n return tokenString(stream, state);\n }\n if (/[\\d\\.]/.test(ch)) {\n if (ch == \".\") {\n stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n } else if (ch == \"0\") {\n stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n } else {\n stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n }\n return \"number\";\n }\n if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize.push(tokenComment);\n return tokenComment(stream, state);\n }\n }\n if (ch == \"$\") {\n stream.skipToEnd();\n return \"comment\";\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n if (punc.indexOf(ch) > -1) {\n return \"punctuation\";\n }\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n var cur = stream.current();\n \n if (keywords.propertyIsEnumerable(cur)) {\n return \"keyword\";\n }\n return \"variable\";\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize.pop();\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return \"comment\";\n }\n\n function tokenUntilClosingParen() {\n var depth = 0;\n return function (stream, state, prev) {\n var inner = tokenBase(stream, state, prev);\n console.log(\"untilClosing\", inner, stream.current());\n if (inner == \"punctuation\") {\n if (stream.current() == \"(\") {\n ++depth;\n } else if (stream.current() == \")\") {\n if (depth == 0) {\n stream.backUp(1)\n state.tokenize.pop()\n return state.tokenize[state.tokenize.length - 1](stream, state)\n } else {\n --depth;\n }\n }\n }\n return inner;\n }\n }\n\n function tokenString(stream, state) {\n var escaped = false, next, end = false;\n while ((next = stream.next()) != null) {\n if (next == '(' && escaped) {\n state.tokenize.push(tokenUntilClosingParen());\n return \"string\";\n }\n if (next == '\"' && !escaped) { end = true; break; }\n escaped = !escaped && next == \"\\\\\";\n }\n if (end || !escaped)\n state.tokenize.pop();\n return \"string\";\n }\n\n return {\n startState: function (basecolumn) {\n return {\n tokenize: []\n };\n },\n\n token: function (stream, state) {\n if (stream.eatSpace()) return null;\n var style = (state.tokenize[state.tokenize.length - 1] || tokenBase)(stream, state);\n console.log(\"token\", style);\n return style;\n },\n\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n lineComment: \"$\"\n };\n});\n\n\nCodeMirror.defineMIME(\"text/conjure\", \"text/conjure\");\n\nrequire(['notebook/js/codecell'], function (codecell) {\n codecell.CodeCell.options_default.highlight_modes['magic_text/conjure'] = { 'reg': [/%?%conjure/] };\n Jupyter.notebook.events.one('kernel_ready.Kernel', function () {\n Jupyter.notebook.get_cells().map(function (cell) {\n if (cell.cell_type == 'code') { cell.auto_highlight(); }\n });\n });\n});\n\n", "text/plain": [ "" + ], + "application/javascript": [ + "\"use strict\";\n", + "\n", + "CodeMirror.defineMode(\"text/conjure\", function (config) {\n", + "\n", + " var isOperatorChar = /[+\\-*=<>%^\\/]/;\n", + "\n", + " var keywords = {\n", + " \"forall\": true,\n", + " \"allDifferent\": true,\n", + " \"allDiff\": true,\n", + " \"alldifferent_except\": true,\n", + " \"dim\": true,\n", + " \"toSet\": true,\n", + " \"toMSet\": true,\n", + " \"toRelation\": true,\n", + " \"maximising\": true,\n", + " \"minimising\": true,\n", + " \"forAll\": true,\n", + " \"exists\": true,\n", + " \"toInt\": true,\n", + " \"sum\": true,\n", + " \"be\": true,\n", + " \"bijective\": true,\n", + " \"bool\": true,\n", + " \"by\": true,\n", + " \"complete\": true,\n", + " \"defined\": true,\n", + " \"domain\": true,\n", + " \"in\": true,\n", + " \"or\": true,\n", + " \"and\": true,\n", + " \"false\": true,\n", + " \"find\": true,\n", + " \"from\": true,\n", + " \"function\": true,\n", + " \"given\": true,\n", + " \"image\": true,\n", + " \"indexed\": true,\n", + " \"injective\": true,\n", + " \"int\": true,\n", + " \"intersect\": true,\n", + " \"freq\": true,\n", + " \"lambda\": true,\n", + " \"language\": true,\n", + " \"letting\": true,\n", + " \"matrix\": true,\n", + " \"maxNumParts\": true,\n", + " \"maxOccur\": true,\n", + " \"maxPartSize\": true,\n", + " \"maxSize\": true,\n", + " \"minNumParts\": true,\n", + " \"minOccur\": true,\n", + " \"minPartSize\": true,\n", + " \"minSize\": true,\n", + " \"mset\": true,\n", + " \"numParts\": true,\n", + " \"of\": true,\n", + " \"partial\": true,\n", + " \"partition\": true,\n", + " \"partSize\": true,\n", + " \"preImage\": true,\n", + " \"quantifier\": true,\n", + " \"range\": true,\n", + " \"regular\": true,\n", + " \"relation\": true,\n", + " \"representation\": true,\n", + " \"set\": true,\n", + " \"size\": true,\n", + " \"subset\": true,\n", + " \"subsetEq\": true,\n", + " \"such\": true,\n", + " \"supset\": true,\n", + " \"supsetEq\": true,\n", + " \"surjective\": true,\n", + " \"that\": true,\n", + " \"together\": true,\n", + " \"enum\": true,\n", + " \"total\": true,\n", + " \"true\": true,\n", + " \"new\": true,\n", + " \"type\": true,\n", + " \"tuple\": true,\n", + " \"union\": true,\n", + " \"where\": true,\n", + " \"branching\": true,\n", + " \"on\": true\n", + " }; \n", + " var punc = \":;,.(){}[]\";\n", + "\n", + " function tokenBase(stream, state) {\n", + " var ch = stream.next();\n", + " if (ch == '\"') {\n", + " state.tokenize.push(tokenString);\n", + " return tokenString(stream, state);\n", + " }\n", + " if (/[\\d\\.]/.test(ch)) {\n", + " if (ch == \".\") {\n", + " stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n", + " } else if (ch == \"0\") {\n", + " stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n", + " } else {\n", + " stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n", + " }\n", + " return \"number\";\n", + " }\n", + " if (ch == \"/\") {\n", + " if (stream.eat(\"*\")) {\n", + " state.tokenize.push(tokenComment);\n", + " return tokenComment(stream, state);\n", + " }\n", + " }\n", + " if (ch == \"$\") {\n", + " stream.skipToEnd();\n", + " return \"comment\";\n", + " }\n", + " if (isOperatorChar.test(ch)) {\n", + " stream.eatWhile(isOperatorChar);\n", + " return \"operator\";\n", + " }\n", + " if (punc.indexOf(ch) > -1) {\n", + " return \"punctuation\";\n", + " }\n", + " stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n", + " var cur = stream.current();\n", + " \n", + " if (keywords.propertyIsEnumerable(cur)) {\n", + " return \"keyword\";\n", + " }\n", + " return \"variable\";\n", + " }\n", + "\n", + " function tokenComment(stream, state) {\n", + " var maybeEnd = false, ch;\n", + " while (ch = stream.next()) {\n", + " if (ch == \"/\" && maybeEnd) {\n", + " state.tokenize.pop();\n", + " break;\n", + " }\n", + " maybeEnd = (ch == \"*\");\n", + " }\n", + " return \"comment\";\n", + " }\n", + "\n", + " function tokenUntilClosingParen() {\n", + " var depth = 0;\n", + " return function (stream, state, prev) {\n", + " var inner = tokenBase(stream, state, prev);\n", + " console.log(\"untilClosing\", inner, stream.current());\n", + " if (inner == \"punctuation\") {\n", + " if (stream.current() == \"(\") {\n", + " ++depth;\n", + " } else if (stream.current() == \")\") {\n", + " if (depth == 0) {\n", + " stream.backUp(1)\n", + " state.tokenize.pop()\n", + " return state.tokenize[state.tokenize.length - 1](stream, state)\n", + " } else {\n", + " --depth;\n", + " }\n", + " }\n", + " }\n", + " return inner;\n", + " }\n", + " }\n", + "\n", + " function tokenString(stream, state) {\n", + " var escaped = false, next, end = false;\n", + " while ((next = stream.next()) != null) {\n", + " if (next == '(' && escaped) {\n", + " state.tokenize.push(tokenUntilClosingParen());\n", + " return \"string\";\n", + " }\n", + " if (next == '\"' && !escaped) { end = true; break; }\n", + " escaped = !escaped && next == \"\\\\\";\n", + " }\n", + " if (end || !escaped)\n", + " state.tokenize.pop();\n", + " return \"string\";\n", + " }\n", + "\n", + " return {\n", + " startState: function (basecolumn) {\n", + " return {\n", + " tokenize: []\n", + " };\n", + " },\n", + "\n", + " token: function (stream, state) {\n", + " if (stream.eatSpace()) return null;\n", + " var style = (state.tokenize[state.tokenize.length - 1] || tokenBase)(stream, state);\n", + " console.log(\"token\", style);\n", + " return style;\n", + " },\n", + "\n", + " blockCommentStart: \"/*\",\n", + " blockCommentEnd: \"*/\",\n", + " lineComment: \"$\"\n", + " };\n", + "});\n", + "\n", + "\n", + "CodeMirror.defineMIME(\"text/conjure\", \"text/conjure\");\n", + "\n", + "require(['notebook/js/codecell'], function (codecell) {\n", + " codecell.CodeCell.options_default.highlight_modes['magic_text/conjure'] = { 'reg': [/%?%conjure/] };\n", + " Jupyter.notebook.events.one('kernel_ready.Kernel', function () {\n", + " Jupyter.notebook.get_cells().map(function (cell) {\n", + " if (cell.cell_type == 'code') { cell.auto_highlight(); }\n", + " });\n", + " });\n", + "});\n", + "\n" ] }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "Conjure extension is loaded.\n", "For usage help run: %conjure_help\n" @@ -77,29 +290,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "LwUJCuKHA1Xi", - "outputId": "957187f1-ca26-4604-9521-7cafe55ad30f" + "outputId": "86fe2593-606b-4553-cb3a-6570622bbce0" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {}}, {\"f\": {\"C\": 1}}, {\"f\": {\"C\": 2}}, {\"f\": {\"C\": 3}}, {\"f\": {\"B\": 1}}, {\"f\": {\"B\": 2}}, {\"f\": {\"B\": 3}}, {\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1}}, {\"f\": {\"A\": 2}}, {\"f\": {\"A\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 3}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {}}, {\"f\": {\"C\": 1}}, {\"f\": {\"C\": 2}}, {\"f\": {\"C\": 3}}, {\"f\": {\"B\": 1}}, {\"f\": {\"B\": 2}}, {\"f\": {\"B\": 3}}, {\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1}}, {\"f\": {\"A\": 2}}, {\"f\": {\"A\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 3}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -119,29 +328,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "pEBUYKmHCB77", - "outputId": "f0d44114-a359-48c3-80eb-b25a98c930e6" + "outputId": "bbf33bf2-66c3-4751-cf9a-c0e9b50caa3a" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {}}, {\"f\": {\"C\": 1}}, {\"f\": {\"C\": 2}}, {\"f\": {\"C\": 3}}, {\"f\": {\"B\": 1}}, {\"f\": {\"B\": 2}}, {\"f\": {\"B\": 3}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1}}, {\"f\": {\"A\": 2}}, {\"f\": {\"A\": 3}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {}}, {\"f\": {\"C\": 1}}, {\"f\": {\"C\": 2}}, {\"f\": {\"C\": 3}}, {\"f\": {\"B\": 1}}, {\"f\": {\"B\": 2}}, {\"f\": {\"B\": 3}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1}}, {\"f\": {\"A\": 2}}, {\"f\": {\"A\": 3}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -161,29 +366,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "K4KWVr1CC_Nz", - "outputId": "283b9f30-f20c-41f2-bed9-0d10f6d202e7" + "outputId": "99fb75ce-aa63-4cb6-8746-0ae6f773e2ba" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -203,29 +404,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "OfT-MuABCqRb", - "outputId": "ed9c078e-b29b-4864-97ec-041d40d0cb48" + "outputId": "01ccf8ae-418c-42e1-d925-f6c1df0222fb" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -245,35 +442,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "XzfL8zBnDnZl", - "outputId": "6d81c7c2-1653-4736-c94c-b68ca6b28e3d" + "outputId": "c6ba662d-eca2-491d-bd9d-db7141e3e223" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ "%%conjure --number-of-solutions=all\n", "letting letters be new type enum {A, B, C}\n", - "find f: function (size(2)) letters --> int (1..3)" + "find f: function (size 2 ) letters --> int (1..3)" ] }, { @@ -287,35 +480,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "QpV9X_B1D8oV", - "outputId": "5b3415a3-1834-44c9-e8ee-a39bbe01f082" + "outputId": "ab65f836-6feb-4440-d34c-cdc48e1c3a4c" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 3}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 3}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ "%%conjure --number-of-solutions=all\n", "letting letters be new type enum {A, B, C}\n", - "find f: function (minSize(2)) letters --> int (1..3)" + "find f: function (minSize 2 ) letters --> int (1..3)" ] }, { @@ -329,35 +518,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "BvNsmmVTEDpl", - "outputId": "0f36e733-7541-419a-afc9-4e4b1fda2ba7" + "outputId": "44ddcfe2-baf0-431d-fb57-ffe6868ab389" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {}}, {\"f\": {\"C\": 1}}, {\"f\": {\"C\": 2}}, {\"f\": {\"C\": 3}}, {\"f\": {\"B\": 1}}, {\"f\": {\"B\": 2}}, {\"f\": {\"B\": 3}}, {\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1}}, {\"f\": {\"A\": 2}}, {\"f\": {\"A\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {}}, {\"f\": {\"C\": 1}}, {\"f\": {\"C\": 2}}, {\"f\": {\"C\": 3}}, {\"f\": {\"B\": 1}}, {\"f\": {\"B\": 2}}, {\"f\": {\"B\": 3}}, {\"f\": {\"B\": 1, \"C\": 1}}, {\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 2}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 1}}, {\"f\": {\"A\": 2}}, {\"f\": {\"A\": 3}}, {\"f\": {\"A\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 1}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 2}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 3, \"B\": 3}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ "%%conjure --number-of-solutions=all\n", "letting letters be new type enum {A, B, C}\n", - "find f: function (maxSize(2)) letters --> int (1..3)" + "find f: function (maxSize 2 ) letters --> int (1..3)" ] }, { @@ -371,29 +556,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "T_YgYjAFEKkV", - "outputId": "cacfc785-7818-4833-bd5c-15d059c47f64" + "outputId": "d3b50fdc-ff4f-457c-fb57-6a44e7a06a79" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {\"A\": 1, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 3}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {\"A\": 1, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 3, \"C\": 3}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -413,35 +594,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 54 }, "id": "IpJi8lVhERbl", - "outputId": "82528d5e-0cc7-467a-cc8c-277d3ad2ab78" + "outputId": "c7a60792-b65c-4f1c-d181-b161631161f2" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{\"conjure_solutions\": [{\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{\"conjure_solutions\": [{\"f\": {\"B\": 1, \"C\": 2}}, {\"f\": {\"B\": 1, \"C\": 3}}, {\"f\": {\"B\": 2, \"C\": 1}}, {\"f\": {\"B\": 2, \"C\": 3}}, {\"f\": {\"B\": 3, \"C\": 1}}, {\"f\": {\"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 2}}, {\"f\": {\"A\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"C\": 1}}, {\"f\": {\"A\": 2, \"C\": 3}}, {\"f\": {\"A\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"C\": 2}}, {\"f\": {\"A\": 1, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 3}}, {\"f\": {\"A\": 2, \"B\": 1}}, {\"f\": {\"A\": 2, \"B\": 3}}, {\"f\": {\"A\": 3, \"B\": 1}}, {\"f\": {\"A\": 3, \"B\": 2}}, {\"f\": {\"A\": 1, \"B\": 2, \"C\": 3}}, {\"f\": {\"A\": 1, \"B\": 3, \"C\": 2}}, {\"f\": {\"A\": 2, \"B\": 1, \"C\": 3}}, {\"f\": {\"A\": 2, \"B\": 3, \"C\": 1}}, {\"f\": {\"A\": 3, \"B\": 1, \"C\": 2}}, {\"f\": {\"A\": 3, \"B\": 2, \"C\": 1}}]}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ "%%conjure --number-of-solutions=all\n", "letting letters be new type enum {A, B, C}\n", - "find f: function (injective, minSize(2)) letters --> int (1..3)" + "find f: function (injective, minSize 2) letters --> int (1..3)" ] }, { @@ -455,29 +632,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 34 }, "id": "JJ8d_g2oWm0p", - "outputId": "2019a1cc-8279-4d6a-9b47-c3370c4f5434" + "outputId": "99edc19a-90b4-4fec-d1b6-56050c3ebdbf" }, "outputs": [ { + "output_type": "display_data", "data": { - "text/markdown": [ - "```json\n", - "{}\n", - "```" - ], "text/plain": [ "" - ] + ], + "text/markdown": "```json\n{}\n```" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -488,7 +661,8 @@ ], "metadata": { "colab": { - "provenance": [] + "provenance": [], + "include_colab_link": true }, "kernelspec": { "display_name": "Python 3",