Skip to content

Commit

Permalink
shorten seeded_by a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Aug 13, 2023
1 parent 8a1940f commit 5c85452
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/clauses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ rechildren(x::Tie, t::DataType, v::Vector) = Tie{valtype(v),t}(Base.first(v))


function seeded_by(x::Clause{G}, ::Vector{Bool})::Vector{G} where {G}
# generic case
# generic case (also holds for terminals)
G[]
end

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

function seeded_by(x::First{G}, ::Vector{Bool})::Vector{G} where {G}
child_clauses(x)
end

function seeded_by(x::FollowedBy{G}, ::Vector{Bool})::Vector{G} where {G}
child_clauses(x)
end

function seeded_by(x::Some{G}, ::Vector{Bool})::Vector{G} where {G}
child_clauses(x)
end

function seeded_by(x::Many{G}, ::Vector{Bool})::Vector{G} where {G}
child_clauses(x)
end

function seeded_by(x::Tie{G}, ch::Vector{Bool})::Vector{G} where {G}
function seeded_by(
x::Union{First{G},FollowedBy{G},Some{G},Many{G},Tie{G}},
::Vector{Bool},
)::Vector{G} where {G}
child_clauses(x)
end

Expand Down

0 comments on commit 5c85452

Please sign in to comment.