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

prevent unnecessary fixpoints in elaboration #1274

Merged
merged 5 commits into from
May 28, 2024
Merged

Conversation

pigumar1
Copy link
Contributor

@pigumar1 pigumar1 commented Apr 18, 2024

This PR tries to fix #1268 by checking if there are self-references in the function body/bodies during elaboration and decide whether to include the fixpoint based on that information.

For potential mutual recursive functions, the fixpoint is included as long as one of the function names occur in the definition as a free variable (by looking at the co-context)

A non-recursive function:
image

A recursive function:
image

Non-recursive functions:
image

Mutual recursive functions:
image

@pigumar1 pigumar1 linked an issue Apr 18, 2024 that may be closed by this pull request
@pigumar1
Copy link
Contributor Author

pigumar1 commented Apr 18, 2024

image
I'm not sure whether Alcotest should fail here: it seems that in this case, there is no reference of f in the body of the function (BinIntOp (Plus, (IntLit 1), (BoundVar "x"))). Should we wrap it with a fixpoint?

@pigumar1 pigumar1 requested a review from cyrus- April 18, 2024 22:56
@cyrus-
Copy link
Member

cyrus- commented Apr 20, 2024

@pigumar1 That test should be updated with the new behavior.

@cyrus-
Copy link
Member

cyrus- commented Apr 24, 2024

@pigumar1 marking as draft until the test is updated

@cyrus- cyrus- marked this pull request as draft April 24, 2024 00:32
@cyrus- cyrus- marked this pull request as ready for review May 28, 2024 17:35
@cyrus- cyrus- merged commit 60102ea into dev May 28, 2024
1 check passed
@cyrus- cyrus- deleted the prevent-unnecessary-fixpoints branch May 28, 2024 17:36
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.

prevent unnecessary fixpoints in elaboration
2 participants