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
Make termination checks for exec functions, add support for mutable references in parameters, and emit a warning that the check doesn't account for loops #238
Conversation
I am not confident this is okay. |
c860972
to
51d4d46
Compare
Can you say what the motivation for this change is? I could imagine having an option that either disables termination checks for both exec recursive functions and exec loops, or enables termination checks for both exec recursive functions and exec loops. |
I was already under the impression we didn't support termination checking for |
Won't some people want termination checking for exec loops in the future, though? It's not implemented yet, but I think that's just because it wasn't a high priority to implement. And the syntax for decreases on loops is implemented, even if the check isn't yet. I don't think exec checking would have to be turned on by default, but in cases where people explicitly want the checking, it seems harmless to allow it. Let me propose a way to allow it when requested:
|
well, i don't object to supporting it in the future. I'm just saying Andrea's change makes sense now and until such support does exist. |
I think in the design I'm proposing, though, we wouldn't be disallowing and removing the decreases clauses that already exist. |
We would, however, remove by default the requirement that exec functions have |
12c07b4
to
51c6815
Compare
…d support for mutable references in parameters of exec functions with decreases clauses
51c6815
to
dc87c2f
Compare
…nctions with loops
The initial impetus was due to the fact that the support was incomplete: decreases did not work for functions with mutable references as arguments. That turned out to be a simple fix, so those are now supported. The need to check termination and the guarantees provided by the check were unclear to me. From the discussion:
So, this PR, now:
|
8efeb17
to
3449856
Compare
3449856
to
3cf3430
Compare
can you add a warning or error if the user tries to use |
I do not believe this opens to any potential unsoundness, especially because it's already possible to write a non-terminating recursive exec function with a loop.
Reported by @matthias-brun.