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

Allow domain axioms to use functions that have decreases clauses #802

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

marcoeilers
Copy link
Contributor

As discussed in viperproject/silicon#847, we now allow domain axioms to refer to non-domain functions that don't have any preconditions. However, currently, decreases clauses may be parsed as preconditions, and thus Viper rejects axioms that refer to functions that have no real preconditions but do have a decreases clause.

This PR changes this behavior by ensuring that only preconditions with a requires-keyword are counted when checking if a function application inside an axiom is allowed. The reason we're checking for the presence of the requires-keyword and not the absence of a decreases-keyword or the presence of a decreases clause in the actual precondition expression is to avoid a dependency from Viper's type checker to the termination plugin.

@marcoeilers marcoeilers changed the title Allow domain axioms to use functions that have requires clauses Allow domain axioms to use functions that have decreases clauses Jun 12, 2024
@marcoeilers marcoeilers merged commit 93bc9b7 into master Jun 25, 2024
5 checks passed
@marcoeilers marcoeilers deleted the meilers_dont_count_requires_as_pre branch June 25, 2024 19:23
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.

None yet

1 participant