Skip to content

Commit 1856253

Browse files
committed
Supporting mce on demand via annotation
1 parent 1e3c903 commit 1856253

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/main/scala/rules/ExecutionFlowController.scala

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
package viper.silicon.rules
88

9+
import viper.silver.ast
910
import viper.silicon.Config.ExhaleMode
1011
import viper.silicon.interfaces._
1112
import viper.silicon.logger.records.data.CommentRecord
@@ -129,7 +130,19 @@ object executionFlowController extends ExecutionFlowRules {
129130

130131
val comLog = new CommentRecord("Retry", s0, v.decider.pcs)
131132
val sepIdentifier = v.symbExLog.openScope(comLog)
132-
val temporaryMCE = Verifier.config.exhaleMode != ExhaleMode.Greedy
133+
val temporaryMCE = s0.currentMember.map(_.info.getUniqueInfo[ast.AnnotationInfo]) match {
134+
case Some(Some(ai)) if ai.values.contains("exhaleMode") =>
135+
ai.values("exhaleMode") match {
136+
case Seq("0") | Seq("greedy") =>
137+
false
138+
case Seq("1") | Seq("mce") | Seq("moreCompleteExhale") | Seq("2") | Seq("mceOnDemand") => true
139+
case _ =>
140+
// Invalid annotation was already reported when creating the initial state.
141+
Verifier.config.exhaleMode != ExhaleMode.Greedy
142+
}
143+
case _ => Verifier.config.exhaleMode != ExhaleMode.Greedy
144+
}
145+
133146
action(s0.copy(retrying = true, retryLevel = s.retryLevel, moreCompleteExhale = temporaryMCE), v, (s1, r, v1) => {
134147
v1.symbExLog.closeScope(sepIdentifier)
135148
Q(s1.copy(retrying = false, moreCompleteExhale = s0.moreCompleteExhale), r, v1)

src/main/scala/verifier/DefaultMainVerifier.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class DefaultMainVerifier(config: Config,
306306
val mce = member.info.getUniqueInfo[ast.AnnotationInfo] match {
307307
case Some(ai) if ai.values.contains("exhaleMode") =>
308308
ai.values("exhaleMode") match {
309-
case Seq("0") | Seq("greedy") =>
309+
case Seq("0") | Seq("greedy") | Seq("2") | Seq("mceOnDemand") =>
310310
if (Verifier.config.counterexample.isSupplied)
311311
reporter report AnnotationWarning(s"Member ${member.name} has exhaleMode annotation that may interfere with counterexample generation.")
312312
false

0 commit comments

Comments
 (0)