Skip to content
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

Support for new expression asserting a in e #531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class DefaultExpModule(val verifier: Verifier) extends ExpModule with Definednes
case sil.Unfolding(_, exp) =>
translateExp(exp)
case sil.Applying(_, exp) => translateExp(exp)
case sil.Asserting(_, exp) => translateExp(exp)
case sil.Old(exp) =>
val prevState = stateModule.state
stateModule.replaceState(stateModule.oldState)
Expand Down Expand Up @@ -378,6 +379,13 @@ class DefaultExpModule(val verifier: Verifier) extends ExpModule with Definednes
checkDefinednessImpl(e1, error, makeChecks = makeChecks, definednessStateOpt) :: // short-circuiting evaluation:
If(UnExp(Not, translateExp(e1)), checkDefinednessImpl(e2, error, makeChecks = makeChecks, definednessStateOpt), Statements.EmptyStmt) ::
Nil
case sil.Asserting(assertion, e) =>
val checkAssDefined = checkDefinedness(assertion, error, makeChecks = makeChecks)
val (stateStmt, state) = stateModule.freshTempState("asserting")
val checkAssHolds = MaybeComment("Exhale assertion of asserting", exhale(Seq((assertion, error, Some(error)))))
stateModule.replaceState(state)
val checkEDefined = checkDefinedness(e, error, makeChecks = makeChecks)
checkAssDefined :: stateStmt :: checkAssHolds :: checkEDefined :: Nil
case [email protected](_, _) =>
checkDefinednessWand(w, error, makeChecks = makeChecks)
case sil.Let(v, e, body) =>
Expand Down
Loading