asynets is an Asymptote library which I developped to draw interaction nets in my PhD dissertation. You can download the package here: asynets-0.01b.tar.bz2.
asynets
A library for rendering interaction nets using Asymptote.
* Installation
Unpack with:
tar xjf asynets-*.tar.bz2
This version has been tested with Asymptote 1.33 only.
* Structure of the package
The core modules:
common.asy:
some global variables
render.asy:
define type 'render' and provide a unified rendering process
type.asy:
define type 'type', which consists mainly in a Label and an
orientation, and provide useful functions on these
link.asy:
define type 'link', which consists mainly in a path and a set of
types, and provide useful functions on these (notably cut and
merge)
cell.asy:
define type 'cell', which consists mainly in a picture and a set of
ports (links)
More specialized modules:
rectcell.asy:
provide functions to create rectangular cells (with rounded
corners)
tricell.asy:
provide functions to create triangular cells (the base holding
auxilliary ports has rounded corners, the point holding the
principal port is sharp)
boxes.asy:
ugly hack to force promotion boxes into the framework provided
by the 'cell' type
reductions.asy:
this one is used to generate the redex and reduct part of a
reduction from the same source file
tests.asy:
a testbed framework
The following modules makes use of all this to create differential linear
logic interaction nets:
diffnets.asy:
provide functions to create differential net cells, generic
nets, and easy-to-create promotion boxes
commzone.asy:
provide functions to generate communication zones à la
Ehrhard-Laurent
* Note
This is quick and dirty code, generally undocumented. It has been
written while I was composing my PhD thesis, for the sole purpose of
allowing me to generate those numerous figures I needed. Example files
(named 'exemple_*.asy') can hint at the way things work. Source files
of the main modules also provide numerous test functions (prototyped
'void test_something(picture)'), that were introduced for debugging: the
code of these is generally short and easily understood.
The following Asymptote session runs all known test functions one after
the other:
$ asy
Welcome to Asymptote version 1.29 (to view the manual, type help)
> import diffnets
> runtests()
For each test there is an prompt of the form:
Running test: test_link
├-> Tags: [link] [test_link].
├-> Clean picture.
├-> Draw.
├-> Ship out.
└-> Next ? (Y/n)
The first line provides a description of the test, which can be fed to
grep in order to find the corresponding file and line. One can filter
the list of tests to be run using tags: runtest("box") runs only those
tests with tag "box".
* Copyright and license
The asynets package is written and poorly maintained by Lionel Vaux
<vaux@iml.univ-mrs.fr>. It is distributed under Sam Hocevar's WTFPL,
version 2 or later: see http://sam.zoy.org/wtfpl/.
Any kind of feedback is appreciated, in order to make this program
useful or at least usable.