-
Notifications
You must be signed in to change notification settings - Fork 1
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
Basic interface for bottom-up search #139
base: master
Are you sure you want to change the base?
Conversation
julia> @programiterator MyBU(bank) <: BottomUpIterator
MyBU
julia> iter = MyBU(g, :Int, nothing; max_depth=5)
MyBU(GenericSolver(1: Int = 1
2: Int = 2
3: Int = Int + Int
, SolverState(hole[Bool[1, 1, 1]], Set{AbstractLocalConstraint}(), true), DataStructures.PriorityQueue{AbstractLocalConstraint, Int64, Base.Order.ForwardOrdering}(), nothing, false, 9223372036854775807, 5), nothing)
julia> progs = Set(Iterators.take(iter, 6))
ERROR: setfield!: immutable struct of type MyBU cannot be changed |
BU doesn't yet work with UniformTrees, but it should be easy to get there now. Secondly, what was the conclusion: do we want to keep If we stay with the macro, can it switch to mutable structure? Because that is important for bottom-up search. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #139 +/- ##
==========================================
+ Coverage 72.94% 74.83% +1.89%
==========================================
Files 19 20 +1
Lines 669 779 +110
==========================================
+ Hits 488 583 +95
- Misses 181 196 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Any suggestions for the interface function names? Especially the ones that manipulate |
We can remove the mutable keyword for BUS iterators if we switch the interface slightly. What if we remove |
I think the conclusion was to keep it for now. The interface approach will be nice eventually, but it'll take some work.
As far as I can see, it isn't important. Mutating the items in the bank does not require mutability of the structure. The only reason why it's needed now is because of the |
Either way, I just noticed we have support for |
See the latest commit: this works now. I updated the example BU iterator in the tests to use |
This actually makes more sense than the original design. I somehow convinced myself that the original design could be more type stable. |
We can get rid of the |
We also assume grammars with a single type, there is a TODO in there mentioning the change needed, but addressing will need to include this too |
Added tests to show this
5b4ada3
to
d84f7fc
Compare
@programiterator
macroUniformTrees