summaryrefslogtreecommitdiff
path: root/Test/triggers/set-construction-is-a-good-trigger.dfy
blob: b3dee172a1bd9babc1ac6b777edb9ea61fa06dab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /autoTriggers:1 /printTooltips "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

// This file ensures that display expressions can be picked as triggers. This is
// useful for code that checks if a set, sequence, or multiset is a singleton.

method M(s: seq<int>, st: set<int>, mst: multiset<int>)
  requires exists y :: s == [y]           // Seq#Build(Seq#Empty(): Seq Box, $Box(y#3))
  requires exists y :: st == {y}          // Set#UnionOne(Set#Empty(): Set Box, $Box(y#4))
  requires exists y :: mst == multiset{y} // MultiSet#UnionOne(MultiSet#Empty(): MultiSet Box, $Box(y#5))
{
}