2

The Dafny documentation doesn't go through using 'exists' quantifiers.

method Main() {
    assert (exists n: int :: n > 1);
}

This comes up with an AssertionError

1 Answers1

1

The following works:

predicate dummy(n: int) {true}

method Main() {
    assert dummy(2);
    assert (exists n : int {:trigger dummy(n)} :: n > 1);
}

You can replace dummy(2) with dummy(m) for any integer m > 1.

This answer isn't great, since I can't tell you exactly why the above works. However, for more information on triggers you can read this.

Daniel Ricketts
  • 447
  • 2
  • 8