Skip to content
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

Add block level message types #812

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
.cache
project/project/**
bin/**
Expand Down
21 changes: 21 additions & 0 deletions src/main/scala/viper/silver/reporter/Message.scala
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,24 @@ case class VerificationTerminationMessage() extends Message {
override val toString: String = "verification_termination_message"
override val name: String = "verification_termination_message"
}

/** Reported when a block of a method CFG is reached.
*/
case class BlockReachedMessage(methodName: String, label: String, pathId: Int) extends Message {
override val toString: String = s"block_reached_message(methodName=$methodName, label=$label, pathId=$pathId)"
override val name: String = "block_reached_message"
}

/** Reported when a block of a method CFG failed
*/
case class BlockFailureMessage(methodName: String, label: String, pathId: Int) extends Message {
override val toString: String = s"block_failure_message(methodName=$methodName, label=$label, pathId=$pathId)"
override val name: String = "block_failure_message"
}

/** Reported when an execution path through a method has completed.
*/
case class PathProcessedMessage(methodName: String, pathId: Int, result: String) extends Message {
override val toString: String = s"path_processed_message(methodName=$methodName, pathId=$pathId, result=$result)"
override val name: String = "path_processed_message"
}
6 changes: 6 additions & 0 deletions src/main/scala/viper/silver/reporter/Reporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ case class CSVReporter(name: String = "csv_reporter", path: String = "report.csv
case q: QuantifierInstantiationsMessage => csv_file.write(s"${q.toString}\n")
case q: QuantifierChosenTriggersMessage => csv_file.write(s"${q.toString}\n")
case t: VerificationTerminationMessage => csv_file.write(s"${t.toString}\n")
case r: BlockReachedMessage => csv_file.write(s"${r.toString}\n")
case f: BlockFailureMessage => csv_file.write(s"${f.toString}\n")
case p: PathProcessedMessage => csv_file.write(s"${p.toString}\n")
case _ =>
println( s"Cannot properly print message of unsupported type: $msg" )
}
Expand Down Expand Up @@ -188,6 +191,9 @@ case class StdIOReporter(name: String = "stdout_reporter", timeInfo: Boolean = t
case _: QuantifierInstantiationsMessage => // too verbose, do not print
case _: QuantifierChosenTriggersMessage => // too verbose, do not print
case _: VerificationTerminationMessage =>
case _: BlockReachedMessage => // println(msg)
case _: BlockFailureMessage => // println(msg)
case _: PathProcessedMessage => // println(msg)
case _ =>
println( s"Cannot properly print message of unsupported type: $msg" )
}
Expand Down
Loading