You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@epatters, I would like to build programming languages from finitely presented SMCs. It looks like the Algebra.Networks module seems to be the best place to start. The goal would be one function L = language(::Presentation) which gives L::Language so that you can use a macro to define wiring diagrams in that category L. Then the @model macro would produce a Hom in the doctrine associated with the presentation object.
Here is an example of how it could work.
struct Presentation
d::Doctrine
obs::Vector{Ob{:generator}}
homs::Vector{Hom{::generator}}endstruct Language
...end
p =Presentation(FreeBiproductCategory,
Ob(FreeBiproductCategory, :A, :B, :C)
[Hom(:f, A, B), Hom(:g, B, B), Hom(:h, otimes(B,B))]
)
L =language(p)
m =@model L (x[1], x[2]) begin
x[1] =f(x[1])
x[2] =g(x[2])
x[1] =h(x[1], x[2])
return x[1]
endto_wiring_diagram(m) |> to_graphviz
to denote the hom expression m::Doctrine.Hom{T} = f\otimes g ; h
What would it take to get this working?
The text was updated successfully, but these errors were encountered:
Maybe you know this, but we've already got a Presentation data type and corresponding macro. Example usage is in the unit tests. It should serve exactly the purpose you suggest.
The rest we will need to implement. I agree that the algebraic networks code would be a good place to start. I would like to clean that up anyway. The main thing we need to add is the ability to generate a wiring diagram from code in a fragment of the Julia language, as sketched in your post. That should be doable without too much pain. I'll think more about it and we can discuss on Friday.
@epatters, I would like to build programming languages from finitely presented SMCs. It looks like the
Algebra.Networks
module seems to be the best place to start. The goal would be one functionL = language(::Presentation)
which givesL::Language
so that you can use a macro to define wiring diagrams in that category L. Then the@model
macro would produce a Hom in the doctrine associated with the presentation object.Here is an example of how it could work.
to denote the hom expression
m::Doctrine.Hom{T} = f\otimes g ; h
What would it take to get this working?
The text was updated successfully, but these errors were encountered: