Skip to content

Commit b09d079

Browse files
authored
Tests for fixed Silicon issue #856 (#880)
1 parent 48acd1b commit b09d079

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
field val: Int
5+
6+
function foo(refs: Set[Ref]): Bool
7+
requires forall x: Ref :: x in refs ==> acc(x.val)
8+
9+
method test(refs: Set[Ref]) {
10+
inhale forall x: Ref :: x in refs ==> acc(x.val)
11+
inhale forall subs: Set[Ref] :: subs subset refs ==> foo(subs)
12+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
5+
field f: Bool
6+
7+
function hfun(rs: Set[Ref]): Bool
8+
requires (forall r: Ref :: { (r in rs) } (r in rs) ==> acc(r.f))
9+
10+
11+
method test1(rs: Set[Ref])
12+
requires (forall r: Ref :: { (r in rs) } (r in rs) ==> acc(r.f))
13+
{
14+
assume (forall rs2: Set[Ref] :: { (rs2 subset rs) }
15+
(rs2 subset rs) ==> hfun(rs2))
16+
17+
assert (forall rs3: Set[Ref] :: { (rs3 subset rs) }
18+
(rs3 subset rs) ==> hfun(rs3))
19+
}

0 commit comments

Comments
 (0)