diff --git a/src/ACSetInterface.jl b/src/ACSetInterface.jl index 41c2c5b..e78fda1 100644 --- a/src/ACSetInterface.jl +++ b/src/ACSetInterface.jl @@ -12,7 +12,6 @@ using Tables using PrettyTables: pretty_table using ..ColumnImplementations: AttrVar -using ..PreimageCaches: is_injective using ..Schemas: types, attrs, attrtypes @@ -251,9 +250,6 @@ function set_subpart! end # Inlined for the same reason as `subpart`. @inline function set_subpart!(acs::ACSet , parts::Union{AbstractVector{Int}, AbstractSet{Int}}, name, vals) - if is_injective(acs.subparts[name]) - clear_subpart!(acs, parts, name) - end broadcast(parts, vals) do part, val set_subpart!(acs, part, name, val) end diff --git a/src/Columns.jl b/src/Columns.jl index bb0e1ea..fd72598 100644 --- a/src/Columns.jl +++ b/src/Columns.jl @@ -10,7 +10,7 @@ using Reexport @reexport using ..PreimageCaches import ..Mappings: view_with_default -import ..PreimageCaches: preimage, preimage_multi, is_injective +import ..PreimageCaches: preimage, preimage_multi # Columns ######### @@ -94,6 +94,4 @@ view_with_default(c::Column, xs, def) = ColumnView(c, xs, def) Base.size(c::ColumnView) = size(c.indices) -is_injective(c::Column) = is_injective(c.pc) - end diff --git a/src/PreimageCaches.jl b/src/PreimageCaches.jl index 7919084..205fe8a 100644 --- a/src/PreimageCaches.jl +++ b/src/PreimageCaches.jl @@ -35,7 +35,6 @@ performance implications. - [`preimage`](@ref) - [`assign!`](@ref) - [`unassign!`](@ref) -- [`is_injective`](@ref) (defaults to false if not implemented) """ abstract type PreimageCache{S,T} end @@ -95,14 +94,6 @@ Remove `x` from the preimage of `y`. """ function unassign! end -""" -Whether or not the cache imposes an injectivity constraint. (default: false) -""" -is_injective(::PreimageCache)::Bool = false - -# Caches -######## - """ The trivial preimage mapping. It just computes preimages on the fly, and the operations for updating it are noops @@ -212,6 +203,4 @@ function unassign!(pc::InjectiveCache{S,T}, y::T, x::S) where {S,T} delete!(pc.inverse, y) end -is_injective(::InjectiveCache)::Bool = true - end diff --git a/test/ACSets.jl b/test/ACSets.jl index 2577bc0..b73e88b 100644 --- a/test/ACSets.jl +++ b/test/ACSets.jl @@ -425,8 +425,6 @@ for lset_maker in lset_makers @test isempty(incident(lset, :foo, :label)) @test_throws Exception set_subpart!(lset, 1, :label, :bar) - set_subpart!(lset, :, :label, [:bar, :foo]) - @test subpart(lset, :, :label) == [:bar, :foo] end SchDecGraph = BasicSchema([:E,:V], [(:src,:E,:V),(:tgt,:E,:V)],