Skip to content

Commit bc20bee

Browse files
committed
Trying out not translating FuncApp triggers to their limited version
1 parent 61eeb81 commit bc20bee

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/main/scala/rules/Evaluator.scala

+1-13
Original file line numberDiff line numberDiff line change
@@ -1562,22 +1562,10 @@ object evaluator extends EvaluationRules {
15621562
(Q: (State, Seq[Term], Verifier) => VerificationResult)
15631563
: VerificationResult = {
15641564

1565-
def transformPotentialFuncApp(t: Term) = t match {
1566-
case app@App(fun: HeapDepFun, _) =>
1567-
/** Heap-dependent functions that are used as tTriggerSets should be used
1568-
* in the limited version, because it allows for more instantiations.
1569-
* Keep this code in sync with [[viper.silicon.supporters.ExpressionTranslator.translate]]
1570-
*
1571-
*/
1572-
app.copy(applicable = functionSupporter.limitedVersion(fun))
1573-
case other =>
1574-
other
1575-
}
1576-
15771565
val (cachedTriggerTerms, remainingTriggerExpressions) =
15781566
exps.map {
15791567
case pt @ (_: ast.PossibleTrigger | _: ast.FieldAccess | _: ast.LabelledOld | _: ast.Old) =>
1580-
val cachedTrigger = s.possibleTriggers.get(pt).map(t => transformPotentialFuncApp(t))
1568+
val cachedTrigger = s.possibleTriggers.get(pt)
15811569
(cachedTrigger, if (cachedTrigger.isDefined) None else Some(pt))
15821570
case e => (None, Some(e))
15831571
}.unzip match {

src/main/scala/supporters/ExpressionTranslator.scala

+1-8
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,7 @@ trait ExpressionTranslator {
8989
val body = eQuant.exp
9090
val vars = eQuant.variables map (_.localVar)
9191

92-
/** IMPORTANT: Keep in sync with [[viper.silicon.rules.evaluator.evalTrigger]] */
93-
val translatedTriggers = eTriggers map (triggerSet => Trigger(triggerSet.exps map (trigger =>
94-
f(trigger) match {
95-
case app @ App(fun: HeapDepFun, _) =>
96-
app.copy(applicable = functionSupporter.limitedVersion(fun))
97-
case other => other
98-
}
99-
)))
92+
val translatedTriggers = eTriggers map (triggerSet => Trigger(triggerSet.exps map (trigger => f(trigger))))
10093
val weight = sourceQuant.info.getUniqueInfo[WeightedQuantifier] match {
10194
case Some(w) =>
10295
if (w.weight >= 0) {

0 commit comments

Comments
 (0)