-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start fixing triggers maps * cleanup * fix issues with 'contains' in maps and with trigger generation * backup * backup * doc * Apply suggestions from code review Co-authored-by: Felix Wolf <60103963+Felalolf@users.noreply.github.com> * feedback from Felix --------- Co-authored-by: Felix Wolf <60103963+Felalolf@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
135 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/scala/viper/gobra/translator/encodings/defaults/DefaultTriggerExprEncoding.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2011-2023 ETH Zurich. | ||
|
||
package viper.gobra.translator.encodings.defaults | ||
|
||
import org.bitbucket.inkytonik.kiama.==> | ||
import viper.gobra.ast.{internal => in} | ||
import viper.gobra.translator.context.Context | ||
import viper.gobra.translator.encodings.combinators.Encoding | ||
import viper.silver.{ast => vpr} | ||
|
||
class DefaultTriggerExprEncoding extends Encoding { | ||
import viper.gobra.translator.util.ViperWriter._ | ||
|
||
override def triggerExpr(ctx: Context): in.TriggerExpr ==> CodeWriter[vpr.Exp] = { | ||
// use predicate access encoding but then take just the predicate access, i.e. without the access predicate: | ||
case in.Accessible.Predicate(op) => | ||
for { | ||
v <- ctx.assertion(in.Access(in.Accessible.Predicate(op), in.FullPerm(op.info))(op.info)) | ||
pap = v.asInstanceOf[vpr.PredicateAccessPredicate] | ||
} yield pap.loc | ||
case e: in.Expr => ctx.expression(e) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters