Skip to main content

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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inets-kernel 0.1.5
File Size Uploaded Provenance Actions
inets_kernel-0.1.5.tar.gz 12.8 kB Without provenance Details for inets_kernel-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inets-kernel 0.1.5
File Interpreter ABI Platform Actions
inets_kernel-0.1.5-py3-none-any.whl Python 3 none any Details for inets_kernel-0.1.5-py3-none-any.whl

Total release size: 23.6 kB

Release files / inets_kernel-0.1.5.tar.gz

Download URL inets_kernel-0.1.5.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
837b9d3987c0c65f9e91c87835d3562f434be2a9133e0fe00095ce779efa0ca9
BLAKE2b-256 checksum
How to use checksums
3a7962719fb8f49578a8d29f37bc880126b21c479279535675a67091ad1ef179
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.5-py3-none-any.whl

Download URL inets_kernel-0.1.5-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47200af71cdf0b55d52d5a0381f406cd0c87cc54512085cae408232cbbf8b52c
BLAKE2b-256 checksum
How to use checksums
0188bdec8d25e43e902a52ee5f47d7b9ad89ab5cafd3d47d0f10bde5223ef896
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.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page