Skip to content

Reporting of all errors in the entity result messages#677

Merged
ArquintL merged 3 commits into
masterfrom
report-all-encountered-errors-in-entity-msg
Jan 6, 2023
Merged

Reporting of all errors in the entity result messages#677
ArquintL merged 3 commits into
masterfrom
report-all-encountered-errors-in-entity-msg

Conversation

@ArquintL

@ArquintL ArquintL commented Jan 6, 2023

Copy link
Copy Markdown
Member

Use case for expected errors

Josua Stuck has added the concept of expected verification errors which make Silicon continue despite the occurrence of an error. This feature is in particular used by the refute plugin that marks all encoded refute statements as expected verification errors. These expected errors won't be reported to the user by the refute plugin and instead the plugin produces verification errors for encoded refute statements for which no error has been encountered by Silicon.

Keeping track of expected errors in Silicon

Silicon keeps track of these expected and encountered verification errors in the previous field of Silicon's VerificationResult. It seems that the first encountered error is the verification result and all subsequent verification errors (due to continuing with verifying the input) are placed in the previous field.

Post-processing expected errors - so far

The DefaultMainVerifier used to produce verification results per member while ignoring the previous field, i.e. the first encountered error is returned. Silicon line 247 retrieved the errors encountered after the first one by taking the previous field into account and flatting all verification results.

Issue

DefaultMainVerifier is responsible for emitting entity verification result messages. Since the DefaultMainVerifier does not consider the previous field of verification results, entity verification result messages contain different (i.e. a subset) of errors compared to Silicon's overall result (when considering the errors for the same member).
This behavior is problematic in the context of Silver #641 since plugins will handle entity verification result such that the ViperServer & the IDE support plugins (see ViperServer #99).

Post-processing expected errors - new

This PR basically moves Silicon line 247 into DefaultMainVerifier to ensure that the union of all entity verification results (hopefully) correspond to the overall result returned by Silicon. Note however that grouping, sorting, and dealing with branch conditions have been left in Silicon as imho this concerns more errors will be printed and it's not immediately clear whether this functionality can be as easily moved into DefaultMainVerifier , even though this could make sense in the long run.

… at hand) as Silicon will report at the very end
@ArquintL ArquintL changed the title Reporting of expected (and encountered) errors in the entity result messages Reporting of all errors in the entity result messages Jan 6, 2023

@mschwerhoff mschwerhoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left two comments, otherwise OK.

Comment thread src/main/scala/Silicon.scala
Comment thread src/main/scala/verifier/DefaultMainVerifier.scala Outdated
@ArquintL

ArquintL commented Jan 6, 2023

Copy link
Copy Markdown
Member Author

bors merge

@ArquintL ArquintL merged commit ffcdb1f into master Jan 6, 2023
@ArquintL ArquintL deleted the report-all-encountered-errors-in-entity-msg branch January 6, 2023 15:18
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.

3 participants