@@ -5,7 +5,6 @@ import viper.silver.ast._
55import viper .silver .ast .utility .ViperStrategy
66import viper .silver .cfg .silver .SilverCfg
77import viper .silver .cfg .silver .SilverCfg .SilverBlock
8- import viper .silver .cfg .utility .IdInfo
98import viper .silver .parser .FastParser
109import viper .silver .plugin .standard .refute .Refute
1110import viper .silver .plugin .{ParserPluginTemplate , SilverPlugin }
@@ -85,7 +84,7 @@ class SmokeDetectionPlugin(@unused reporter: viper.silver.reporter.Reporter,
8584
8685 ViperStrategy .Slim ({
8786 case r@ Refute (_) =>
88- val idInfo = r.info.getUniqueInfo[IdInfo ]
87+ val idInfo = r.info.getUniqueInfo[SmokeDetectionInfo ]
8988
9089 if (idInfo.isDefined &&
9190 ! result._1.contains(idInfo.get.id) && // not marked reachable
@@ -124,7 +123,7 @@ class SmokeDetectionPlugin(@unused reporter: viper.silver.reporter.Reporter,
124123 * @return a [[Refute ]] instance with with the `exp` set to `false` and the given position and ID
125124 */
126125 private def refuteFalse (pos : Position , id : Int ): Refute = {
127- Refute (FalseLit ()(pos))(pos, IdInfo (id))
126+ Refute (FalseLit ()(pos))(pos, SmokeDetectionInfo (id))
128127 }
129128
130129 /**
@@ -176,7 +175,7 @@ class SmokeDetectionPlugin(@unused reporter: viper.silver.reporter.Reporter,
176175 unreachableSuccessors = true
177176 case refute : Refute if refute.exp.isInstanceOf [FalseLit ] =>
178177 // Encountered `refute false` statement -> add ID to list if it is reachable
179- val idInfo = refute.info.getUniqueInfo[IdInfo ]
178+ val idInfo = refute.info.getUniqueInfo[SmokeDetectionInfo ]
180179
181180 if (idInfo.isDefined) {
182181 val id = idInfo.get.id
@@ -222,3 +221,15 @@ class SmokeDetectionPlugin(@unused reporter: viper.silver.reporter.Reporter,
222221 successors.forall(s => collectRefutesToKeepUntilExit(cfg, s, exits, seen, refutesToKeep, seenRefutes, unreachableSuccessors))
223222 }
224223}
224+
225+ /**
226+ * An info used to mark AST nodes (more specifically, `refute false` statements) as used in smoke detection,
227+ * also assigning a unique identifier to it.
228+ *
229+ * @param id the ID of the node
230+ */
231+ case class SmokeDetectionInfo (id : Int ) extends Info {
232+ override def comment : Seq [String ] = Seq (s " `refute false` # $id" )
233+
234+ override def isCached : Boolean = false
235+ }
0 commit comments