Catlab.jl
Catlab.jl copied to clipboard
Doctrine Inheritance and Presentations
I was doing some GLA stuff today in FreeAbelianBicatRel and the more I work with Catlab the more I think that presentations of a n existing doctrine are rarely useful and we really need to focus on making it easy to create new doctrines and with new syntax and custom iconography in the WD layer.
Basically any application you think of is going to have additional structure beyond just Obs and Homs. They are going to have derived objects or special Homs. like in GLA you have the scalars which you need to either enumerate or create a special hom constructor like Scale(5) that captures the number you want to plug in there.
The Chemistry example is a good one. It derives from BiproductCat, but has the special objects like for all X::Ob there exists degraded(X)::Ob
I find myself starting out using a presentation because it is easy and then realizing that I need to add a lot of generators that have some structure and I really should have put that into a doctrine, but the barrier to creating a doctrine is higher (just a UX problem) so I don’t do it until I have an unmanageable amount of generators in my presentation, which justifies the cost of defining the new signature.
As @epatters says, a Presentation is a degenerate form of inheritance where you are only allowed to add new terms that are constants (nullary operations).
I think we should focus on making it really easy to define new doctrines and automating as much of the construction of the signature/syntax/wiring_diagram layers as we can.