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

Bottom up iterator #107

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft

Bottom up iterator #107

wants to merge 33 commits into from

Conversation

ReubenJ
Copy link
Member

@ReubenJ ReubenJ commented May 21, 2024

Just to trigger CI for now...

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 99.53488% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.78%. Comparing base (1876d08) to head (d50413b).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/bottom_up_iterators/bottom_up_iterator.jl 97.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   67.35%   74.78%   +7.43%     
==========================================
  Files          21       26       +5     
  Lines         729      944     +215     
==========================================
+ Hits          491      706     +215     
  Misses        238      238              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

current_programs::Queue{RuleNode}
mutable struct BottomUpState
bank::Any
data::Any
Copy link
Member

Choose a reason for hiding this comment

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

non-urgent thing to think about: should we leave bank and data as Any, or should we introduce some subtyping? I assume the bank will always be either a Dict so that programs are ordered over their type, or some kind of priority as in Brute. If we figure out more precise type, the code might be faster.

Choose a reason for hiding this comment

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

I have decided to introduce two new abstract types: BUDepthBank and BUDepthData that the concrete iterators will need to extend. Please let me know what you think about this.

test/runtests.jl Outdated Show resolved Hide resolved
iter::DepthIterator
)::Dict{Symbol, Vector{RuleNode}}
grammar::ContextSensitiveGrammar = get_grammar(iter.solver)
bank::Dict{Symbol, Vector{RuleNode}} = Dict{Symbol, Vector{RuleNode}}()
Copy link
Member

Choose a reason for hiding this comment

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

does it make sense to make the bank type Dict{Symbol, Dict{Int,Vector{RuleNode}}}? so that you can also index it over depth for easier fetching?

grammar::ContextSensitiveGrammar = get_grammar(iter.solver)
rules::Queue{Int} = Queue{Int}()

for (rule_index, is_terminal) ∈ enumerate(grammar.isterminal)
Copy link
Member

@sebdumancic sebdumancic Jul 11, 2024

Choose a reason for hiding this comment

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

there might already be a function to get all non-terminals in HerbGrammar. If not, maybe we should add it?

@THinnerichs THinnerichs self-requested a review November 14, 2024 08:16
@THinnerichs
Copy link
Member

THinnerichs commented Nov 20, 2024

@TudorMagirescu:
Could you merge the uniform iterator branch into this one and check what changes we should keep? Then I can give a full review of both including some hints for the design patterns we discussed during the Hackathon.

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

Successfully merging this pull request may close these issues.

5 participants