From d76ffb7b813643616094a82d020607f93413f8a0 Mon Sep 17 00:00:00 2001 From: Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:53:21 +0100 Subject: [PATCH 1/2] Remove default `==` implementation for `AbstractHole`s Implementers of new hole types should decide whether to follow the logic of a `Hole`, which has no children, or a `UniformHole,` which does. --- src/rulenode.jl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/rulenode.jl b/src/rulenode.jl index 068e8ec..9261a9a 100644 --- a/src/rulenode.jl +++ b/src/rulenode.jl @@ -340,10 +340,6 @@ function Base.:(==)(a::UniformHole, b::UniformHole) return a.domain == b.domain && length(a.children) == length(b.children) && all(isequal(a, b) for (a, b) in zip(a.children, b.children)) end -function Base.:(==)(a::H, b::H) where {H <: AbstractHole} - return a.domain == b.domain -end - Base.copy(r::RuleNode) = RuleNode(r.ind, r._val, r.children) Base.copy(h::Hole) = Hole(copy(h.domain)) From 4cd86b4b9af8df12c2f68b4eef82e40264f2cca3 Mon Sep 17 00:00:00 2001 From: Dekel Date: Fri, 20 Mar 2026 14:02:07 +0100 Subject: [PATCH 2/2] define == for Hole --- src/rulenode.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rulenode.jl b/src/rulenode.jl index 9261a9a..d1e8ed5 100644 --- a/src/rulenode.jl +++ b/src/rulenode.jl @@ -340,6 +340,9 @@ function Base.:(==)(a::UniformHole, b::UniformHole) return a.domain == b.domain && length(a.children) == length(b.children) && all(isequal(a, b) for (a, b) in zip(a.children, b.children)) end +function Base.:(==)(a::Hole, b::Hole) + return a.domain == b.domain +end Base.copy(r::RuleNode) = RuleNode(r.ind, r._val, r.children) Base.copy(h::Hole) = Hole(copy(h.domain))