diff --git a/tests/python/parity.ipynb b/tests/python/parity.ipynb index 2b860dd45..efd19e0f7 100644 --- a/tests/python/parity.ipynb +++ b/tests/python/parity.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -15,80 +15,64 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Definitions and examples" + "# Definitions and examples for parity acceptance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "In Spot a **Parity acceptance** is defined by an **kind**, a **style** and a **numsets** (number of acceptance sets):\n", + "In Spot a **parity acceptance** is defined by a **kind**, a **style** and a **numsets**:\n", + "+ The **kind** can be either **max** or **min**.\n", + "+ The **style** can be either **odd** or **even**.\n", "+ The **numsets** is the number of acceptance sets used by the parity acceptance.\n", - "+ The **kind** can be either **max** or **min**. The parity kind is well defined only if the **numsets** is strictly greater than 1.\n", - " - **max** odd 4: *Inf(3) | (Fin(2) & (Inf(1) | Fin(0)))*\n", - " - **min** odd 4: *Fin(0) & (Inf(1) | (Fin(2) & Inf(3)))*\n", - "+ The **style** can be either **odd** or **even**. The parity style is well defined only if the **numsets** is non-null.\n", - " - max **odd** 4: *Inf(3) | (Fin(2) & (Inf(1) | Fin(0)))*\n", - " - min **even** 4: *Fin(3) & (Inf(2) | (Fin(1) & Inf(0)))*\n", - "\n" + " \n", + "Here are some examples:" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "parity min odd 1 = Fin(0)\n", + "parity min odd 2 = Fin(0) & Inf(1)\n", + "parity min odd 3 = Fin(0) & (Inf(1) | Fin(2))\n", + "parity min odd 4 = Fin(0) & (Inf(1) | (Fin(2) & Inf(3)))\n", + "parity min even 1 = Inf(0)\n", + "parity min even 2 = Inf(0) | Fin(1)\n", + "parity min even 3 = Inf(0) | (Fin(1) & Inf(2))\n", + "parity min even 4 = Inf(0) | (Fin(1) & (Inf(2) | Fin(3)))\n", + "parity max odd 1 = Fin(0)\n", + "parity max odd 2 = Inf(1) | Fin(0)\n", + "parity max odd 3 = Fin(2) & (Inf(1) | Fin(0))\n", + "parity max odd 4 = Inf(3) | (Fin(2) & (Inf(1) | Fin(0)))\n", + "parity max even 1 = Inf(0)\n", + "parity max even 2 = Fin(1) & Inf(0)\n", + "parity max even 3 = Inf(2) | (Fin(1) & Inf(0))\n", + "parity max even 4 = Fin(3) & (Inf(2) | (Fin(1) & Inf(0)))\n" + ] + } + ], + "source": [ + "for kind in ['min', 'max']:\n", + " for style in ['odd', 'even']:\n", + " for sets in range(1, 5):\n", + " name = 'parity {} {} {}'.format(kind, style, sets)\n", + " print('{:17} = {}'.format(name, spot.acc_code(name)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "**Some parity acceptance examples:**\n", - "