Map auto-generated impl proofs to their implements clause in dependency analysis#1049
Draft
jcp19 wants to merge 2 commits into
Draft
Map auto-generated impl proofs to their implements clause in dependency analysis#1049jcp19 wants to merge 2 commits into
implements clause in dependency analysis#1049jcp19 wants to merge 2 commits into
Conversation
…ency analysis For an implementation proof that Gobra generates itself (the user wrote an `implements` clause but no proof body, or only a partial one), the Viper nodes of the generated proof previously inherited their dependency-analysis source from wherever they were built: the interface method's pre-/postconditions, the concrete method declaration, and its implicit pre-/postconditions. As a result the dependency analysis reported the proof's obligations as several unrelated Gobra nodes instead of one, and duplicated interface-spec nodes (issue #1042). This attaches the `implements` clause as the dependency-analysis source info of every Viper node of the generated proof, so the analysis presents them as a single dependency node (the clause). The change is confined to the dependency analysis: each node's Verifier.Info, position and error transformer are left untouched, so the position of verification errors is unchanged. Proofs without an `implements` clause and user-provided proof bodies are left exactly as before. - MethodSubtypeProof / PureMethodSubtypeProof carry the optional clause source. - Desugar looks up the clause via a new TypeInfo.localImplementationProofNode. - InterfaceEncoding stamps the clause source over the generated proof subtree. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ooFpeAJHUgFCaStKfdUTy
…ncy node Extends the previous change so that generated implementation proofs are handled in both cases the dependency analysis cares about: - With an `implements` clause: all Viper nodes of the generated proof are presented as the single clause node (as before). - Without a clause (the proof is demanded e.g. only by an upcast): all its Viper nodes are grouped into one node marked internal via DependencyType Internal, so it stays in the lower-level graph and is hidden from the user, while the existing SimpleDependencyAnalysisJoin tags keep it connected to the corresponding upcasts. An auto-generated check on the AutoImplProofAnnotation distinguishes generated proofs from user-provided ones (both carry no clause source), so user-provided proofs remain untouched. Verifier.Info, positions and error transformers are preserved throughout, so verification error positions are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ooFpeAJHUgFCaStKfdUTy
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.
For an implementation proof that Gobra generates itself (the user wrote an
implementsclause but no proof body, or only a partial one), the Viper nodes of the generated proof previously inherited their dependency-analysis source from wherever they were built: the interface method's pre-/postconditions, the concrete method declaration, and its implicit pre-/postconditions. As a result the dependency analysis reported the proof's obligations as several unrelated Gobra nodes instead of one, and duplicated interface-spec nodes (issue #1042).This attaches the
implementsclause as the dependency-analysis source info of every Viper node of the generated proof, so the analysis presents them as a single dependency node (the clause). The change is confined to the dependency analysis: each node's Verifier.Info, position and error transformer are left untouched, so the position of verification errors is unchanged. Proofs without animplementsclause and user-provided proof bodies are left exactly as before.Claude-Session: https://claude.ai/code/session_017ooFpeAJHUgFCaStKfdUTy