Skip to content

Commit

Permalink
fixes PredicateInstance plugin to propagate a predicate instance's po…
Browse files Browse the repository at this point in the history
…sitional information to not only the generatated PredicateAccessPredicate but also PredicateAccess as the latter is used as offending node in the resulting reason
  • Loading branch information
ArquintL committed Jan 31, 2025
1 parent 4833685 commit 1ee7b4d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ class PredicateInstancePlugin(@unused reporter: viper.silver.reporter.Reporter,
case None =>
val piFunctionName = s"PI_${predicateInstance.p}"
val pred = program.findPredicate(predicateInstance.p)
val predicateAccess = PredicateAccess(pred.formalArgs.map(_.localVar), pred.name)(predicateInstance.pos, predicateInstance.info, predicateInstance.errT)
val predicateAccessPredicate = PredicateAccessPredicate(predicateAccess, Some(WildcardPerm()()))(predicateInstance.pos, predicateInstance.info, predicateInstance.errT)
val newPIFunction =
Function(piFunctionName,
pred.formalArgs,
DomainType(PredicateInstanceDomain.get, Map()),
Seq(PredicateAccessPredicate(PredicateAccess(pred.formalArgs.map(_.localVar), pred.name)(), Some(WildcardPerm()()))(predicateInstance.pos, predicateInstance.info, predicateInstance.errT)),
Seq(predicateAccessPredicate),
Seq(),
None
)(PredicateInstanceDomain.get.pos, PredicateInstanceDomain.get.info)
Expand Down

0 comments on commit 1ee7b4d

Please sign in to comment.