Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ce5a4f1
Improve SymbExLogger:
Jun 8, 2022
88c2a54
move smt delta calculation to ProverStdIO for thread safety
Jun 8, 2022
8fab02f
move smt statistics calculations out of ProverStdIO
Jun 29, 2022
10940f0
Merge branch 'upstream-master'
Sep 23, 2022
91372f4
Bump silver submodule to master branch version
Sep 23, 2022
70e0678
Merge branch 'upstream-master'
Sep 23, 2022
952f78b
Merge branch 'upstream-master'
Nov 15, 2022
7876aea
move symbexlogger state into classes, shim the old usage
Nov 17, 2022
0ea06e8
make Verifier own a current MemberSymbExLogger
Nov 17, 2022
bd87c97
Give Verifier the capability to open symbexlogs for members
Nov 17, 2022
35a2ff0
swap out shims
Nov 17, 2022
4aadffe
some bugs:
Nov 17, 2022
aa57446
address comment
Nov 17, 2022
05caac5
make NoopLog do nothing
Nov 17, 2022
19f9a37
also do nothing on whenEnabled for NoopLog
Nov 17, 2022
11037a5
symbexlogs can be closed: they do not accept further records (now unr…
pieter-bos Nov 18, 2022
e73b8ce
close log on timeout
pieter-bos Nov 18, 2022
285baec
SymbExLogger.ofConfig makes the silicon slightly less lazy, so invali…
pieter-bos Nov 18, 2022
d816372
use NoopMemberSymbExLog if there is no log yet (a bug, but better tha…
pieter-bos Nov 18, 2022
f17c120
move config to concrete logger; state is always null, so drop it.
pieter-bos Nov 18, 2022
a1f2b6c
Merge branch 'upstream-master'
pieter-bos Nov 25, 2022
4846a2c
update silver
pieter-bos Nov 25, 2022
505c61b
change by-name trickery to lambdas
Nov 29, 2022
a32cc49
remove debug println
Nov 29, 2022
a2daeed
namespace Member
Nov 29, 2022
c060dc1
clarify val names for Config vs LogConfig
Nov 29, 2022
4b9728e
Revert "change by-name trickery to lambdas"
Nov 29, 2022
6951369
validateFileOpt already checks whether the file exists
pieter-bos Nov 30, 2022
0939b02
log a warning when the symbexlog config cannot be parsed
pieter-bos Nov 30, 2022
2edf5a8
no delta for values not yet encountered
pieter-bos Nov 30, 2022
85bd80d
use the symbExLog of the current verifier
pieter-bos Nov 30, 2022
aab07e5
resolve warnings: clean up imports; mark unused vals as @unused
pieter-bos Nov 30, 2022
754f2ec
Merge branch 'upstream-master'
pieter-bos Nov 30, 2022
59f43e1
missed merge conflict: just use ours
pieter-bos Nov 30, 2022
b333909
adjust documentation
pieter-bos Nov 30, 2022
6dff920
update silver
pieter-bos Nov 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/main/scala/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -735,19 +735,6 @@ class Config(args: Seq[String]) extends SilFrontendConfig(args, "Silicon") {
case _ => Right(())
}

validateOpt(ideModeAdvanced, numberOfParallelVerifiers) {
case (Some(false), _) =>
Right(())
case (Some(true), Some(n)) =>
if (n == 1)
Right(())
else
Left( s"Option ${ideModeAdvanced.name} requires setting "
+ s"${numberOfParallelVerifiers.name} to 1")
case other =>
sys.error(s"Unexpected combination: $other")
}

validateOpt(counterexample, enableMoreCompleteExhale) {
case (Some(_), Some(false)) => Left( s"Option ${counterexample.name} requires setting "
+ s"flag ${enableMoreCompleteExhale.name}")
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/Silicon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Silicon(val reporter: Reporter, private var debugInfo: Seq[(String, Any)]
// verification was interrupted, therefore close the current member's scope:
SymbExLogger.currentLog().closeMemberScope()
if (config.ideModeAdvanced()) {
reporter report ExecutionTraceReport(SymbExLogger.memberList, List(), List())
reporter report ExecutionTraceReport(SymbExLogger.memberList.toIndexedSeq, List(), List())
}
result = Some(SilFailure(SilTimeoutOccurred(config.timeout(), "second(s)") :: Nil))
case exception: Exception if !config.disableCatchingExceptions() =>
Expand Down
4 changes: 1 addition & 3 deletions src/main/scala/decider/Decider.scala
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ trait DefaultDeciderProvider extends VerifierComponent { this: Verifier =>
val result = prover.assert(t, timeout)

if (SymbExLogger.enabled) {
val statistics = prover.statistics()
val deltaStatistics = SymbExLogger.getDeltaSmtStatistics(statistics)
assertRecord.statistics = Some(statistics ++ deltaStatistics)
assertRecord.statistics = Some(prover.deltaStatistics())
}

SymbExLogger.currentLog().closeScope(sepIdentifier)
Expand Down
42 changes: 41 additions & 1 deletion src/main/scala/decider/ProverStdIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ abstract class ProverStdIO(uniqueId: String,

var proverPath: Path = _
var lastModel : String = _
var lastStatistics: Map[String, String] = Map.empty

def name: String
def minVersion: Version
Expand Down Expand Up @@ -319,7 +320,7 @@ abstract class ProverStdIO(uniqueId: String,
}
}

def statistics(): Map[String, String] = {
private def queryStatistics(): Map[String, String] = {
var repeat = true
var line = ""
var stats = scala.collection.immutable.SortedMap[String, String]()
Expand Down Expand Up @@ -347,6 +348,45 @@ abstract class ProverStdIO(uniqueId: String,
toMap(stats)
}

def statistics(): Map[String, String] = {
lastStatistics = queryStatistics()
lastStatistics
}

/**
Comment thread
pieter-bos marked this conversation as resolved.
Outdated
* Queries the statistics, and calculates the diff between it and the last statistics query.
* The difference is calculated if value can be converted to an int or double
* @return map with the current statistics, and the differences (only containing values that could be converted)
* and keys with appended "-delta"
*/
def deltaStatistics(): Map[String, String] = {
val currentStatistics = queryStatistics()
val deltaStatistics = currentStatistics map getDelta filter { case (_, value) => value.nonEmpty } map {
case (key, Some(value)) => (key + "-delta", value)
case other => sys.error(s"Unexpected result pair $other")
}
lastStatistics = lastStatistics ++ currentStatistics
currentStatistics ++ deltaStatistics
}

private def getDelta(pair: (String, String)): (String, Option[String]) = {
val curValInt = pair._2.toIntOption
val prevValInt = lastStatistics.get(pair._1) match {
case Some(value) => value.toIntOption
case _ => Some(0) // value not found
}
val curValDouble = pair._2.toDoubleOption
val prevValDouble = lastStatistics.get(pair._1) match {
case Some(value) => value.toDoubleOption
case _ => Some(0.0) // value not found
}
(curValInt, prevValInt, curValDouble, prevValDouble) match {
case (Some(curInt), Some(prevInt), _, _) => (pair._1, Some((curInt - prevInt).toString))
case (_, _, Some(curDouble), Some(prevDouble)) => (pair._1, Some((curDouble - prevDouble).toString))
case _ => (pair._1, None)
}
}

def comment(str: String): Unit = {
val sanitisedStr =
str.replaceAll("\r", "")
Expand Down
15 changes: 14 additions & 1 deletion src/main/scala/logger/LogConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@
package viper.silicon.logger

import spray.json._
import viper.silicon.logger.records.data.DataRecord

case class LogConfig(isBlackList: Boolean,
includeStore: Boolean, includeHeap: Boolean, includeOldHeap: Boolean, includePcs: Boolean,
recordConfigs: List[RecordConfig])
recordConfigs: List[RecordConfig]) {
def getRecordConfig(d: DataRecord): Option[RecordConfig] = {
for (rc <- recordConfigs) {
if (rc.kind.equals(d.toTypeString)) {
rc.value match {
case Some(value) => if (value.equals(d.toSimpleString)) return Some(rc)
case _ => return Some(rc)
Comment thread
pieter-bos marked this conversation as resolved.
Outdated
}
}
}
None
}
}

object LogConfig {
def default(): LogConfig = LogConfig(
Expand Down
Loading