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

Rewrite termination measures sooner #930

Merged
merged 4 commits into from
Feb 1, 2025

Conversation

bauereiss
Copy link
Contributor

This used to happen after parsing, but now happens later in a rewrite. However, if it happens after other rewrites that rename variables, the measures might no longer type-check, so perform the measure rewrite as soon as possible.

This used to happen after parsing, but now happens later in a rewrite.
However, if it happens after other rewrites that rename variables, the
measures might no longer type-check, so perform the measure rewrite as
soon as possible.
Copy link

github-actions bot commented Jan 30, 2025

Test Results

   12 files  ±0     24 suites  ±0   0s ⏱️ ±0s
  761 tests +2    761 ✅ +2  0 💤 ±0  0 ❌ ±0 
2 505 runs  +2  2 505 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 30e6c30. ± Comparison against base commit cafe946.

♻️ This comment has been updated with latest results.

Also adds a simple function call graph that is only function calls,
doesn't include any other dependencies, and doesn't need a typing.
@bacam
Copy link
Contributor

bacam commented Jan 31, 2025

Two issues came up:

  • The rewrite pass for minimising recursive function annotations wasn't handling mutually recursive definitions, which I've got a fix for.
  • It separates this rewrite from the definition sorting, so if you use define measure function then it will go out of scope. I'll try moving the valspec for any function directly used in the measure forward. The measures I defined for the RISC-V are affected by this.

bacam added 2 commits January 31, 2025 17:45
To ensure that the result will type check, we need to move any valspecs for functions
directly used in the measure forward.  The definitions themselves will be rearranged
later by the sorting rewrite.  Note that the type checker will ensure that a valspec
always exists.
@bacam bacam merged commit 9ce2f75 into rems-project:sail2 Feb 1, 2025
3 checks passed
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