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

Add ability to "saturate" inlining #6

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

saulshanabrook
Copy link
Member

@saulshanabrook saulshanabrook commented Aug 26, 2023

This PR extends the inline_leaves function added in #4 to support repeatedly calling it.

It does this by adding a check when constructing the new operator string. If the operator string was already inlined, we replace all instances of · (the missing arg constant), with the new values. Otherwise, do the previous behavior of constructing a calling signature.

It also adds a saturate_inline_leaves function, that repeatedly inlines until it is a no-op.

I have added this as an example to include in the readme. E.g. this is the physics_scientific_unsolved_4h_ellisk_2019 inlined once:

Compared to the saturated inline:

Motivation

When you use a wrapper struct around a literal you might want this inlined as well, to make the graph have less overlapping edges. So I wanted to be able to run inline_leaves at least twice.

I had been wanting to try the saturated version too for a while to see if it helps with readability at all.

@saulshanabrook
Copy link
Member Author

saulshanabrook commented Oct 1, 2023

Ping on this PR. I am currently using it in the Python bindings

@mwillsey mwillsey merged commit e682702 into egraphs-good:main Nov 9, 2023
2 checks passed
@saulshanabrook saulshanabrook deleted the inline-multiple-times branch November 10, 2023 17:48
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