Skip to content
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

Annotating Decapodes with types #19

Open
lukem12345 opened this issue Nov 19, 2022 · 3 comments
Open

Annotating Decapodes with types #19

lukem12345 opened this issue Nov 19, 2022 · 3 comments

Comments

@lukem12345
Copy link
Member

Currently, Decapodes are flexible. That is, an object of the type SummationDecapode could represent equations in the 2D Exterior Calculus, or 1D Exterior Calculus, and so on.

Programming with Decapodes would become more well-typed if the Decapode objects had something like a type parameter with the degree of the DEC being used. Compilation steps like type inference could then automatically pick the correct set of inference rules.

The typing system could most likely be improved in other ways, but some brainstorming needs to happen first.

@jpfairbanks
Copy link
Member

The easiest thing to implement would be a wrapper struct with 2 fields, the dimension::Int and the current acset struct.

The most category theoretic approach would be to make a decapode for the de Rahm complex for each dimension. Then a decapode with respect to a specific dimensionality would be an ACSet transformation into that de Rahm complex. That fits nicely with the Typed ACSet perspective from the stratification setup and the HypSigma approach used for Wiring Diagrams over a specific SMC. Decapodes are basically DWDs encoded as HypSigma where we are using the attributes to encode the map into the algebraic signature instead of using ACSet Transformations.

@jpfairbanks
Copy link
Member

If we do option 2, then we can apply the fundamental theorem of presheaf toposes to convert a typed Decapode into a presheaf where there is a table for each type. Not sure if that is ever useful, but it would be theoretically consistent.

@lukem12345 lukem12345 transferred this issue from AlgebraicJulia/Decapodes.jl Jan 28, 2024
@lukem12345
Copy link
Member Author

lukem12345 commented Feb 5, 2024

@quffaro What do you feel is the fastest way to implement this feature?
This is so users do not have to do:

infer_types!(pode, op1_inf_rules1d, op2_inf_rules1d)
resolve_overloads!(pode, op1_res_rules1d, op2_res_rules1d)
gensim(pode, dimension=1)

Would implementing @decapode dimension begin ... end be a headache?

This is the first practical QoL feature that would be gained as we consider adding new types of DiagrammaticEquations, via whatever means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants