Skip to content

Commit

Permalink
Remove Function type from struct field declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien1999 committed Nov 14, 2024
1 parent af9fd1f commit 0b0b8e8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ abstract type AbstractFormalSpecification end
A specification based on a logical formula defined by a SMT solver.
"""
struct SMTSpecification <: AbstractFormalSpecification
formula::Function
struct SMTSpecification{F} <: AbstractFormalSpecification
formula::F
end


Expand All @@ -46,8 +46,8 @@ abstract type AbstractDependentTypeSpecification <: AbstractTypeSpecification en
Defines a specification
"""
struct AgdaSpecification <: AbstractDependentTypeSpecification
formula::Function
struct AgdaSpecification{F} <: AbstractDependentTypeSpecification
formula::F
end

const AbstractSpecification = Union{
Expand Down Expand Up @@ -82,17 +82,17 @@ end
Program synthesis problem defined by an specification and a metric. The specification has to be based on input/output examples, while the function needs to return a numerical value.
"""
struct MetricProblem{T <: AbstractVector{<:IOExample}}
struct MetricProblem{T <: AbstractVector{<:IOExample}, F}
name::AbstractString
cost_function::Function
cost_function::F
spec::T

function MetricProblem(cost_function::Function, spec::T) where T<:AbstractVector{<:IOExample}
new{T}("", cost_function, spec)
function MetricProblem(cost_function::F, spec::T) where {T<:AbstractVector{<:IOExample}, F}
new{T, F}("", cost_function, spec)
end

function MetricProblem(name::AbstractString, cost_function::Function, spec::T) where T<:AbstractVector{<:IOExample}
new{T}(name, cost_function, spec)
function MetricProblem(name::AbstractString, cost_function::F, spec::T) where {T<:AbstractVector{<:IOExample}, F}
new{T, F}(name, cost_function, spec)
end

end
Expand Down

0 comments on commit 0b0b8e8

Please sign in to comment.