Skip to content

Commit

Permalink
Merge pull request #132 from Herb-AI/compathelper/new_version/2024-12…
Browse files Browse the repository at this point in the history
…-13-01-52-34-511-01072321669

CompatHelper: bump compat for HerbGrammar to 0.5
  • Loading branch information
ReubenJ authored Jan 21, 2025
2 parents 13e24a7 + 1a23938 commit 8fe642a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HerbSearch"
uuid = "3008d8e8-f9aa-438a-92ed-26e9c7b4829f"
authors = ["Sebastijan Dumancic <s.dumancic@tudelft.nl>", "Jaap de Jong <J.deJong-18@student.tudelft.nl>", "Nicolae Filat <N.Filat@student.tudelft.nl>", "Piotr Cichoń <gitlab@gitlab.ewi.tudelft.nl>", "Tilman Hinnerichs <t.r.hinnerichs@tudelft.nl>"]
version = "0.4.0"
version = "0.4.1"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand All @@ -16,12 +16,12 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
DataStructures = "0.17,0.18"
HerbConstraints = "^0.2.0"
HerbCore = "^0.3.0"
HerbGrammar = "^0.4.0"
HerbInterpret = "^0.1.3"
HerbConstraints = "0.2.0"
HerbCore = "0.3.0"
HerbGrammar = "0.5"
HerbInterpret = "0.1.3"
HerbSpecification = "0.2"
MLStyle = "^0.4.17"
Random = "1.8.0,1.9.0,1.10.0,1.11.0"
StatsBase = "^0.34"
julia = "^1.8"
MLStyle = "0.4.17"
Random = "1.8.0"
StatsBase = "0.34"
julia = "1.8"
2 changes: 1 addition & 1 deletion src/search_procedure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function synth(
)::Union{Tuple{RuleNode, SynthResult}, Nothing}
start_time = time()
grammar = get_grammar(iterator.solver)
symboltable :: SymbolTable = SymbolTable(grammar, mod)
symboltable :: SymbolTable = grammar2symboltable(grammar, mod)

best_score = 0
best_program = nothing
Expand Down
2 changes: 1 addition & 1 deletion src/stochastic_iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function _calculate_cost(program::Union{RuleNode, StateHole}, cost_function::Fun
results = Tuple{<:Number,<:Number}[]

expression = rulenode2expr(program, grammar)
symbol_table = SymbolTable(grammar)
symbol_table = grammar2symboltable(grammar)

for example filter(e -> e isa IOExample, spec)
outcome = evaluation_function(symbol_table, expression, example.in)
Expand Down
12 changes: 6 additions & 6 deletions test/test_realistic_searches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
problem = Problem(examples)
solution = search(g₁, problem, :Element, max_depth=3)

@test execute_on_input(SymbolTable(g₁), solution, Dict(:x => -2)) == 4
@test execute_on_input(grammar2symboltable(g₁), solution, Dict(:x => -2)) == 4
end

@testset "Small domain, large operators" begin
Expand All @@ -46,7 +46,7 @@
problem = Problem(examples)
solution = search(g₂, problem, :Element)

@test execute_on_input(SymbolTable(g₂), solution, Dict(:x => 0)) == 4
@test execute_on_input(grammar2symboltable(g₂), solution, Dict(:x => 0)) == 4
end

@testset "Large domain, small operators" begin
Expand All @@ -69,8 +69,8 @@
problem = Problem(examples)
solution = search(g₃, problem, :Element)

@test execute_on_input(SymbolTable(g₃), solution, Dict(:x => 0)) == 1
@test execute_on_input(SymbolTable(g₃), solution, Dict(:x => 100)) == 101
@test execute_on_input(grammar2symboltable(g₃), solution, Dict(:x => 0)) == 1
@test execute_on_input(grammar2symboltable(g₃), solution, Dict(:x => 100)) == 101
end

@testset "Large domain, large operators" begin
Expand All @@ -97,7 +97,7 @@
problem = Problem(examples)
solution = search(g₄, problem, :Element)

@test execute_on_input(SymbolTable(g₄), solution, Dict(:x => 100)) == 418
@test execute_on_input(grammar2symboltable(g₄), solution, Dict(:x => 100)) == 418
end

@testset "Large domain with if-statements" begin
Expand Down Expand Up @@ -132,6 +132,6 @@
problem = Problem(examples)
solution = search(g₅, problem, :Element)

@test execute_on_input(SymbolTable(g₅), solution, Dict(:x => 3)) == 5
@test execute_on_input(grammar2symboltable(g₅), solution, Dict(:x => 3)) == 5
end
end
4 changes: 2 additions & 2 deletions test/test_search_procedure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
solution, flag = synth(problem, iterator)
program = rulenode2expr(solution, g₁)

@test execute_on_input(SymbolTable(g₁), program, Dict(:x => 6)) == 2*6+1
@test execute_on_input(grammar2symboltable(g₁), program, Dict(:x => 6)) == 2*6+1
end

@testset "Search max_enumerations stopping condition" begin
Expand Down Expand Up @@ -47,7 +47,7 @@
program = rulenode2expr(solution, g₁)

@test flag == suboptimal_program
@test execute_on_input(SymbolTable(g₁), program, Dict(:x => 6)) == 2*6+1
@test execute_on_input(grammar2symboltable(g₁), program, Dict(:x => 6)) == 2*6+1

end

Expand Down

2 comments on commit 8fe642a

@ReubenJ
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/123416

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.1 -m "<description of version>" 8fe642aa9c5b562a6c479eb18a05d6985c00d4db
git push origin v0.4.1

Please sign in to comment.