From ce057a5e13c6e9d6d4163c5d48d674bbd0eed654 Mon Sep 17 00:00:00 2001 From: penguinn <michellewerth@hotmail.com> Date: Mon, 16 Sep 2019 14:56:17 +0200 Subject: [PATCH] Update notebooks --- Apples_and_Oranges.ipynb | 36 +++++++++++++++++------------------- Argumentation_Theory.ipynb | 10 +++------- Bridges_Puzzle.ipynb | 5 ++--- Cheryls_Birthday.ipynb | 6 +++--- N_Queens.ipynb | 6 +++--- 5 files changed, 28 insertions(+), 35 deletions(-) diff --git a/Apples_and_Oranges.ipynb b/Apples_and_Oranges.ipynb index 8ad2482..0a60d46 100644 --- a/Apples_and_Oranges.ipynb +++ b/Apples_and_Oranges.ipynb @@ -6,7 +6,7 @@ "source": [ "# Apples and Oranges\n", "\n", - "Use `:help` to get an overview for the jupyter notebook commands.\n", + "Use `:help` to get an overview for the jupyter notebook commands. If you need more insight on how to use this tool, consider reading *ProB Jupyter Notebook Overview*.\n", "\n", "This puzzle is [apparently an Interview question at Apple](https://bgr.com/2015/11/20/apple-interview-questions/). Quoting from\n", "[1](https://bgr.com/2015/11/20/apple-interview-questions/) we have the\n", @@ -84,7 +84,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -93,7 +93,7 @@ "Changed to state with index -1" ] }, - "execution_count": 9, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -104,21 +104,19 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "* -1: Root state\n", - "* 0: `SETUP_CONSTANTS()` **(current)**" + "* -1: Root state **(current)**" ], "text/plain": [ - "-1: Root state\n", - "0: SETUP_CONSTANTS() (current)" + "-1: Root state (current)" ] }, - "execution_count": 12, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -129,7 +127,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -138,7 +136,7 @@ "Machine constants set up using operation 0: $setup_constants()" ] }, - "execution_count": 10, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -149,7 +147,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -161,7 +159,7 @@ "Both" ] }, - "execution_count": 3, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -180,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -192,7 +190,7 @@ "{(A↦{orange}),(O↦{apple,orange}),(Both↦{apple})}" ] }, - "execution_count": 4, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -203,7 +201,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -215,7 +213,7 @@ "{(A↦{apple,orange}),(O↦{apple}),(Both↦{orange})}" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -241,7 +239,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -258,7 +256,7 @@ "orange\t{(A|->{apple,orange}),(O|->{apple}),(Both|->{orange})}\n" ] }, - "execution_count": 6, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } diff --git a/Argumentation_Theory.ipynb b/Argumentation_Theory.ipynb index 99c3d4b..5a25b24 100644 --- a/Argumentation_Theory.ipynb +++ b/Argumentation_Theory.ipynb @@ -6,13 +6,9 @@ "source": [ "# Argumentation Theory\n", "\n", - "Below we try to model some concepts of argumentation theory in B. The\n", - "examples try to show that classical (monotonic) logic with set theory\n", - "can be used to model some aspects of argumentation theory quite\n", - "naturally, and that ProB can solve and visualise some problems in\n", - "argumentation theory. Alternative solutions are encoding arguments as\n", - "normal logic programs (with non-monotonic negation) and using answer set\n", - "solvers for problem solving.\n", + "Use `:help` to get an overview for the jupyter notebook commands. If you need more insight on how to use this tool, consider reading *ProB Jupyter Notebook Overview*.\n", + "\n", + "In this notebook we try to model some concepts of argumentation theory in B. The examples try to show that classical (monotonic) logic with set theory can be used to model some aspects of argumentation theory quite naturally, and that ProB can solve and visualise some problems in argumentation theory. Alternative solutions are encoding arguments as normal logic programs (with non-monotonic negation) and using answer set solvers for problem solving.\n", "\n", "The following model was inspired by a talk given by Claudia Schulz.\n", "\n", diff --git a/Bridges_Puzzle.ipynb b/Bridges_Puzzle.ipynb index be83afa..162ac4d 100644 --- a/Bridges_Puzzle.ipynb +++ b/Bridges_Puzzle.ipynb @@ -6,6 +6,7 @@ "source": [ "# Bridges Puzzle (Hashiwokakero)\n", "\n", + "Use `:help` to get an overview for the jupyter notebook commands. If you need more insight on how to use this tool, consider reading *ProB Jupyter Notebook Overview*.\n", "\n", "The [Hashiwokakero](https://en.wikipedia.org/wiki/Hashiwokakero) Puzzle is a logical puzzle where one has to build bridges between islands. The puzzle is also known under the name Ai-Ki-Ai. The puzzles can also be [played online](http://www.puzzle-bridges.com).\n", "\n", @@ -41,9 +42,7 @@ "* cs: the conflict set of links which overlap, i.e., one cannot build bridges on both links (a,b) when the pair (a,b) is in cs\n", "* connected: the set of links on which at least one bridge was built\n", "\n", - "The model also sets up the goal constant `sol` which maps every link in `pl` to a number indicating how many bridges are built on it. The model also stipulates that the graph set up by connected generates a fully connected graph.\n", - "\n", - "If you need help or want to find out more about jupyter notebook functionalities type in `:help` and `:help COMMAND` for an overview of the commands and a more detailed information about the command." + "The model also sets up the goal constant `sol` which maps every link in `pl` to a number indicating how many bridges are built on it. The model also stipulates that the graph set up by connected generates a fully connected graph." ] }, { diff --git a/Cheryls_Birthday.ipynb b/Cheryls_Birthday.ipynb index 060f25f..cbfe7a1 100644 --- a/Cheryls_Birthday.ipynb +++ b/Cheryls_Birthday.ipynb @@ -6,6 +6,8 @@ "source": [ "# Cheryl's Birthday\n", "\n", + "Use `:help` to get an overview for the jupyter notebook commands. If you need more insight on how to use this tool, consider reading *ProB Jupyter Notebook Overview*.\n", + "\n", "This Puzzle is a variation of another Puzzle (Sum and Product) and has\n", "been described\n", "in a New York Times article(http://www.nytimes.com/2015/04/15/science/a-math-problem-from-singapore-goes-viral-when-is-cheryls-birthday.html).\n", @@ -24,9 +26,7 @@ "* `r[S]` is the relational image of a relation r for a set of domain values S\n", "* `card(S)` is the cardinality of a set S\n", "* `a|->b` represents the pair (a,b); note that a relation and function in B is a set of pairs.\n", - "* `!x.(P => Q)` denotes universal quantification over variable x\n", - "\n", - "In case you are new to using the jupyter notebook, simply type in `:help` to get an overview over the full range of options you have with the ProB core." + "* `!x.(P => Q)` denotes universal quantification over variable x" ] }, { diff --git a/N_Queens.ipynb b/N_Queens.ipynb index 99041d2..b5ecfca 100644 --- a/N_Queens.ipynb +++ b/N_Queens.ipynb @@ -6,11 +6,11 @@ "source": [ "# N-Queens\n", "\n", - "The N-Queens is a famous constraint solving benchmark puzzle. It is a generalisation of the original [eight queens puzzle](https://en.wikipedia.org/wiki/Eight_queens_puzzle), where the goal is to place eight queens on a 8*8 chessboard so that no two queens attach each other.\n", + "Use `:help` to get an overview for the jupyter notebook commands. If you need more insight on how to use this tool, consider reading *ProB Jupyter Notebook Overview*.\n", "\n", - "Here is one way to encode the N-Queens puzzle in B.\n", + "The N-Queens is a famous constraint solving benchmark puzzle. It is a generalisation of the original [eight queens puzzle](https://en.wikipedia.org/wiki/Eight_queens_puzzle), where the goal is to place eight queens on a 8*8 chessboard so that no two queens attach each other.\n", "\n", - "If you are new to using jupyter notebook with the ProB kernel, just try typing in `:help`. This will give you an overview for your options on interacting with the machine." + "Here is one way to encode the N-Queens puzzle in B." ] }, { -- GitLab