Skip to content

Commit

Permalink
ENH: Instances of ACSets as (co)cartesian monoidal categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
epatters committed Jul 12, 2021
1 parent 44e02bd commit fa26ddc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/categorical_algebra/CSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ end

fin_sets(X::ACSet) = map(table -> FinSet(length(table)), tables(X))

@cartesian_monoidal_instance CSet CSetTransformation
@cocartesian_monoidal_instance ACSet ACSetTransformation

# Limits and colimits
#####################

Expand Down Expand Up @@ -585,8 +588,9 @@ cocone_objects(diagram::BipartiteFreeDiagram) = ob₂(diagram)
cocone_objects(span::Multispan) = feet(span)
cocone_objects(para::ParallelMorphisms) = SVector(codom(para))

# Serialization and Deserialization of ACSets
#############################################
# Serialization
###############

""" Serialize an ACSet object to a JSON string
"""
function generate_json_acset(x::T) where T <: AbstractACSet
Expand Down
4 changes: 2 additions & 2 deletions test/categorical_algebra/CSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ h = cycle_graph(LabeledGraph{Symbol}, 4, V=(label=[:c,:d,:a,:b],))
h = cycle_graph(LabeledGraph{Symbol}, 4, V=(label=[:a,:b,:d,:c],))
@test !is_homomorphic(g, h)

# Serialization and Deserialization of ACSets
#############################################
# Serialization
###############

@present TheoryDDS(FreeSchema) begin
X::Ob
Expand Down

0 comments on commit fa26ddc

Please sign in to comment.