-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Morphisms as programs #52
Comments
First, a comment about design. Coincidentally, Mike Shulman has recently published a preprint about a type theory for symmetric monoidal categories. There is a lot going on there, much of which I haven't fully understood, but the discussion in Section 1 is good food for thought. One relevant issue that Shulman raises is how to deal with monoidal products in the codomain. Suppose you have morphisms f: W -> X x Y and g: X x Y -> Z. How do you write the composite of f with g? Shulman proposes an indexing notation inspired by Sweedler notation, but I think in Julia it will be more natural to write x, y = f(w)
g(x,y) (in the spirit of what Shulman calls "covariables") or simply g(f(w)) Ordinarily, in Julia, only one of these invocations would be allowed. This is the difference between Apart from this subtlety about multiple outputs, and a similar one about nullary outputs (monoidal units), I think we can stick to the ordinary semantics of Julia code. |
One way to implement this is to rewrite the Julia program so that:
The program can then be executed by the Julia run-time and the result will be a wiring diagram. |
The idea is to separate the generic (non-numerical) and the numerical parts of the current algebraic nets codebase to get a general-purpose code generation system, of which algebraic nets will be a special case. A first pass. More refactoring will probably follow. Towards #52.
We already had this functionality for algebraic networks, but now it is more generic. Towards #52.
Again, we already had this functionality for algebraic networks, but now it is more general.
This issue is now mostly resolved. The only outstanding feature is recovering morphism expressions from traditional expression trees ( |
We want a module for converting morphisms in a symmetric monoidal category to and from programs, by which I mean expressions with variables in the style of type theory. This module will replace what is currently called
Catlab.Algebra
(#37), and will be called something likeCatlab.Programs
.Desired features:
Formula
typeI will follow up shortly with ideas about design and implementation.
The text was updated successfully, but these errors were encountered: