AlgebraicJulia/Catlab.jl

Inconsistency between composition operations

Closed this issue · 0 comments

There seems to be a bug resulting in an inconsistency between composition written in classical and diagrammatic order.

See the reproduction example below:

# Tested with Catlab v0.15.0
using Catlab.Graphs, Catlab.Graphics
using Catlab.Theories, Catlab.CategoricalAlgebra, Catlab.Programs

g = path_graph(Graph, 3)

# Works fine!
h₁ = @migrate Graph g begin
  V => @cases (v₁::V; v₂::V)
  E => E
  src => v₁ ∘ src
  tgt => v₂ ∘ tgt
end

# MethodError: Cannot `convert` an object of type Nothing to an object of type Symbol
h₂ = @migrate Graph g begin
  V => @cases (v₁::V; v₂::V)
  E => E
  src => src ⋅ v₁
  tgt => tgt ⋅ v₂
end

# Works fine!
k₁ = @migrate Graph g begin
  V => V
  E => @join begin
    (e₁, e₂)::E
  end
  src => e₁ ⋅ src
  tgt => e₂ ⋅ tgt
end

# MethodError: Cannot `convert` an object of type Nothing to an object of type Symbol
k₂ = @migrate Graph g begin
  V => V
  E => @join begin
    (e₁, e₂)::E
  end
  src => src ∘ e₁
  tgt => tgt ∘ e₂
end