Skip to content

Commit

Permalink
Disable predicate triggers for opaque functions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoeilers committed Nov 1, 2023
1 parent 42c8850 commit b223000
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion silver
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,15 @@ with DefinednessComponent with ExhaleComponent with InhaleComponent {
case _ => None}.flatten
}

// Do not use predicate triggers if the function is annotated as opaque
val usePredicateTriggers = f.info.getUniqueInfo[sil.AnnotationInfo] match {
case Some(ai) if ai.values.contains("opaque") => false
case _ => true
}

Axiom(Forall(
stateModule.staticStateContributions() ++ args,
Seq(Trigger(Seq(staticGoodState,fapp))) ++ (if (predicateTriggers.isEmpty) Seq() else Seq(Trigger(Seq(staticGoodState, triggerFuncStatelessApp(f,args map (_.l))) ++ predicateTriggers))),
Seq(Trigger(Seq(staticGoodState,fapp))) ++ (if (!usePredicateTriggers || predicateTriggers.isEmpty) Seq() else Seq(Trigger(Seq(staticGoodState, triggerFuncStatelessApp(f,args map (_.l))) ++ predicateTriggers))),
(staticGoodState && assumeFunctionsAbove(height)) ==>
(precondition ==> (fapp === body))
))
Expand Down

0 comments on commit b223000

Please sign in to comment.