Repository navigation
E15: a failure points at the part that fails, and a call at the callee's clause - #114
Merged
Merged
Conversation
…erms carry their construct's place.
…S runner can meet.
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.
Plan item E15, its first part (F31 of the plan's findings): a failure points at the part of its check that fails, not at the whole clause or the start of the statement, and a failure at a call shows the callee's clause that does not hold. This PR is stacked on #111 (H5).
What a failure looks like
On the base:
With this PR:
At
w = 1the product fits and the sum overflows, so the caret is at+. Incv::post(0 <= cv::result && cv::result <= 50)with a result of 51 the error is atcv::result <= 50; a disjunction, which fails only when all of it does, is shown whole.JSON gives the callee's clause as
related(message and source), SARIF as a related location, and a GitHub annotation as a line of its message.Design, from the references
TrSplitExpr), so an error is at its conjunct. At a call it reports "a precondition for this call could not be proved", with the conjunct as a related location: "this is the precondition that could not be proved".requiresclause "failed precondition".-wp-split).Splitting before solving multiplies the queries and changes what an obligation is. Here a failure already has a certified counterexample, so the part that fails is found from it, after solving:
PassiveStmt::Focus). For a callee's precondition, it records the call expression (VCallStmt::CallSite) and the callee's clause (PassiveStmt::Clause). A definedness check made at an operation's operator spans the operation.failingPlace(Driver/Counterexample.cpp) finds the checked condition in the goal under its assumptions and evaluates its parts at the counterexample's values, with the certifier's evaluator:What it took besides:
cv::post(cv::result == n + 1)was "narrowed" tocv::result. They now take the comparison's location and span (asWritten): the terms built for one construct carry its place, so its parts are shown as the comparison. A first version instead split only the conjunctions whose parts lie on either side of their&&; with the terms placed, that rule changed no place, and its mutant survived, so it is gone.constexprhelper would have moved into the helper's body. A focus outside the verified function's own source (VFunction::Extent) is dropped when the module's sources are annotated, so such a check stays at the statement that calls the helper, as before.--confirm-bound) looks for copies of a failed check by its anchor, so its notes are computed before the failure is placed.substParams,substParamsInExpr), so a callee's clause instantiated at a call still spans its source.Each mutant below, applied alone and rebuilt, is caught by
failing_place.cpp,inductive_counterexamples.cpp,assertions.cpp,failure_notes.cpp,obligation_archive.test,max_failures.cpp, orpointer_subobjects.cpp(17 of 17):relatedTests
suite/failing_place.cpp(new):&&; one in a branch;cv::preclauses; a member function's; an inner call that is an argument of another;relatedrecord, SARIF's related location, and the GitHub annotation;inductive_counterexamples.cppthe comparison's lowered terms and the confirmation's notes,assertions.cppthe lifted helper.obligation_archive.testand its archive mutator read schema v6, write v5 records, and check that a version 7 is refused.On the base
failing_place.cppfails at its first check:clampis reported at the clause's top-level&&.On a release build of this branch the whole Verify suite passes (503 tests, one unsupported), the docs check passes (268 examples, 0 failed), and so do the unit tests (63, one skipped). After the conjunction rule was removed, the 29 tests that pin places and the docs check were run again and pass.
Docs
related; SARIF; GitHub annotations; a check's ID and its caret; archive schema v6 and replay.Not done
self: reference arguments require ...); that is on the base too.Stacked on #111.