Skip to content

Commit

Permalink
Fix silly bug, add function sigs to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-brown committed Mar 2, 2022
1 parent a28bb20 commit 701cdd3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/categorical_algebra/CSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1129,19 +1129,19 @@ i.e. we cast the ACSet to a subobject
(f::ACSetTransformation)(X::StructACSet)::SubACSet =
X == dom(f) ? f(top(X)) : error("Cannot apply $f to $X")

"""
""" hom_inv(f::ACSetTransformation,Y::Subobject)::SubACSet
Inverse of f:A->B as a map of subobjects of B to subjects of A.
It can be thought of as `incident`, but for homomorphisms.
"""
hom_inv(f::ACSetTransformation,Y::Subobject)::SubACSet = begin
codom(hom(X)) == codom(f) || error("Cannot apply $f to $X")
codom(hom(Y)) == codom(f) || error("Cannot apply $f to $X")

Subobject(dom(f); Dict{Symbol, Vector{Int}}(
[k => vcat([preimage(f,y) for y in collect(components(Y)[k])]...)
for (k,f) in pairs(components(f))])...)
end

"""
""" hom_inv(f::CSetTransformation,Y::StructACSet)::SubACSet
Inverse f:A->B as a map from subobjects of B to subobjects of A.
Cast an ACSet to subobject, though this has a trivial answer when computing
the preimage (it is necessarily the top subobject of A).
Expand All @@ -1150,7 +1150,8 @@ hom_inv(f::CSetTransformation,Y::StructACSet)::SubACSet =
Y = codom(f) ? top(dom(f)) : error("Cannot apply inverse of $f to $Y")


"""
""" induce_subobject(X::StructACSet{S}; vs...)
Takes a partially-specified ACSet subobject and completes it so that there are
no undefined references.
Expand Down

0 comments on commit 701cdd3

Please sign in to comment.