-
Notifications
You must be signed in to change notification settings - Fork 58
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
Missing codiagonal / logical structure in Bicategory of Relations implementation #54
Comments
(related to #49) |
Good point. I'm not sure what I was thinking at the time, but I guess it was to omit some of the derived structure in
So, I would suggest making |
To get started, maybe you can try to fix just |
Cool, I'll take a look at it soon, I will probably have questions, but this is a good target for learning how Catlab works. I currently have the minimal understanding necessary to make wiring diagrams. |
Hey Evan, I just wrote down the stuff in Table two in the language of @signature MonoidalCategoryWithBiDiagonals(Ob,Hom) => BicategoryRelations(Ob,Hom) begin
# We inherit the following special morphisms:
# mcopy(A::Ob)::Hom(A,otimes(A,A))
# mmerge(A::Ob)::Hom(otimes(A,A),A)
# delete(A::Ob)::Hom(A,munit())
# create(A::Ob)::Hom(munit(),A)
# Dagger category.
dagger(f::Hom(A,B))::Hom(B,A) <= (A::Ob,B::Ob)
# Self-dual compact closed category.
# the objects in Rel (sets) satisfy dual(X) = X
dunit(A::Ob)::Hom(munit(), otimes(A,A))
dcounit(A::Ob)::Hom(otimes(A,A), munit())
# logical primitives
intersection(f::Hom(A,B), g::Hom(A,B))::Hom(A,B)
# intersection(f,g) = compose(mcopy(dom(f)), otimes(f,g), mmerge(codom(f))
ltrue()::Hom(munit(),munit())
# ltrue() = compose(mdelete(munit()), mcreate(munit())
lmax(A::Ob,B::Ob)::Hom(A,B)
# lmax(A,B) = compose(mdelete(A), mcreate(B)
end The I think I'll need to edit the @syntax FreeBicategoryRelations(ObExpr,HomExpr) BicategoryRelations begin
otimes(A::Ob, B::Ob) = associate_unit(Super.otimes(A,B), munit)
otimes(f::Hom, g::Hom) = associate(Super.otimes(f,g))
compose(f::Hom, g::Hom) = associate(Super.compose(f,g; strict=true))
function dagger(f::Hom)
f = anti_involute(Super.dagger(f), dagger, compose, id)
distribute_unary(f, dagger, otimes)
end
end For the syntax we need to define that the otimes and compose are inherited from the super type, and the dagger is an involution that distributes over the monoidal product. Why don't we need to define anything about the |
Thanks, this is definitely the general strategy I had in mind. I'll write up something soon about the difference between |
FYI, I'm currently writing up an introduction to the core modules (see #61), but I haven't yet written the part about Still, any feedback about what I have so far is welcome. |
I've finished writing the introduction, at least for now. |
I added the missing codiagonal and logical operations. I decided to use the lattice, rather than the logical, terminology, because |
The implementation in Catlab is
but your paper Knowledge Representation in the Bicategory of Relations has this table
It looks like a lot of this is missing, like
codiagonal
andlogical
. Are these morphisms defined somewhere else? It looks likeAbelianBicategoryRelations
has the codiagonal but it is called plus/coplus instead of merge/copy.Is that understanding right?
The text was updated successfully, but these errors were encountered: