Skip to content

Auto-including well-foundedness functions and axioms when they are used#710

Merged
marcoeilers merged 9 commits into
masterfrom
meilers_decreases_autoimport
Jul 20, 2023
Merged

Auto-including well-foundedness functions and axioms when they are used#710
marcoeilers merged 9 commits into
masterfrom
meilers_decreases_autoimport

Conversation

@marcoeilers

Copy link
Copy Markdown
Contributor

This is an extension of the termination plugin that auto-includes the relevant functions and axioms used by the generated proof obligations if the program does not already include them. This is to address the problem that writing decreases e without having the relevant input currently leads to a rather cryptic error message that informs the user that the functions "bounded" and "decreasing" were not found in the program, without any hint that an import is missing (and what the imported file should be).

That is,

  • it collects all decreases clauses in the program
  • for a decreases term of type T, it checks if the domain TWellFoundedOrder is already in the program
  • if not, it adds it to the program (by generating a second program containing only the relevant input and adding it to the program being verified)

For programs that contain all relevant definitions, nothing changes. For programs that already contain some but not all required imports, only the missing ones are added.

Instead of adding new tests, this PR removes (some of) the existing imports for some termination tests.

@marcoeilers

Copy link
Copy Markdown
Contributor Author

I'm not sure who to ask to review this. Who's worked on the termination plugin before? @ArquintL maybe?

@ArquintL ArquintL self-requested a review June 8, 2023 14:03
Comment thread src/main/scala/viper/silver/frontend/ViperPAstProvider.scala Outdated
@marcoeilers marcoeilers merged commit 7f1385b into master Jul 20, 2023
@marcoeilers marcoeilers deleted the meilers_decreases_autoimport branch July 20, 2023 19:10
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