repo stringclasses 966
values | path stringlengths 5 283 | license stringclasses 13
values | stars int64 0 3.47k | default_branch stringclasses 15
values | commit_sha stringclasses 966
values | pushed_at stringdate 2015-04-17 10:56:12 2026-07-22 05:29:38 | size_bytes int64 0 1.91M | sha256 stringlengths 64 64 | content stringlengths 0 1.91M |
|---|---|---|---|---|---|---|---|---|---|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-889a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,602 | 5ee29bb1cff646eabbc55fcd4cd4f5d0aed744c64cbe9b0d2d6bc31046480bdd | // RUN: %exits-with 4 %build "%s" --relax-definite-assignment > "%t"
// RUN: %diff "%s.expect" "%t"
// This file includes verification tests
// ---------------------------------
newtype int8 = x | -128 <= x < 128
newtype exactly5 = x | x == 5 witness 5
newtype smallneg = r | -1.0 <= r <= 0.0
method GoodN... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-889b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,618 | 591157cc906083bad5c762fb221df6c2b1e8d87237525e5dcb4ebfe7a7a7a6dc | // RUN: %exits-with 2 %build --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// This file tests resolution errors
module BitvectorLiterals {
method Bitvectors() returns (v: bv8) {
if
case true =>
v := 300; // error: literal 300 too large to be a... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-895.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 552 | 634037973e3c47d8e5d2bad3d171fd8708716c62a0b0a1f7495afb103366154e | // RUN: %testDafnyForEachResolver "%s"
module A {
ghost predicate Init(s: int) {
s == 0
}
ghost predicate Next(s: int, s': int) {
s' == s + 1
}
least predicate Reachable(s: int)
{
Init(s) || (exists s0 :: Reachable(s0) && Next(s0, s))
}
}
module B {
import A
leas... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-897.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 599 | 68e01fd0a03f60adafd56759c796007c1f728be3542f5afc47c1fa57acf34e01 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
ghost function missing_number(nums: seq<nat>): nat
requires |set i | i in nums| == |nums|
requires forall x :: x in nums ==> 0 <= x <= |nums|
{
var p := x => 0 <= x <= |nums| && x !in nums;
assert exists x :: p(x) && forall y :: p(y) ==> y ==... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-897a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 719 | 4d37e912bc7f341a055ca77a465e9ec38cefb1e741c4661ebd1cb8f2e5a0c829 | // RUN: %testDafnyForEachResolver "%s"
ghost function missing_number(nums: seq<nat>): nat
requires |set i | i in nums| == |nums|
requires forall x :: x in nums ==> 0 <= x <= |nums|
{
var p := x => 0 <= x <= |nums| && x !in nums;
assert exists x :: p(x) && forall y :: p(y) ==> y == x by {
var rang... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-897b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 156 | 7ffeba1bb04ed9ff0c178a7efda24ba6b6549e1938de0f59d28e0c771ba6b5c7 | // RUN: %testDafnyForEachResolver "%s"
ghost function F(): int {
var p := x => true;
assert true by {
forall y: int | p(y) {}
}
5
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-904.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 379 | 093a751594e5c92424e7454661fe7f1f272e0def15c0c18f313a0fc03615a2d5 | // RUN: %testDafnyForEachResolver "%s"
module FOO {
// two fields are needed
datatype D = D(
f1: nat,
f2: nat
)
function f(d : D) : nat
ensures f(d) != 0
const D0 := D(0, 0)
// Similar outcomes occur using f1 or f2
const C1 := D0.(f2 := f(D0))
class E {
var a ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-907.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 178 | 30fa383694ae2b26f052e2c7b67bf2225248a5cae8f25e713652bec50689e898 | // RUN: %translate java %trargs "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Checks that the Java runtime library is present
function identity(n:nat):nat
{
n
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-921.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 555 | acc6eaf974ea04ad2c6310385331a94be351a710f948b25a81acf1085fb1cdd2 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module StringsOfLength {
type ShortString = s: string | |s| < 10
method M() {
var x: ShortString := "Far too long I'm sure you'll agree"; // value does not satisfy the subset constraints of 'ShortString'
}
method N() {
var x2: Sh... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-922.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 754 | 63290a576b87e4da6a737d29c63468e7de1a6ba112881e20498026712e5f12a2 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module FOO {
// seq with more than one element
type L = x: seq<int> | 1 <= |x| witness [1]
// a datatype using the previous type
datatype D = D(xl: L)
/** This const should not be allowed. */
const KK := D([]) // error: argument to ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-922a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 240 | fa7fb9848e0a9cfd5f1b9565e1bef1bd2136aecd146094f6a1b61e8f56ef85f3 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module FOO {
/** Another type definition. */
datatype O = O(x: nat)
/** This should not be allowed. */
const OO := O(-1) // error: argument is not a nat
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-930.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,739 | cbce8b3c1db17217675dfda821e4e6eab9696e9f178ef3165ffefcfe88a99d74 | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Result<T> = Success(value: T) | Failure(error: string)
{
predicate IsFailure() {
Failure?
}
function PropagateFailure<U>(): Result<U>
requires Failure?
{
Failure(this.error)
}
function Extract(): T
requires Su... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-936.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,399 | 70260f3b650aebf91273ad77adacf8bce50f5a10f3be1ed66a5bec10fbb762fa | // RUN: %exits-with 4 %verify --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Status = Failure(msg: string) | Success
{
function IsFailure(): bool { Failure? }
function PropagateFailure(): Status { this }
}
method q(i: int) returns (r: Status)
ensures i == 1 ==> !r.Failure?
ensur... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-944.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 400 | c59e2e66689b95c03b7b14a8e4c15fd4e9fc67d6467038afc73b60ed4ed268d6 | // RUN: %verify --relax-definite-assignment "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class MyClass {
method M() returns (res: Result<real>) {
var x :- P();
}
}
method P() returns (res: Result<real>)
datatype Result<T> = Success(value: T) | Failure {
predicate IsFailure() { Failure? }
funct... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-945.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 445 | 9f214bf0e83bb30f93ec6643488e2b344d3b7fd23d5657a0f35cae7cff109b8e | // RUN: %verify --relax-definite-assignment "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
datatype Result<T> = Success(value: T) | Failure {
predicate IsFailure() { Failure? }
function PropagateFailure(): Result<T> { this }
function Extract(): int { 5 }
}
method P() returns (ret: R... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-950.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 263 | 8184551feea407f5eed1da3b254884d4be9af311d405f50babb65cb2859784ca | // RUN: %verify "%s" "%s" > "%t"
// RUN: %verify "%s" %S/git-issue-950.dfy >> "%t"
// RUN: %verify "%s" %S/../git-issues/git-issue-950.dfy >> "%t"
// RUN: %diff "%s.expect" "%t"
module M {
const x: int := 5
method m() {
assert x == 5;
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-952.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,345 | 4f10f1b1f70a008cf2277f3b0fd618e917221252a5603f683dcbbafde8874ce3 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module A {
class Cell {
var data: int
constructor (data: int) {
this.data := data;
}
}
class Bell {
var data: int
constructor (data: int) {
this.data := data;
}
}
}
abstract module Abstract {
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-953.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,516 | 12795eea3b1a8f1e19961571c6c1ee165659c8d1e29d361ea298e24c0e6e0eed | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
module P {
datatype T_ = T() // the underscore in this name once caused a problem in Java compilation
type T = t:T_ | true ghost witness T()
}
module C1 refines P {
datatype C = C(t: T) // this had once caused ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-956.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 149 | 96f2a311c63d664cd03225b2dc56538cf08399aaadfb586a16299afc272e9ca4 | // RUN: %testDafnyForEachResolver "%s"
datatype T = T1(x:nat) | T2(y:nat) {
ghost predicate i() requires T2? {
y > 0
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-958.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 297 | 1ed044becd1e37e339b35b68a3abfb2bf151c95be2ba9381742adc43da2fe82b | // RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Atom = MakeAtom(value: int)
method Test() {
var r: Atom;
r := MakeAtom; // this is an error, because the use of MakeAtom requires a parameter
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-966.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,169 | 84bd408a8f45abc85495d40d20bee85eaaf139638ddef4b34bb640ca8e2e2f54 | // RUN: %testDafnyForEachResolver "%s"
// Test various ways to get to the members of a datatype
datatype DT = Make | Create(w: int) {
static const b := 30
const c := 40
function F(): int {
if Make? then 92 else 95
}
}
method Test0() {
var d: DT := Make;
var x := d.c;
var y := d.b;
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-968.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 486 | 37fe86a73f07d54e95b52946b71cd422a230d002d6cd06a526060c6a639c45d2 | // RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype DT<T(0)> = Make | Create {
static const b := 30
static const t: T
}
method Test0() {
var x := DT<int>.b; // this works
var y := DT.b; // this used to crash, becaus... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-968a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 354 | 4739ee12573b8d41cbef8c2ea8250789ec3b28ed5140c1907d55e5c6577d8ca9 | // RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype DT<T(0)> = Make | Create {
static const b := 30
static const t: T
}
method Test1() {
var t := DT<int>.t; // this work
var u := DT.t; // this gives an "underspecifi... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-970a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,131 | dadb36ff88b7b8f17106cb94b20e059dbf9eb3c755d14cbe6c2d59f8a4121d3a | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module Library {
datatype Result<T> = Success(value: T) | Failure(error: string)
{
predicate IsFailure() {
Failure?
}
function PropagateFailure<U>(): Result<U>
requires Failure?
{
Failure(this.error)
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-970b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,365 | a05088c9d05c1230813e326b1d6c67ef406680fc918873f5e13bcb3f5ffbff62 | // RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method UnresolvedRhs(x: int) returns (r: Status)
{
var i;
i :- Pind(x); // error: 'Pind' not found
}
method BadFunctionRhs(x: int) returns (r: Status)
{
var i;
i :- Find(x... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-975.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 210 | 9530eb195130e13f21d0aaddead27f7ff64381d20caef7e68f76eecb289170dc | // RUN: %testDafnyForEachResolver "%s"
ghost function f():nat
ensures f() == 0
{ // no problem for methods
var x := 0; // no problem without this
assert true by {}
0
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-977.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 7,178 | 04d4dac6595793998fcc2a773433ff24efe0d9ba494249f317addaa2ea63768c | // RUN: %exits-with 4 %verify --show-hints --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Option<V> = Some(value: V) | None
ghost predicate IsGoodInt(x: int)
{
&& 0 <= x
&& x != 5 // related location
}
ghost predicate IsGoodOpt_Impl(opt: Optio... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-981.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,803 | 7f65281ed7982b19823e4f303a697e0d8e615654f2ce5ec76036412d047a9737 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module K {
module KK {
module KKK {
const k := 10
}
}
}
// Checks that refines does resolve a qualified ID
// and does not use a local module
module L refines K.KK.KKK {
module K {}
method m() { assert k == 10; }
}
mod... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-981d.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 970 | b79abf77c3656b18e027c1b51bcb250b24980f971815447526b68d80df125f20 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
// This tests all sorts of combinations of duplicate declarations
module Z {}
module A {
export E1 reveals *
export E2 reveals *
export E3 reveals *
export E4 reveals *
export E5 reveals *
export E6 reveals *
module E1 {}
impor... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-981e.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 396 | a25f59a7b856a748df72f81ef27e92b4d6b4cc5e46297185296c469aa3c8ef73 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module Z {}
module A {
export E1 reveals *
export E2 reveals *
export E3 reveals *
export E4 reveals *
export E5 reveals *
export E6 reveals *
module E1 {}
import E2 = Z
type T3
const E4 := 0
method E5() {}
class E6 {}... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-981ee.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 122 | 72acb6936f9ce59f09a94775436f78e19d0f00bccfcc72375f4fd1c4009f0727 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module B {
module E2 {}
import E2 = Z // error
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-Main.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 466 | eaed65ebffa13ac39ee8cb1249329fb4b8ec339fea2cfd7c74bbadbece8ad223 | // RUN: %verify "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --target cs "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target js "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target go "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target java "%s" >> "%t"
// RUN: %diff "%s.expect" "%t... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-Main0.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 845 | e7a8b87a4005ed1f9bc547446f5eeecbe51c634a3a573e85080caec0abf41694 | // NONUNIFORM: Multiple test scenarios (could be split)
// RUN: %verify "%s" > "%t"
// RUN: %run --no-verify --target cs --main-method A.B.Main "%s" >> "%t"
// RUN: %run --no-verify --target js --main-method A.B.Main "%s" >> "%t"
// RUN: %run --no-verify --target go --main-method A.B.Main "%s" >> "%t"
// RUN: %run... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-Main1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 267 | 981b6adb27702c78e61aac12efd4026552953fbe2d838b90585087ac1ddfd97f | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module A {
module AA {
method Main() { print "Main1\n"; }
}
}
module B {
class C {
static method {:main} Main() { print "Main2\n"; }
}
}
method Main() { print "Main3\n"; }
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-Main2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 482 | 52a9d29beedc356e33710aa59b74f4214c788006c576c1970fa992cd3caf05b0 | // RUN: %verify "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --target cs "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target js "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target go "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target java "%s" >> "%t"
// RUN: %diff "%s.expect" "%t... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-Main3.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 267 | d4ec2c6d70f11974bfd18657a015bf185867e70a7504e3e697d376195b9bf882 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
module A {
module AA {
method Main() { print "Main1\n"; }
}
}
module B {
class C {
static method Test() { print "Main2\n"; }
}
}
method {:main} Main() { print "Test3\n"; }
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-Main4.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,170 | 930a0d045872b66366db46e1f89bfa036472c559890506e3287c8e999c16a78c | // NONUNIFORM: Multiple test scenarios (could be split)
// RUN: %verify "%s" > "%t"
// RUN: %run --no-verify --target cs --main-method A.AA.Test "%s" >> "%t"
// RUN: %run --no-verify --target js --main-method A.AA.Test "%s" >> "%t"
// RUN: %run --no-verify --target go --main-method A.AA.Test "%s" >> "%t"
// RUN: %... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-MainE.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,661 | 31d95a9a298145004a5b3b2684935f49d8e7a6ea453b3c653bf9383ed766437d | // NONUNIFORM: Multiple test scenarios (could be split)
// RUN: %verify --relax-definite-assignment "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --main-method A.Test "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --main-method B.Test "%s" >> "%t"
// RUN: %run --no-verify --main-method C.Test "%s" >> "%t"... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue1495.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,875 | aa47fd233396f547bdb6c0f131d1eb20b3727bb3ac898e0a4395db939efef048 | // RUN: %verify "%s" --standard-libraries:true --allow-axioms > "%t"
// RUN: %diff "%s.expect" "%t"
import opened Std.Wrappers
datatype Bar = Bar(i: string)
function ParseBar(s: string): Result<Bar, string> {
Success(Bar(s))
}
class Foo {
const bar: Bar
constructor (barLike: string)
require... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue5822.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 337 | cbbcd781922d9c9672fd7f76a2932d2a563d3a4bfdbd5a7ccea74528e8c78290 | // RUN: ! %testDafnyForEachResolver "%s"
module Issue5822 {
trait A {
var x: int
function Test(): int
ensures Test() == x
method EnsureFalse() modifies this
ensures false
{
x := 1;
var i := Test();
x := 2;
var j := Test();
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-1267.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 172 | 02deed57c313e577bf11b17cd4f78ba11334888cad7848f7e2ff99ddb06f952b | // RUN: %testDafnyForEachResolver "%s" -- --print:-
method Test()
{
var tuple0 := (1 := 300, 0 := 10);
var tuple1 := (10, 300);
assert tuple0 == tuple1;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2174.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,449 | 6baa36c26d193f0c2075ae443662ccafef2c42d19782ccf1c5e47e8205f3c994 | // RUN: %verify --solver-option="O:smt.arith.solver=6" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Taken from https://github.com/dafny-lang/dafny/issues/2174
lemma lm(val: bv16, idx: nat)
requires 0 <= idx <= 16 - 8
requires 0 <= val < (1 << 8)
ensures val as bv32 << idx == (val << idx) as bv32 {}
// T... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2230.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 358 | db0f08b2d07cecd478fdac1d017fe52d7a8426f9b71255974783ee043f21199e | // RUN: %testDafnyForEachResolver "%s"
lemma MergeLShift(v: bv128, i: nat, j: nat)
requires i <= 128 && j <= 128 && i + j <= 128
ensures v << i << j == v << i + j
method M2(i: nat)
requires i <= 64
{
ghost var half: bv128 := 0xffff_ffff_ffff_ffff;
MergeLShift(half, 64, 64 - i);
assert half << 6... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2563.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 102 | 512843304098170c9d2bd085b40419b46758dcabef11e9d307f6fcda121f6e4d | // RUN: %exits-with 4 %verify '--log-format:csv;log.csv' "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2574.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 329 | 67716e10b1327e05ebd47292ab723cce4a2135fcef56c1d8870828853f31da3b | // RUN: %exits-with 4 %baredafny verify --use-basename-for-filename "%s" > "%t.raw"
// RUN: %sed 's/^.*[\/\\]//' "%t".raw > "%t"
// RUN: %diff %s.expect %t
module Spec {
type input
method ReadInput() returns (i:input)
}
module Impl refines Spec {
class input {}
method ReadInput() returns (i:input) {
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 328 | 1e914652b3dafeaabab952b36eaa08cd93c6a2c8ab695cd920d4f7112bd9bbad | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" --
method Main() {
var c := '\0';
assert c == 0 as char;
expect c == 0 as char;
var s := "\03";
assert |s| == 2;
expect |s| == 2;
assert s[0] == 0 as char;
expect s[0] == 0 as char;
assert s[1] == '3';
expect s[1] == '... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 570 | 64d4951c79ac5c505a0c3ef4735a25a9db40f0fb866232d13a9ace81e45d109f | // NONUNIFORM: Go-specific regression test
// RUN: %baredafny translate go %args --allow-deprecation --unicode-char false "%s" > "%t"
// RUN: %baredafny translate go %args --unicode-char true "%s" >> "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
var s := Foo();
}
// An extern method that returned a ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-305-a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 241 | 7d742937a33998a4e4afe20dabc610623a91f848b18a8312339cbb63e22f71e7 | // NONUNIFORM: Testing exit codes, not compilation
// RUN: %baredafny translate cs --cores:2 --use-basename-for-filename --verification-time-limit:300 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
print "hello\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-305-b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 195 | 41a48229c34e3eeaaec94fd521ed6f10b814e725a53fc657617cbc474319efef | // RUN: %exits-with 3 %translate cs %trargs --show-snippets=false "%s" > "%t"
// RUN: %diff "%s".expect "%t"
method hasNoBody()
method Main() {
hasNoBody();
print "hello\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-305-c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 405 | c15dea1ffb30680611d7937aa708355d5361c2be7be8a90ef52a2d69b2f1c4d0 | // RUN: %translate cs %trargs "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// At some point (https://github.com/dafny-lang/dafny/pull/307#issuecomment-510191495)
// this used to produce an executable even though it shouldn't,
// therefore we compare the output of "baredafny", which contains messages regarding
// w... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3343.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 133 | 98e699f9a5ecfe3cece66c57e5e2ef787d14e142d0f5da3a79ac8665c5c6d9a0 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Bug() {
var zero := 0;
var a := new int[zero] [];
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3484.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 291 | 0e9aee955c7c2851b9f346c9c04166be715f2c877f4af850f26d95f4c380c041 | // RUN: ! %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Foo(x: int) {
match x {
}
}
method Baz(x: int) {
match x {
case 3 =>
}
}
function Qar(x: int): int {
match x {
case 3 => 3
}
}
function Bar(x: int): int {
match x {
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3615.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 230 | a3e2607e79f71419121f9f80953fe6a1471d6f3363b5d88069591fb8478cb057 | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function Foo(x: int := 3): int {
x
}
datatype Zee = Kwa | Zam
function Zaz(x: Zee): int {
match x {
case Kwa => Foo()
case _ => Foo()
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3658.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 758 | 361d4a1d17589c0cae62eedf7ad029b91d5d859fb0d28f0923afef2b8a4e0699 | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// This case used to cause duplicate Boogie variable declarations
// because MatchFlattner was not cloning NestedMatchCaseStmts as it
// created multiple copies for disjunctive patterns.
method mmm() returns (i: int) {
match "abc"
case "def"|"g... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3766-a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 250 | 26687c57263b54d387c4b609bbcacbaf3ac166e65dbea46049ae07f1e5104766 | // RUN: %testDafnyForEachCompiler "%s"
// good.dfy for 3766
datatype Tree = Tree(ts: seq<Tree>)
datatype Nothing = Nothing
{
predicate IsFailure() { false }
}
method Main() {
var nothing: Nothing := Nothing;
:- expect nothing;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3766-b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 258 | c200cd271d2b3ae637c84555bf1fac1cfc5c863f0576f4fc884153bb1af8e1a1 | // RUN: %testDafnyForEachCompiler "%s"
// bad.dfy for 3766
datatype Tree = Tree(ts: seq<Tree>)
datatype Nothing<T> = Nothing
{
predicate IsFailure() { false }
}
method Main() {
var nothing: Nothing<Tree> := Nothing;
:- expect nothing;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3766-c.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 354 | 16715b034368a3034f2c55899a38d8c50a8d0de2e1ece1ebc367d88caaf2fc50 | // RUN: %testDafnyForEachCompiler "%s"
// Running this using the Java backend used to cause an NPE
// because Tree's default value would be initialized using Tree's
// type descriptor (since it has no non-recursive constructors)
// before it was initialized
datatype Tree = Tree(ts : seq<Tree>)
method Main() {... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3797.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 269 | e725ec697a5b1161f3a663cc4b0b1ad1b5f4e0af1f4608bb885b6cdc781a34bc | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
newtype uint16 = x | 0 <= x < 0x1_0000
datatype D = A | B
method M(x: D, u: uint16) returns (r: uint16) {
var v := 5;
match x {
case A => r := 12;
case B => r := 13;
}
r := v;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3860.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 349 | 70721354bfac8fbc695320b826f561fef6e0e9911249a6aabf4b3c7b4d840049 | // RUN: ! %verify %s > %t
// RUN: %diff "%s.expect" "%t"
datatype Type =
| Cons()
datatype Test = Test(
y: Type,
y: Type // error: duplicate member name
)
predicate pred(t: Test, t': Test)
{
&& t' == t.(y := Cons())
}
datatype ZTest = ZTest(
z: real,
z: ThisTypeDoesNotExist // error... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3871.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 444 | 04c66c44ddc626fd767c35e040ed4e54eeddb2c7b3124282c1465090819380b2 | // RUN: %testDafnyForEachCompiler "%s"
// extended bad.dfy for 3871
method Main() returns () {
var v_array: array<int> := new int[] [1, 2];
var v_int_seq: int := |[v_array]|;
assert(v_int_seq == 1);
print v_int_seq, "\n";
var v_int_s: int := |{v_array}|;
assert(v_int_s == 1);
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-3874.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 241 | ffe546f3ed0f1022cce1be623c8546da95023c319a1367d9f712eb0c8a3571ff | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
var s: multiset<bool> := multiset{true};
while (s != multiset{}) {
var x :| x in s;
s := s[x := 0];
}
print "done", "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-4004.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 266 | c1077ccc8ef3d1c7ea092d52350022fa1f392320390eff5a09590dd4286b5c00 | // RUN: %verify %s > %t
// RUN: %diff "%s.expect" "%t"
method Main() returns ()
{
match 8 {
case _ => {
var v_bool: bool, v_real: real := true, match 15.06 {
case _ => 6.58
};
print v_bool, " ", v_real, "\n";
}
}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-4004_v2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 271 | fccb9a0a6792fcd1656a11bfd73e9fe31c15aa845a69a6374ad456878c8d2287 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() returns ()
{
match (-19 / 23) {
case 26 => {
var v_bool_7: bool, v_bool_8: bool := (match true {
case _ => true
}), false;
}
case _ => {
}
}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-4017.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 139 | f089546e45df2469663c2fbccf337869b23e6891e18444e70883b2026cd74ea0 | // RUN: %verify %s > %t
// RUN: %diff "%s.expect" "%t"
function Crash(e: nat): string
{
assert match e { case _ => true };
""
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-4144.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,039 | 64b3b85916ca85903d0744a6a613c3a31102c256d32adfe7d4718edfd15ed4c7 | // RUN: %verify --allow-warnings %s > %t
// RUN: %diff "%s.expect" "%t"
module P {
predicate m() reads {}
predicate p() reads []
predicate q() reads multiset{}
predicate k(o: object) reads (() => {o})
predicate l(o: object) reads ((x: int) => [o])
predicate n(o: object) reads ((y: real, z: rea... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-4483.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 309 | 5926413abca745caa5be0b8720675a9f0bcc88384f5ee1f75d2567436709841b | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
const TWO_TO_THE_64: int := 0x1_00000000_00000000
newtype uint64 = x: int | 0 <= x < TWO_TO_THE_64
method Foo() returns (tuple: (uint64, uint64)) {
var s := [1,2,3];
var (foo, length) := (0, |s| as uint64);
return (foo, length);
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-4804.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 657 | 66ee2eff018e16842793b1ff2428853a130bf64c4cfb288a2c370c38f0adc936 | // RUN: %exits-with 4 %verify --allow-axioms --resource-limit 1200 %s > %t
// RUN: %diff "%s.expect" "%t"
module Power {
opaque function Pow(b: int, e: nat): int
decreases e
{
if e == 0 then
1
else
b * Pow(b, e - 1)
}
/* Add exponents when multiplying powers with the same ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-5029.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 238 | d39b271d4c5aa6a56623756c4de524528e2048ec4c2409faaf8f3a0aaca2f44f | // RUN: %verify "%s" --warn-contradictory-assumptions
abstract module Digit {
function BASE(): nat
ensures BASE() > 1
type digit = i: nat | 0 <= i < BASE()
}
module M refines Digit {
function BASE(): nat { 32 }
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-5814.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 342 | 2e55e3f2da40c68c6458c2fa747660d61c4b1d7b270adee721df5b54d36bf7c4 | // RUN: %testDafnyForEachCompiler "%s"
trait MyTrait<T> {
method Bar(ghost x: T, y: T) returns (z: T)
}
class MyClass extends MyTrait<int> {
constructor() {}
method Bar(ghost x: int, y: int) returns (z: int) {
return y;
}
}
method Main() {
var c := new MyClass();
var z := c.Bar(7, 42);... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/PR4715Test.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 564 | abd1dc787a7a6a6ed722f87656e114c778c9d307b96980b85b5b0fb8a5b5d28c | // RUN: %verify --warn-contradictory-assumptions "%s" > "%t"
// Check that the output contains no warnings about contradictory assumptions
// RUN: %diff "%s.expect" "%t"
abstract module PR4715Test {
opaque function Pow(b: int, e: nat): int
decreases e
{
if e == 0 then
1
else
b * ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/HigherOrderIntrinsicSpecification/ReadPreconditionBypass1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 563 | 45cbf7b145f9254c07aa9c7ae4c69456d3eeee6fe5ef32adfa0206719ffa5ba8 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class Ref {
var inner: Ref
constructor()
}
function myf(o: Ref): ()
requires false
reads o.inner
{
()
}
method Main()
ensures false
{
var outer := new Ref();
var inner1 := new Ref();
outer.inner := inner1... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/HigherOrderIntrinsicSpecification/ReadPreconditionBypass2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 577 | 2432520476273241e1aaa9aaf96d47953a902fcb3becee76fa3f2db408dff884 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class Ref {
var inner: Ref
constructor()
}
function myf(o: Ref): ()
requires false
reads o.inner
{
()
}
method Main()
ensures false
{
var outer := new Ref();
var hof := myf.reads;
var inner1 := new Ref(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/HigherOrderIntrinsicSpecification/ReadPreconditionBypass3.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 610 | 721a7b6aa5b0b26c235344a42691c7134147c6ded5b1cc4afc347cf553314c4b | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class Ref {
var inner: Ref
constructor()
}
function myf(o: Ref): ()
requires false
reads o.inner
{
()
}
method Main()
ensures false
{
var outer := new Ref();
var myg := myf.requires;
var inner1 := new R... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/HigherOrderIntrinsicSpecification/ReadPreconditionBypass4.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,030 | 1255fc8906761e7cead60be8c57f0a29d2bb53fbd9c457db77fff55875d4497a | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class Ref {
var inner: Ref
constructor() {
inner := this;
}
}
function myf(o: Ref): ()
requires false
reads o.inner
{
()
}
method M()
{
var outer := new Ref();
var myg := myf.requires;
var myh := myg... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Apply.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,413 | b6f83b46ded33875a4a64c89a168813f0778a53cc408c8f71b0c25e77dbafba5 | // RUN: %exits-with 4 %build --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Apply(x : int) returns (i : int)
ensures i == x
{
i := (x => x)(x);
}
function Const<A,B>(a : A) : B -> A {
b => a
}
method Test(m : map<int, int -> int -> int>)
{
assume forall i :: i in m;
assu... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/ArrowTypeOptimizations.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,114 | dd4ad0980ebde8aaee3574f4cbc6be5e8ba36c436796e8920e61555e0d6e247a | // RUN: %exits-with 4 %verify --isolate-assertions --cores 1 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// These tests make sure that the built-in arrow types are taken into account when
// generating proof obligations.
ghost function CheckReads(f: int ~> int, x: int): int
{ // 3 proof obligations
assert tr... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Classes.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 960 | 632efa9f6917268e9d974dd958283503b8e2d4cdda6744fd8b166d6fd54c0a40 | // RUN: %exits-with 4 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C {
static ghost function Static() : bool
{
true
}
}
method K() {
var f := C.Static;
var o : object? := *;
assert o !in f.reads();
assert f.requires();
assert f();
}
class T {
var h : int ~> int... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Compilation.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,143 | 07f2582d9cc1da020459f50f11a3cc06db6180d40a6dee091ed5b56ff554e757 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
class Ref<A> {
var val : A
constructor (a : A)
ensures val == a
{
val := a;
}
}
method Main() {
// simple
print "1 = ", (x => x)(1), "\n";
print "3 = ", (x => y => x + y)(1)(2), "\n";
pri... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Consequence.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 227 | 4c2ba36c7b6d9fafd1f64dbdd3037d6e8c261c6df38e58c46b9a9faf6eac87ed | // RUN: %verify --relax-definite-assignment --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
newtype Nat = x | 0 <= x
method Check() {
var f : Nat -> Nat;
assume f.requires(0);
var i : Nat := f(0);
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Field.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 430 | c11a4f2f4ccffa9aba6c3efc546469b90f153e8c7c7597a2ef95ab35f4d0b1b0 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
// calling fields should not make a resolution error:
class Ref<A(0)> {
var val: A
}
method Nope() {
var f := new Ref<int --> bool>;
assert f.val(0); // error: precondition and assert
}
class FnRef<A(0),B(0)> {
var fn: A --> B
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Fold.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 842 | 25d0bbec5b50bfadafc8f94f0b35dc05204c141b889b7c4aa5edae80b3328540 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
datatype List<A> = Nil | Cons(A,List<A>)
datatype Expr = Add(List<Expr>) | Mul(List<Expr>) | Lit(int)
function Eval(e : Expr): int
{
match e
case Add(es) => Fold(es, 0, (e,v) requires e < es => Eval(e) + v)
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Folding.legacy.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 7,939 | 1001d9775bd2b7d326ef664d588a9b90919b9db61bde44c58b109c4498ee8388 | // NONUNIFORM: /induction:3 not supported by new CLI
// RUN: %dafny /compile:3 /induction:3 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Specifications and proofs involving foldr (inspired by Liquid Haskell) and foldl
// Rustan Leino
// 13 April 2016
method Main() {
var xs := SeqToList([57, 100, -34, 1, 8... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Frame.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,316 | e464ecc9a00ed0f486951e4b6da7d1166f3210ffd348c7bebae0107991455b88 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation
class C { var u : int; }
method M(f : int ~> int)
requires f.requires(0);
{
var init := f(0);
var o := new C;
assert init == f(0);
}
method M2()
{
var c := new C;
c.u := 0;
var f := () reads c => c.u;... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Lambda.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,313 | ca995e226334a48f0681e61ab8ed9c1e2acbeeab8cdaddf8eb8aadf8f5bb6e1d | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
method M<A>() {
var f1 : A -> A := x => x;
var f2 : A -> A := (x) => x;
var f3 : () -> () := () => ();
var tt : () := ();
var f4 : (A, A) -> (A, A) := (x, y) => (y, x);
var f5 := (x : int) => x;
var f6 := x require... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/LambdaParsefail.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 488 | b4fe7fd3317c4243601165359459914fe66564a5d3e504c00b5f571030cc013b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
method Fails() { // all these fail
var g1 := x.x => x;
var g2 := x() => x;
var g3 := ((x)) => x;
var g4 := _a => 5;
var g5 := x : int => x;
}
// the rest of these are OK:
ghost function f():() {
a.b(x); a.b(x)
}
meth... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/LambdaParsefail2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 151 | 239e520c7858a8ad59856d9f8023b8e54bf7dd097a547efa25d73e06804e3c74 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
method Fail2() {
var g4 := (x, y : A) => (y, x : B); // RHS should fail!
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Monads.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,903 | 6d242ca17f2da200739887644d3c8140d9876d1e14c24c6fd660f409ef5f1d7d | // RUN: %testDafnyForEachResolver "%s"
abstract module Monad {
type M<A>
function Return<A>(x: A): M<A>
function Bind<A,B>(m: M<A>, f:A -> M<B>): M<B>
// return x >>= f = f x
lemma LeftIdentity<A,B>(x: A, f: A -> M<B>)
ensures Bind(Return(x),f) == f(x)
// m >>= return = m
lemma Righ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/MutableField.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 205 | ebb703aa66476c8b4356ce00f1fd59f548fbfd6925a0ec32d8ca7c2940917a1c | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class C {
function f(x : int) : int { x }
var g : int -> int
method M() modifies this
{
f := g; // not ok
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Naked.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,254 | 3b6cc634bded4346ddf201c6f8308feb4f9096a5e2257c7e32114c6bcb664757 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module Functions {
ghost function f(x: nat): nat
{
if x == 0 then 0 else
if var b: bool :| true; b then
var h := f;
h(x-1)
else
(f)(x-1)
}
ghost function f1(x: nat): nat { if x == 0 then 0 else f2(x - 1) }... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/ReadsReads.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 6,865 | 1c78d36940914c3b1a33fe7e0882697d0de0023faed3b6d8eec1c7c7ffa9356b | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module ReadsRequiresReads {
ghost function MyReadsOk<A,B>(f : A ~> B, a : A) : set<object?>
requires f.requires(a)
reads f.reads(a)
{
f.reads(a)
}
ghost function MyReadsOk2<A,B>(f : A ~> B, a : A) : set<object?>
requires ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/ReadsReadsOnMethods.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,144 | 05f31b3366956347afcd0fe1954c00c105e0a3c4fe1788d0dd3893915287878d | // RUN: %exits-with 4 %build --reads-clauses-on-methods "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Clone of ReadsReads.dfy but using methods instead of functions
module ReadsRequiresReads {
ghost method MyReadsOk<A,B>(f : A ~> B, a : A) returns (r: set<object?>)
requires f.requires(a) reads f.reads(a)... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Renaming.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 774 | 95e1aa651e727bd89714b340a748c07990970dcfb23f9ec865bfe5879b6bc8f7 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
function OnId(f : (bool -> bool) -> int) : int
reads f.reads(x => x)
requires f.requires(y => y)
{
f(z => z)
}
method Equal() {
var id1 : bool -> bool := x => x;
var id2 := y => y;
assert... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Requires.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,593 | 6aaeb6e2e43913c3cd5635bb6e5f83b2d4312f8cf92f54a24d677f90a1319c95 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main()
{
test0(10);
test5(11);
test6(12);
test1();
test2();
}
ghost predicate valid(x:int)
{
x > 0
}
ghost function ref1(y:int) : int
requires valid(y)
{
y - 1
}
lemma assumption1()
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/ResolveError.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,035 | f8ae00608891df230b95cdf23dbfa478ba288033e65d89e4b90febe68d1cd998 | // RUN: %exits-with 2 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Tests {
method ResolutionErrors() {
var x;
var g5 := x, y => (y, x); // fail at resolution
var g6 := x, (y => (y, x)); // fail at resolution
}
// cannot assign functions
class Apa {
ghost function f() : int {
0... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Simple.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,799 | 5e797740f15e8b5ec93a818e82bc3293cd2a26e25abc0df73f7afb2fa386de17 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
function MkId<A>() : A -> A {
x => x
}
function IntId() : int ~> int {
y => y
}
function DivZero() : int ~> int
{
z => 5 / z // div by zero
}
function DivZeroWithReq() : int ~> int
{
(z) requires z != 0 => 5 / z
}
function D... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/SumSum.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,816 | 6c33f8c82074e1a5a2a0a797797312f597636cb478e818d2c792d912b978a651 | // RUN: %testDafnyForEachResolver "%s"
// Tests that come down to comparing the bodies of (possibly nested) functions.
// Many of these currently require far more effort than one would like.
// KRML, 2 May 2016
ghost function Sum(n: nat, f: int -> int): int
{
if n == 0 then 0 else f(n-1) + Sum(n-1, f)
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/TreeMapSimple.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,408 | 89bc89bae21cd82d62d73e92fbaa5fecc434fd3d3a9d1ea2e63e034285e0b280 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
TestY();
}
datatype List<A> = Nil | Cons(head: A, tail: List<A>)
datatype Tree<A> = Branch(val: A, trees: List<Tree<A>>)
ghost function ListData(xs: List): set
ensures forall x :: x in ListData... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Types.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 901 | 315c57a57cc4f542672b5361260bb80957e58b12edd701ef305bbe53c300c52c | // RUN: %exits-with 2 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method FnEqGhost<A>() {
ghost var f : A -> A -> A;
ghost var g : A -> (A -> A);
ghost var h : (A -> A) -> A;
ghost var b1 := f == g; // type checking should be ok
ghost var b2 := f == h; // type checking should fail
ghost va... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/Underspecified.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 233 | 2f2cb278e3c40eb5f267d7043fb2c34d19b0fd6de2064bbc59c103589ba876e9 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Underspecified() {
// all these have underspecified types, which is not ok
var u := _ => 0;
var v := (_, _) => 0;
var w := a => a;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/hofs/VectorUpdate.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,640 | f910c6d20fdd33140e1ad1ea751e583e75d7f83dda144cd7714f61bf35d4d757 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
// this is a rather verbose version of the VectorUpdate method
method VectorUpdate<A>(N: int, a : array<A>, f : (int,A) ~> A)
requires N == a.Length
requires forall j :: 0 <= j < N ==> f.requires(j,a[j])
requires fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.