We use pre-commit for general tidy up of files. To install pre-commit run:
pip install pre-commit # or install using your distro package manager
pre-commit install
To run pre-commit on all files run
pre-commit run --all-files
We use Fourmolu as a formatter for Haskell source files with our custom config. Fourmolu must be explicitly enabled in VS Code!
Our editor of choice is VS Code with following extensions:
We use a variation of interaction nets that was proposer by Yves Lafont in 1989 in the paper "Interaction nets" as a base for our project. Below we introduce basic definitions and discuss some assumptions that we use.
Let
Network
- Each vertex is labelled with an agent and contains respective number of ports.
- Each edge is a connection between ports.
- Each port can be connected with not more then one port.
Note
- Network can contains ports that do not connected to other ports. The port without connection is a free port.
$\mathcal{I}(\mathcal{n})$ is set of free ports of network$\mathcal{n}$ or an interface of the network$\mathcal{n}$ . - Network can consists of edges only. In this case, each end of edge is a free port.
- Network without vertices and edges is an empty network.
The pair of nodes
Network
Reduction rule
- If
$(l_1,l_2,\mathcal{n}) \in \mathcal{R}$ then$(l_2, l_1,\mathcal{n}) \in \mathcal{R}$ . - If
$(l_1,l_2,\mathcal{n}_1) \in \mathcal{R}$ and$(m_1, m_2,\mathcal{n}_2) \in \mathcal{R}$ then$(l_1,l_2) \neq (m_1,m_2)$ . - For all
$(l_1,l_2,\mathcal{n}) \in \mathcal{R}$ ,$\mathcal{n}$ is in normal form. - For all
$(l_1,l_2,\mathcal{n}) \in \mathcal{R}$ ,$Ar(l_1) + Ar(l_2) = |\mathcal{I}(\mathcal{n})|$ .
Computation is an application of rewriting rules to active pairs.
If there is an active pair
-
$a$ is labelled with$l_1$ -
$b$ is labelled with$l_2$ $r = (l_1, l_2, \mathcal{m}) \in \mathcal{R}$
then we can replace
Active pair