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

Divide and conquer #134

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Divide and conquer #134

wants to merge 20 commits into from

Conversation

pwochner
Copy link
Contributor

Description

This PR includes a basic implementation of divide and conquer functions.

Main additions:

divide_and_conquer: Main function implementing the divide-and-conquer search procedure.

divide: Breaks down a problem specification into individual subproblems, each consisting of a single input-output example.

decide: Decides if a partial program should be kept. Programs are kept if they satisfy at least one subproblem.

conquer: Combines solutions to subproblems into a global solution program using a decision tree. Helper functions for decision tree:

  • get_predicates: Generates predicates for feature tests in the decision tree (BFS iterator with provided start symbol).
  • get_features: Constructs feature matrix by evaluating every IOExample inputs on all predicates.
  • get_labels: Extracts labels for each subproblem. First partial program that satisfied the subproblem is used as label.
  • construct_final_program: Recursively constructs the final program from the decision tree.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 96.77419% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.09%. Comparing base (8fe642a) to head (c80c010).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/divide_conquer_functions/conquer.jl 95.65% 3 Missing ⚠️
src/search_procedure.jl 97.82% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   71.26%   76.09%   +4.83%     
==========================================
  Files          20       22       +2     
  Lines         689      774      +85     
==========================================
+ Hits          491      589      +98     
+ Misses        198      185      -13     

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

@ReubenJ ReubenJ self-requested a review February 19, 2025 08:57
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.

1 participant