[Plugin] Translation of Entity Verification Results#641
Merged
Conversation
…s and adapts the plugins
Member
Author
|
I've noticed some issues that I first need to address |
…ugin state to the AST itself
…rmining whether a verification has occurred or not for a given refute statement
marcoeilers
approved these changes
Jan 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds another hook to the plugin infrastructure such that plugins can translation entity verification results.
For most plugins, the translation in this step is supposed to be identical to translating the overall verification result (which is the case for the current set of plugins).
The refute plugin has been adapted to (1) be aware of refute statements per entity (and thus support streaming of verification results) and (2) be stateless. The latter is achieved by storing all necessary information in the AST (as Info) instead of in the plugin's state. For this purpose,
mapVerificationResulttakes now the AST (as produced after applying all plugins'beforeVerify) as parameter such that plugins do not need to store the AST.Furthermore, this PR changes
SilFrontendto apply filtering of methods (based on the configuration) and to apply all plugins'beforeVerifyat the beginning of the verification phase (instead of at the end of the consistency check phase). This is irrelevant for instances ofSilFrontendthat execute both, the consistency check phase followed by the verification phase. However,ViperAstProvideris an instance that only performs the phases up to including consistency checking (i.e. without verifying the resulting AST).This change has two purposes:
beforeVerifybefore verifying an AST.ViperAstProvider) and (2) verifying an AST (by using SiliconFrontend, CarbonFrontend or a custom frontend in an abusive way such that the enclosed verifier is used without executing all phases). This change moves the application ofbeforeVerifyto ViperServer's second step, which not only gives the second step more flexibility to decide when exactly to applybeforeVerify(i.e. before or after applying the cache) but also provides flexibility to plugin implementations as their state is maintained betweenbeforeVerifyandmapVerificationResult(this was not the case in the past because separate instances of the plugin are used by the two ViperServer steps (which however remains the case)).The latter change made the changes to
AstPositionsTestsnecessary because the resulting AST (produced byViperAstProvider) now looks apparently different (imho better / as one would expect).Fixes #634