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

Using the same struct as a model for multiple theories #173

Open
kris-brown opened this issue Dec 8, 2024 · 0 comments · May be fixed by #172
Open

Using the same struct as a model for multiple theories #173

kris-brown opened this issue Dec 8, 2024 · 0 comments · May be fixed by #172
Assignees
Labels
enhancement New feature or request

Comments

@kris-brown
Copy link
Collaborator

In GATlab's present design, one declares a struct to be a possible model (e.g. for ThCategory) by saying struct SetCat <: Model{Tuple{AbstractSet, SetFunction}} and then putting all the methods in an @instance block somewhere.

This prevents one from saying SetCat is a model of some other theory (unless we're lucky and they have semantically the same type constructors in the same order). This feels really limiting. The example this is coming up in is we have ThCategoryWithTerminal <: ThCategory which adds another type constructor. It would be great to say "by the way, SetCat is not merely a category, but it also has this additional structure which I can make explicit by:

@instance ThCategoryWithTerminal{AbstractSet, SetFunction, TerminalLimit} [model::SetCat] begin
  @import id, compose
  terminal()::TerminalLimit = ...
  delete(T::TerminalLimit, x::AbstractSet)::SetFunction = ...
end

But SetCat is not a Model{Tuple{AbstractSet, SetFunction, TerminalLimit}} - that is fixed! It seems like there will be a huge proliferation of structs and names if the same struct can't be a model of two different theories (which happen to have different type constructors).

This also addresses an issue of repetitiveness of type parameters: one first declares a model subtypes Model{Tuple{A,B,C,...}} and then has to write @instance MyTheory{A,B,C,...}.

@kris-brown kris-brown added the enhancement New feature or request label Dec 8, 2024
@kris-brown kris-brown self-assigned this Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant