From 60a11fdc679bf6183fea3038f07242291e5b4086 Mon Sep 17 00:00:00 2001 From: Kris Brown Date: Wed, 10 Jul 2024 11:33:13 -0400 Subject: [PATCH] Complement for VarACSets fix --- src/categorical_algebra/FinSets.jl | 2 +- test/categorical_algebra/CSets.jl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/categorical_algebra/FinSets.jl b/src/categorical_algebra/FinSets.jl index 6b1b036f5..a5d9866ec 100644 --- a/src/categorical_algebra/FinSets.jl +++ b/src/categorical_algebra/FinSets.jl @@ -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 diff --git a/test/categorical_algebra/CSets.jl b/test/categorical_algebra/CSets.jl index d81523ced..ccbe2e3c3 100644 --- a/test/categorical_algebra/CSets.jl +++ b/test/categorical_algebra/CSets.jl @@ -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) @@ -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