Skip to content

Commit 5c85452

Browse files
committed
shorten seeded_by a bit
1 parent 8a1940f commit 5c85452

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/clauses.jl

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rechildren(x::Tie, t::DataType, v::Vector) = Tie{valtype(v),t}(Base.first(v))
6060

6161

6262
function seeded_by(x::Clause{G}, ::Vector{Bool})::Vector{G} where {G}
63-
# generic case
63+
# generic case (also holds for terminals)
6464
G[]
6565
end
6666

@@ -69,23 +69,10 @@ function seeded_by(x::Seq{G}, ch::Vector{Bool})::Vector{G} where {G}
6969
x.children[begin:first_nonempty]
7070
end
7171

72-
function seeded_by(x::First{G}, ::Vector{Bool})::Vector{G} where {G}
73-
child_clauses(x)
74-
end
75-
76-
function seeded_by(x::FollowedBy{G}, ::Vector{Bool})::Vector{G} where {G}
77-
child_clauses(x)
78-
end
79-
80-
function seeded_by(x::Some{G}, ::Vector{Bool})::Vector{G} where {G}
81-
child_clauses(x)
82-
end
83-
84-
function seeded_by(x::Many{G}, ::Vector{Bool})::Vector{G} where {G}
85-
child_clauses(x)
86-
end
87-
88-
function seeded_by(x::Tie{G}, ch::Vector{Bool})::Vector{G} where {G}
72+
function seeded_by(
73+
x::Union{First{G},FollowedBy{G},Some{G},Many{G},Tie{G}},
74+
::Vector{Bool},
75+
)::Vector{G} where {G}
8976
child_clauses(x)
9077
end
9178

0 commit comments

Comments
 (0)