I hit on the idea of making lambda a node in a string diagram, where its inputs are an antivariable and a term in which the variable is free, and its output is the same term, but in which the variable is bound. This allows a string diagram notation for lambda calculus that is much closer to the syntactical description than the stuff in our Rosetta Stone paper. Doing it this way makes it easy to also do pi calculus and blue calculus.
There are two types, V (for variable) and T (for term). I’ve done untyped lambda calculus, but it’s straightforward to add subscripts to the types V and T to do typed lambda calculus.
There are six function symbols:
- Lambda takes an antivariable and a term that may use the corresponding variable.
- This turns an antivariable “x” introduced by lambda into the term “x”.
- (Application) This takes and and produces .
- These two mean we can duplicate and delete terms.
The rule is the real meat of the computation. The “P” is an arbitrary subdiagram. The effect is replacing the “A” application node with the “P” subdiagram, modulo some wiring.
I label the upwards arrows out of lambdas with a variable name in parentheses; this is just to assist in matching up the syntactical representation with the string diagram.
In the example, I surround part of the diagram with a dashed line; this is the part to which the rule applies. Within that, I surround part with a dash-dot line; this is the subdiagram P in the rule.
When I do blue calculus this way, there are a few more function symbols and the relations aren’t confluent, but the flavor is very much the same.
|Statics (geometric = no time):|
|[k y/x]||proportional to slope|
|[k y^2/x^2]||original shape|
|[k y^2/x]||least S at equilibrium|
|Statics (with energy):|
|[x]||parameterization of curve|
|[kg x/s^2]||spring constant at x|
|[kg y/s^2]||force due to stretching|
|[kg y^2/s^2 x = J/x]||stretching energy density|
|[kg y^2/s^2 x= J/x]||gravitational energy density|
|[kg y^2/s^2 = J]||energy (least energy at equilibrium)||Statics (unitless distance):|
|||parameterization of curve|
|[kg m/s^2 = N]||force at x due to stretching|
|[kg m^2 / s^2 = J]||stretching energy at x|
|[kg m^2 / s^2 = J]||gravitational energy at x|
|[kg m^2 / s^2 = J]||energy (least energy at equilibrium)|
|[kg m/s]||momentum||[-kg m^2/s^2 = -J]||-kinetic energy|
|[kg m^2 / s^2 = J]||potential energy|
|[kg m^2/s]||i * action|
See also Toby Bartels‘ sci.physics post.