Skip to content

Commit

Permalink
Make assume impure (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruggerl authored Jul 24, 2024
1 parent c67e18f commit b28b858
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait GhostStmtTyping extends BaseTyping { this: TypeInfoImpl =>
case PAssert(exp) => assignableToSpec(exp)
case PRefute(exp) => assignableToSpec(exp)
case PExhale(exp) => assignableToSpec(exp)
case PAssume(exp) => assignableToSpec(exp) ++ isPureExpr(exp)
case PAssume(exp) => assignableToSpec(exp)
case PInhale(exp) => assignableToSpec(exp)
case PFold(acc) => wellDefFoldable(acc)
case PUnfold(acc) => wellDefFoldable(acc)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

package assumption

type person struct {
name string
age int
}

func f() {
p := &person{name: "Pereira", age: 12}
assume acc(p) // impure assume does not lead to contradiction
//:: ExpectedOutput(assert_error:assertion_error)
assert false
}

func g() {
p := &person{name: "Pereira", age: 12}
inhale acc(p) // inhale leads to contradiction
assert false
}

0 comments on commit b28b858

Please sign in to comment.