Skip to content

Commit

Permalink
Complement for VarACSets fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Brown committed Jul 10, 2024
1 parent d75ee24 commit 60a11fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/categorical_algebra/FinSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ predicate(A::SubFinSetVector) = A.predicate
function predicate(A::SubobjectHom{<:VarSet})
f = hom(A)
pred = falses(length(codom(f)))
for x in AttrVar.(dom(f))
for x in dom(f)
fx = f(x)
if fx isa AttrVar
pred[fx.val] = true
Expand Down
10 changes: 10 additions & 0 deletions test/categorical_algebra/CSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,14 @@ B = Subobject(X, X=[2], D=[1])
@test A B |> force == (X) |> force

const VES = VELabeledGraph{Symbol}

"""
e1 e4
a ↘ e3 ↗ e A = [a,b,c,d] + [1,2,3]
c → d
b ↗ ↘ f B = [c,d,e,f] + [3,4,5]
e2 e5
"""
X = @acset VES begin V=6; E=5; Label=5
src=[1,2,3,4,4]; tgt=[3,3,4,5,6];
vlabel=[:a,:b,:c,:d,:e,:f]; elabel=AttrVar.(1:5)
Expand All @@ -747,6 +755,8 @@ end
src=[1,2]; tgt=3; vlabel=[:a,:b,:c]; elabel=AttrVar.(1:2)
end

@test nv(dom(hom(~A))) == 3

# Limits of CSetTransformations between ACSets
#---------------------------------------------
# Example: "Reflexive graphs" where reflexive edges have weight -1
Expand Down

0 comments on commit 60a11fd

Please sign in to comment.