-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asserting in
#455
Closed
Closed
asserting in
#455
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7e0ef76
Added asserting-in expression
dewert99 b7f533b
Extracted super trait HintExp for Unfolding, Applying, and Asserting
dewert99 8bd9a7e
Added timeout tests
dewert99 3d7b8ce
Fixed TimeoutPortableCarbonTests to take repetitions into account
dewert99 cdd32f1
Made sure processes were destroyed if they timed out
dewert99 832a4ee
Also kill Boogies children (Z3) on timeout
dewert99 579aac9
Merge remote-tracking branch 'origin-dewert/master' into benchmark-co…
dewert99 07a5871
Reverted non asserting changes
dewert99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule silver
updated
15 files
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 |
---|---|---|
|
@@ -6,33 +6,33 @@ | |
|
||
package viper.carbon.modules.impls | ||
|
||
import viper.carbon.modules.{ExpModule, StatelessComponent} | ||
import viper.silver.{ast => sil} | ||
import viper.carbon.boogie._ | ||
import viper.carbon.verifier.Verifier | ||
import viper.silver.verifier.{PartialVerificationError, reasons} | ||
import viper.carbon.boogie.Implicits._ | ||
import viper.carbon.boogie._ | ||
import viper.carbon.modules.components.DefinednessComponent | ||
import viper.silver.ast.{LocationAccess, MagicWand, PredicateAccess, Ref} | ||
import viper.carbon.modules.{ExpModule, StatelessComponent} | ||
import viper.carbon.verifier.Verifier | ||
import viper.silver.ast.utility.Expressions | ||
import viper.silver.ast.{LocationAccess, MagicWand, PredicateAccess, Ref} | ||
import viper.silver.verifier.{PartialVerificationError, reasons} | ||
import viper.silver.{ast => sil} | ||
|
||
/** | ||
* The default implementation of [[viper.carbon.modules.ExpModule]]. | ||
*/ | ||
class DefaultExpModule(val verifier: Verifier) extends ExpModule with DefinednessComponent with StatelessComponent { | ||
|
||
import verifier._ | ||
import heapModule._ | ||
import domainModule._ | ||
import seqModule._ | ||
import setModule._ | ||
import exhaleModule._ | ||
import funcPredModule._ | ||
import heapModule._ | ||
import inhaleModule._ | ||
import mainModule._ | ||
import mapModule._ | ||
import permModule._ | ||
import inhaleModule._ | ||
import funcPredModule._ | ||
import exhaleModule._ | ||
import seqModule._ | ||
import setModule._ | ||
import stateModule._ | ||
import mainModule._ | ||
|
||
override def start(): Unit = { | ||
register(this) | ||
|
@@ -74,9 +74,7 @@ class DefaultExpModule(val verifier: Verifier) extends ExpModule with Definednes | |
sys.error("should not occur here (either, we inhale or exhale this expression, in which case whenInhaling/whenExhaling should be used, or the expression is not allowed to occur.") | ||
case [email protected](_, _) => | ||
translateLocationAccess(p) | ||
case sil.Unfolding(_, exp) => | ||
translateExp(exp) | ||
case sil.Applying(_, exp) => translateExp(exp) | ||
case h: sil.HintExp => translateExp(h.body) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nice to have. Is HintExp a sealed trait? |
||
case sil.Old(exp) => | ||
val prevState = stateModule.state | ||
stateModule.replaceState(stateModule.oldState) | ||
|
@@ -373,6 +371,14 @@ class DefaultExpModule(val verifier: Verifier) extends ExpModule with Definednes | |
checkDefinednessImpl(e1, error, makeChecks = makeChecks) :: // short-circuiting evaluation: | ||
If(UnExp(Not, translateExp(e1)), checkDefinednessImpl(e2, error, makeChecks = makeChecks), Statements.EmptyStmt) :: | ||
Nil | ||
case sil.Asserting(assertion, e) => | ||
checkDefinedness(assertion, error, makeChecks = makeChecks) :: | ||
NondetIf( | ||
MaybeComment("Exhale assertion of asserting", exhale(Seq((assertion, error)))) ++ | ||
MaybeComment("Stop execution", Assume(FalseLit())) | ||
, Nil) :: | ||
checkDefinedness(e, error, makeChecks = makeChecks) :: | ||
Nil | ||
case [email protected](_, _) => | ||
checkDefinednessWand(w, error, makeChecks = makeChecks) | ||
case sil.Let(v, e, body) => | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how pull requests work across submodules; could this be a separate pull request for silver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, github doesn't seem to understand how to present the diffs for these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did make two pull requests: see viperproject/silver#660, this pull request references the silver commit in the silver pull request