Skip to content

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

Merged
marcoeilers merged 4 commits into
masterfrom
meilers_dont_count_requires_as_pre
Jun 25, 2024
Merged

Allow domain axioms to use functions that have decreases clauses#802
marcoeilers merged 4 commits into
masterfrom
meilers_dont_count_requires_as_pre

Conversation

@marcoeilers

Copy link
Copy Markdown
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 requested a review from JonasAlaif June 11, 2024 15:58
@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 enabled auto-merge June 25, 2024 19:02
@marcoeilers marcoeilers merged commit 93bc9b7 into master Jun 25, 2024
@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.

1 participant