-
Notifications
You must be signed in to change notification settings - Fork 42
[Experimental] Classify each SMT-query #966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jcp19
wants to merge
11
commits into
master
Choose a base branch
from
claude/extend-prover-interface-n7IQJ
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c6d5df8
Extend Decider interface with per-query kind, member, position, and t…
claude b868f87
Add ProofQueryKind.Unknown for unclassified SMT queries
claude 4a69247
Fix two compilation errors in Evaluator and QuantifiedChunkSupport
claude 0691f6b
Merge recordProofQueries and proofQueryCsvFile into single option; fi…
claude a2b62f6
Thread member name through call sites that previously lacked access t…
claude eb2b81b
Add optional description field to ProofQueryRecord for sparse on-dema…
claude 652f088
Skip recording trivially-known queries; fix missing source positions
claude 5722c2e
Thread member and pos through findChunk / findChunkWithProver
claude 0351b5c
Annotate SMT query call sites with descriptions
claude 9842c52
Pass member and pos through HeapSupporter field-assign chunk heuristic
claude 4aca93b
Make kind required in check/assert: remove default ProofQueryKind.Con…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // This Source Code Form is subject to the terms of the Mozilla Public | ||
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| // | ||
| // Copyright (c) 2011-2019 ETH Zurich. | ||
|
|
||
| package viper.silicon.interfaces.decider | ||
|
|
||
| /** Categorises the purpose of an SMT query (assert or check) issued by the verifier. */ | ||
| sealed trait ProofQueryKind | ||
|
|
||
| object ProofQueryKind { | ||
| /** (a) Consistency checks: non-negative/positive permission assertions, injectivity checks | ||
| * in quantified permissions, and similar well-formedness obligations. */ | ||
| case object Consistency extends ProofQueryKind | ||
|
|
||
| /** (b) Heap proof obligations: chunk-existence checks, permission-amount checks during | ||
| * consume/produce operations, and related heap-access correctness queries. */ | ||
| case object Heap extends ProofQueryKind | ||
|
|
||
| /** (c) Functional-correctness queries: pre/postcondition checks, assert-statement assertions, | ||
| * array-index bounds, divisor non-zero, and similar user-visible proof obligations. */ | ||
| case object FunctionalCorrectness extends ProofQueryKind | ||
|
|
||
| /** (d) Axiomatisation queries: consistency of function, domain, or predicate axioms | ||
| * (rare – axioms are mostly assumed, not asserted). */ | ||
| case object Axiomatization extends ProofQueryKind | ||
|
|
||
| /** (e) Path-infeasibility checks: smoke checks and branch-feasibility tests that determine | ||
| * whether the current execution path is reachable at all. */ | ||
| case object PathInfeasibility extends ProofQueryKind | ||
|
|
||
| /** (f) Unknown: used when the purpose of the query does not clearly fall into any of the | ||
| * above categories, or has not yet been classified. */ | ||
| case object Unknown extends ProofQueryKind | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // This Source Code Form is subject to the terms of the Mozilla Public | ||
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| // | ||
| // Copyright (c) 2011-2019 ETH Zurich. | ||
|
|
||
| package viper.silicon.reporting | ||
|
|
||
| import viper.silver.ast | ||
| import viper.silicon.interfaces.decider.ProofQueryKind | ||
| import java.util.concurrent.ConcurrentLinkedQueue | ||
| import scala.jdk.CollectionConverters._ | ||
|
|
||
| /** | ||
| * One recorded SMT query (assert or check) with contextual information. | ||
| * | ||
| * @param isAssert true = emitted from [[viper.silicon.decider.Decider#assert]], | ||
| * false = emitted from [[viper.silicon.decider.Decider#check]] or | ||
| * [[viper.silicon.decider.Decider#checkSmoke]]. | ||
| * @param member Name of the program member (method/function/predicate/domain) whose | ||
| * verification triggered this query, if known. | ||
| * @param pos Source position of the proof obligation. | ||
| * @param kind Category of the query (see [[ProofQueryKind]]). | ||
| * @param durationMs Wall-clock duration in milliseconds (includes prover call only, not | ||
| * path-condition trivial-check short-circuit). | ||
| * @param succeeded Whether the query returned true / Unsat. | ||
| * @param description Optional free-text description of the specific proof obligation, | ||
| * populated on demand at call sites where extra clarity is useful. | ||
| */ | ||
| case class ProofQueryRecord( | ||
| isAssert: Boolean, | ||
| member: Option[String], | ||
| pos: ast.Position, | ||
| kind: ProofQueryKind, | ||
| durationMs: Double, | ||
| succeeded: Boolean, | ||
| description: Option[String] = None | ||
| ) | ||
|
|
||
| /** | ||
| * Thread-safe global collector for [[ProofQueryRecord]]s. | ||
| * | ||
| * Records are appended concurrently during parallel verification and can be | ||
| * retrieved at the end via [[records]]. Call [[clear]] between verification runs. | ||
| */ | ||
| object ProofQueryCollector { | ||
| private val _records = new ConcurrentLinkedQueue[ProofQueryRecord]() | ||
|
|
||
| def record(r: ProofQueryRecord): Unit = _records.add(r) | ||
|
|
||
| def records: Seq[ProofQueryRecord] = _records.iterator().asScala.toSeq | ||
|
|
||
| def clear(): Unit = _records.clear() | ||
| } |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: improve description