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

Coproduct with looseACSetTransformations #908

Open
kris-brown opened this issue May 10, 2024 · 2 comments
Open

Coproduct with looseACSetTransformations #908

kris-brown opened this issue May 10, 2024 · 2 comments
Assignees
Labels

Comments

@kris-brown
Copy link
Contributor

@slwu89 has found a bug in the coproduct dispatch:

X = @acset LabeledSet{Symbol} begin
    X=4
    label=[:a,:b,:c,:d]
end

Y = @acset LabeledSet{Int} begin
    X=3
    label=1:3
end

g = (Label=FinFunction(Dict([l=>l for l in X[:,:label]])),)
h = (Label=FinFunction(Dict([l=>Symbol(l) for l in Y[:,:label]])),)
coproduct(X,Y, type_components=[g,h])

Dispatch is not working, as it should eventually turn into the following (which does work, if you directly type it in):

colimit(Tuple{LabeledSet{Symbol},LooseACSetTransformation},
        DiscreteDiagram([X,Y]);
        type_components=[g,h])
@kris-brown kris-brown added the bug label May 10, 2024
@kris-brown kris-brown self-assigned this May 10, 2024
@kris-brown
Copy link
Contributor Author

I'd guess it would be hard to straightforwardly infer the LabeledSet{Symbol} argument from the input data, so I'm not sure if there's a good solution to this problem, but at least there could be a better error message.

@slwu89
Copy link
Member

slwu89 commented May 10, 2024

Adding the definition of LabeledSet here that I used, for completeness

@present SetSch(FreeSchema) begin
    X::Ob
end
@present LabeledSetSch <: SetSch begin
    Label::AttrType
    label::Attr(X,Label)
end
@acset_type LabeledSet(LabeledSetSch, unique_index=[:label])

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

No branches or pull requests

2 participants