Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to search strategies #55

Closed
Whebon opened this issue Jan 19, 2024 · 2 comments
Closed

Refactor to search strategies #55

Whebon opened this issue Jan 19, 2024 · 2 comments

Comments

@Whebon
Copy link
Contributor

Whebon commented Jan 19, 2024

Image

Concrete structs can automatically inherit the fields of ProgramIterator with the @programiterator macro.

Todo:

  • Update tests to work with the new iterators
  • Refactor genetic_enumerators
@Whebon

This comment has been minimized.

@Whebon
Copy link
Contributor Author

Whebon commented Jan 19, 2024

using Revise, HerbSearch, HerbGrammar, HerbData, HerbInterpret

g = @csgrammar begin
    Number = x | 1
    Number = Number + Number
    Number = Number * Number
end

problem = Problem([IOExample(Dict(:x => x), 2x+1) for x  1:5])

iterator = BFSIterator(g, :Number, max_depth=5)
solution, flag = synth(problem, iterator)

output = test_with_input(SymbolTable(g), solution, Dict(:x => 6))
println(output)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants