Skip to content

Commit

Permalink
Merge pull request #660 from viperproject/659-quantified-let-expressi…
Browse files Browse the repository at this point in the history
…ons-in-encoding-unsoundness

Fix #659
  • Loading branch information
ArquintL committed Jul 5, 2023
2 parents c56b335 + d34ca31 commit ff48d9c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions src/test/resources/regressions/issues/000659.gobra
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

package issue659

type Node struct {
ok bool
}

pred (s *Set)mem(){
acc(s) &&
acc(s.nodes) &&
forall i int:: i in domain(s.nodes) ==> acc(s.nodes[i])
}

type Set struct {
nodes map[int]*Node
}

requires s.mem()
requires acc(n)
requires !(k in unfolding s.mem() in domain(s.nodes))
func (s *Set) add2(n *Node, k int){
unfold s.mem()
_,ok := s.nodes[0];
if ok {
s.nodes[k] = n
fold s.mem()
//:: ExpectedOutput(assert_error:assertion_error)
assert false // should fail
return
}
}
2 changes: 1 addition & 1 deletion viperserver
Submodule viperserver updated 2 files
+1 −1 carbon
+1 −1 silicon

0 comments on commit ff48d9c

Please sign in to comment.