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

Error in computing cartesian product with @relation #427

Closed
kris-brown opened this issue May 15, 2021 · 1 comment · Fixed by #428
Closed

Error in computing cartesian product with @relation #427

kris-brown opened this issue May 15, 2021 · 1 comment · Fixed by #428
Labels

Comments

@kris-brown
Copy link
Contributor

I'm noticing an error message when I evaluate certain queries - I suspect that it's related to not having any foreign keys, but I'd appreciate any insight you have into why this is happening.

MWE

using Catlab.Programs
using Catlab.Theories
using Catlab.Present
using Catlab.CategoricalAlgebra
using Catlab.WiringDiagrams

@present T(FreeSchema) begin
    V::Ob
end

T_inst = ACSetType(T)()
add_parts!(T_inst,:V, 2)

rel = @relation (V=v1,V=v2) begin
 V(_id=v1)
 V(_id=v2)
end

query(T_inst, rel)

Error

LoadError: MethodError: no method matching Limit(::Catlab.CSetDataStructures.AttributedCSet{Catlab.Theories.CatDesc{(:V₁, :V₂, :E), (:src, :tgt), (3, 3), (1, 2)}, Catlab.Theories.AttrDesc{Catlab.Theories.CatDesc{(:V₁, :V₂, :E), (:src, :tgt), (3, 3), (1, 2)}, (:Ob, :Hom), (:ob₁, :ob₂, :hom), (1, 2, 3), (1, 1, 2)}, Tuple{Catlab.CategoricalAlgebra.Sets.SetOb, Catlab.CategoricalAlgebra.Sets.SetFunction{Dom, Codom} where {Dom<:(Catlab.CategoricalAlgebra.FinSets.FinSet{Int64, T} where T), Codom}}, (:src, :tgt), (), NamedTuple{(:V₁, :V₂, :E), Tuple{TypedTables.Table{NamedTuple{(:ob₁,), Tuple{Catlab.CategoricalAlgebra.Sets.SetOb}}, 1, NamedTuple{(:ob₁,), Tuple{Vector{Catlab.CategoricalAlgebra.Sets.SetOb}}}}, TypedTables.Table{NamedTuple{(:ob₂,), Tuple{Catlab.CategoricalAlgebra.Sets.SetOb}}, 1, NamedTuple{(:ob₂,), Tuple{Vector{Catlab.CategoricalAlgebra.Sets.SetOb}}}}, TypedTables.Table{NamedTuple{(:src, :tgt, :hom), Tuple{Int64, Int64, Catlab.CategoricalAlgebra.Sets.SetFunction{Dom, Codom} where {Dom<:(Catlab.CategoricalAlgebra.FinSets.FinSet{Int64, T} where T), Codom}}}, 1, NamedTuple{(:src, :tgt, :hom), Tuple{Vector{Int64}, Vector{Int64}, Vector{Catlab.CategoricalAlgebra.Sets.SetFunction{Dom, Codom} where {Dom<:(Catlab.CategoricalAlgebra.FinSets.FinSet{Int64, T} where T), Codom}}}}}}}, NamedTuple{(:src, :tgt), Tuple{Vector{Vector{Int64}}, Vector{Vector{Int64}}}}}, ::StaticArrays.SVector{2, Catlab.CategoricalAlgebra.Sets.SetFunctionCallable{Int64, Int64, Catlab.CategoricalAlgebra.FinSets.FinSet{Int64, Int64}, Catlab.CategoricalAlgebra.FinSets.FinSet{Int64, Int64}}})
Closest candidates are:
  Limit(::Diagram, ::Cone) where {Ob, Diagram, Cone<:(Multispan{Ob, Hom, Legs} where {Hom, Legs<:AbstractVector{Hom}})} at /Users/ksb/Catlab.jl/src/categorical_algebra/Limits.jl:48
@epatters epatters added the bug label May 15, 2021
@epatters
Copy link
Member

epatters commented May 15, 2021

Thanks for the report Kris. Note that the @relation should be:

rel = @relation (v1=v1,v2=v2) begin
 V(_id=v1)
 V(_id=v2)
end

However, there is definitely still a bug here!

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

Successfully merging a pull request may close this issue.

2 participants