@@ -54,7 +54,6 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
5454 val pre = specs.map(spec => spec match {
5555 case Precondition (cond) => Precondition (exprOps.replaceFromSymbols(specsMap, cond))
5656 case LetInSpec (vd, expr) => LetInSpec (vd, exprOps.replaceFromSymbols(specsMap, expr))
57- case s => s
5857 })
5958
6059 val res = s.ValDef .fresh(" res" , s.UnitType ())
@@ -104,8 +103,7 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
104103 => {
105104 val paramVars = fd.params.map(_.toVariable)
106105 val argCheck = args.forall(paramVars.contains) && args.toSet.size == args.size
107- if (argCheck)
108- funInv = Some (fi)
106+ if (argCheck) funInv = Some (fi)
109107 }
110108 case _ =>
111109 }(post)
@@ -117,7 +115,7 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
117115 funInv match {
118116 case Some (finv) => {
119117 // make a helper lemma:
120- val helper = inductPattern(symbols, symbols.functions(finv.id), fd)
118+ val helper = inductPattern(symbols, symbols.functions(finv.id), fd).setPos(fd.getPos)
121119
122120 // transform the main lemma
123121 val proof = FunctionInvocation (helper.id, fd.tparams.map(_.tp), fd.params.map(_.toVariable))
@@ -126,7 +124,7 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
126124 val lemma = fd.copy(
127125 fullBody = BodyWithSpecs (withPre).reconstructed,
128126 flags = (s.Derived (fd.id) +: s.Derived (finv.id) +: (fd.flags.filterNot(f => f.name == " traceInduct" ))).distinct
129- ).copiedFrom(fd)
127+ ).copiedFrom(fd).setPos(fd.getPos)
130128
131129 Trace .setTrace(lemma.id)
132130 Trace .setProof(helper.id)
@@ -135,7 +133,7 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
135133 case None => {
136134 val lemma = fd.copy(
137135 flags = (s.Derived (fd.id) +: (fd.flags.filterNot(f => f.name == " traceInduct" )))
138- ).copiedFrom(fd)
136+ ).copiedFrom(fd).setPos(fd.getPos)
139137 Trace .setTrace(lemma.id)
140138 List (lemma)
141139 }
@@ -200,8 +198,9 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
200198 case Precondition (cond) => Precondition (exprOps.replaceFromSymbols(specsMap, cond)).setPos(spec)
201199 case LetInSpec (vd, expr) => LetInSpec (vd, exprOps.replaceFromSymbols(specsMap, expr)).setPos(spec)
202200 case Measure (measure) => Measure (exprOps.replaceFromSymbols(specsMap, measure)).setPos(spec)
203- case s => s
201+ case s => context.reporter.fatalError( s " Unsupported specs: $s " )
204202 })
203+
205204 val withPre = exprOps.reconstructSpecs(pre, Some (fullBodySpecialized), indPattern.returnType)
206205
207206 val speccedLemma = BodyWithSpecs (lemma.fullBody).addPost
@@ -230,24 +229,14 @@ trait Trace extends CachingPhase with IdentityFunctions with IdentitySorts { sel
230229 functions map CheckFilter .fullNameToPath
231230 }
232231
233- private def shouldBeChecked (fid : Identifier ): Boolean = pathsOpt match {
234- case None => false
235-
236- case Some (paths) =>
237- // Support wildcard `_` as specified in the documentation.
238- // A leading wildcard is always assumed.
239- val path : Path = CheckFilter .fullNameToPath(CheckFilter .fixedFullName(fid))
240- paths exists { p =>
241- if (p endsWith Seq (" _" )) path containsSlice p.init
242- else path endsWith p
243- }
244- }
245-
246232 private lazy val pathsOptModels : Option [Seq [Path ]] = context.options.findOption(optModels) map { functions =>
247233 functions map CheckFilter .fullNameToPath
248234 }
249235
250- private def isModel (fid : Identifier ): Boolean = pathsOptModels match {
236+ private def shouldBeChecked (fid : Identifier ): Boolean = shouldBeChecked(pathsOpt, fid)
237+ private def isModel (fid : Identifier ): Boolean = shouldBeChecked(pathsOptModels, fid)
238+
239+ private def shouldBeChecked (paths : Option [Seq [Path ]], fid : Identifier ): Boolean = paths match {
251240 case None => false
252241
253242 case Some (paths) =>
0 commit comments