inets-kernel
A Jupyter kernel for interaction nets, built on inets. Write a table of rules, draw a net, and watch it reduce.
pip install inets-kernel jupyterlab # or any other Jupyter front end
python -m inets_kernel.install --sys-prefix # into this Python environment; or --user, or --prefix PATH
jupyter lab
Choose "Interaction nets" for a notebook. jupyter kernelspec uninstall inets removes the
kernel again. The pictures need Graphviz's dot program; without it, or if it fails, a cell shows the
Graphviz text instead. The kernel is registered with the full path of the Python that
installed it, so run the install step again if that environment moves.
A cell is one of three things
A net. Equations between ports, written as the right-hand side of a rule is:
con (a b) = dup (era era)
con (a b) is a node and stands for its principal port. A name that is not an agent is a
wire if it occurs twice and a free port if it occurs once. An agent with a parameter takes
it after its name, as in atom 3. Equations are separated by ; or new lines, and #
starts a comment. The net is drawn, reduced by the current schedule, and drawn again, with
why it stopped and what it cost. The kernel starts with the table of the symmetric
interaction combinators (con, dup, era).
A table. Lines beginning agent or rule are added to the current table (which is
the combinators' at the start: %system new gives an empty one), in
the format of inets,
and the table is checked:
agent zero +
agent succ + -
agent add - - +
rule add (y r) >< zero
=> r = y
count add
Commands, one to a line:
| Command | Does |
|---|---|
%system NAME |
start from a bundled table (combinators, which is also what no name gives; ski; lazy), or new for none |
%table, %check, %rules |
show the current table; check it; list its rules, marking those that are not local |
%schedule HOW |
stack (the default), queue, random, rounds, or need PORT: by need for the free port named PORT (default out), in a table with signs |
%cap N |
stop a run after N interactions (default 10000) |
%trace on / off |
with rounds, draw the net after each round, up to twelve rounds; later rounds run but are not drawn, so after twelve rounds the last drawing is not the final net |
%ski TERM [--rounds | --lazy] |
reduce a term of S, K and I in prefix form, by need unless said |
%demo |
one term, K I Ω, reduced three ways |
%help |
this list |
A net of more than 80 nodes, free ports included, is described, not drawn.
Notebooks
Three are in notebooks/ of the
repository: the three rules of the combinators; a system of your own, for adding numbers;
and one term reaching three ends.
Tests
pip install -e '.[test]' # in kernel/, with inets installed
pytest
The tests run cells without Jupyter, and one small notebook through the kernel itself.
Licence
MIT.
Metadata
Release files for inets-kernel 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inets_kernel-0.1.4.tar.gz | 12.8 kB | Without provenance | Details for inets_kernel-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inets_kernel-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for inets_kernel-0.1.4-py3-none-any.whl |
Total release size: 23.6 kB
Release files / inets_kernel-0.1.4.tar.gz
| Download URL | inets_kernel-0.1.4.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be7f0a4c2ac7a5356c2c9e008d61e29555aefd2366dc7b5aec243184c2925abf
|
|
BLAKE2b-256 checksum How to use checksums |
f197f1fe59aeb35cef4acd646802af98cd9f1b65ac6230e14bae63edbbf76d95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / inets_kernel-0.1.4-py3-none-any.whl
| Download URL | inets_kernel-0.1.4-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b5bcd5f1fddc92ab07cd58286e756af2051318824fd6543b6ba7b0d98e34412f
|
|
BLAKE2b-256 checksum How to use checksums |
d415dce84310d8699654bd1ea0e5bb1324d4d26941bd62b8ec74effb2437deac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for inets-kernel 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.