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

Tree schema that supports shared and unique #296

Merged
merged 21 commits into from
Jan 30, 2024
Merged

Conversation

oflatt
Copy link
Member

@oflatt oflatt commented Jan 29, 2024

This PR adds a tree schema that can support both shared terms and unique terms.
Compared to tree_unique:

  • Adds a new variant of Id called Shared, which can be used for shared terms
  • Adds a test in the id analysis to prevent mixing shared and unique ids in terms
  • Adds ids to branches of switch statements, allowing for path-condition based optimizations. Switch statements must now have Branches as children. Adds a test that ensures this.
  • Deletes most optimizations, but keeps most utility
  • Adds IsValidShared and IsValidUnique, subsets of IsValid for shared and not-shared optimizations.
    IsValid = IsValidShared \union IsValidUnique

@oflatt oflatt requested a review from rtjoa January 29, 2024 20:39
Copy link
Collaborator

@rtjoa rtjoa left a comment

Choose a reason for hiding this comment

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

Looks good (just skimmed).

Note: Before people start hacking on their optimizations, I think we should do follow-ups on this that implement typed args and lets/loops-are-lambdas.

Nit: I think the directory should be called tree rather than tree_shared. Then, once all optimizations are ported, we'll delete tree_unique_args.

@oflatt oflatt merged commit 492040c into main Jan 30, 2024
4 checks passed
@oflatt oflatt deleted the oflatt-shared-tree-schema branch January 30, 2024 23:39
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.

2 participants