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/expectations/VerificationErrors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 331 | cd14adab40c51d6842608b4946dcbefaec536a641652a54e2028642524f8396f | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
datatype Option<T> = None | Some(get: T)
method CheckThatMessageIsVerifiedAssumingExpectFails(x: Option<string>) {
expect x.None?, x.get;
expect x.Some?, x.get; // error: destructor 'get' can only be applied to datatype values constructed by ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/AggregateImport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 705 | ccd07bb8b0fc9a20f92dc665087827f841b26b2c73b50c2957432f82b7cc9661 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
export TR reveals T
export TO provides T
export TTR reveals TT
export TTO provides TT
type T = bool
type TT = int
}
module B {
import A`{TR,TTR}
method Test() {
var at : A.T;
var att : A.T... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/AliasedImportConsistency.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,166 | 818cf6609f46dda66495b0cb5ec196c21d5e713de4454f80128bb31073322322 | // RUN: %testDafnyForEachResolver "%s"
module A {
export Spec provides T
export Body reveals T
type T = int
}
module B {
export GoodSpec provides f, ASpec
export AnotherGoodSpec provides f, ABody
export YetAnotherGoodSpec provides f, ABody, ASpec
export GoodBody reveals f provides AB... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ClassMemberExport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 637 | c702e97cd51bf70380161c5bc4f02a014c813bb7bf3f966342d536befcd6600a | // RUN: %testDafnyForEachResolver "%s"
module A {
export Spec reveals AClass provides T, AClass.f, AClass.Init
export Body reveals T, AClass provides AClass.Init, AClass.f, AClass.g
type T = int
class AClass {
function f(): T { 0 }
function g(): int { f() }
constructor Init() { ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/DatatypeExport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,326 | d7bbb6125dccbb9e2dbf9abfff756d5f76864836429016750527c8d316394f69 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
export Spec provides T, f
export Body provides f reveals T
datatype T = CT1 | CT2 (X: int)
ghost function f(): T { CT1 }
}
module B {
import A`Spec
ghost function g(): A.T { A.f() }
}
module C {
import... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/DecreasesExports.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 982 | b9b9dfa009322e6d0285422c3033e0f929f4457b325d407025844d1ce784e287 | // RUN: %testDafnyForEachResolver "%s"
module A {
export Specf provides T, f
export Bodyg provides T, g
export SpecF provides T, F
export BodyG provides T, G
type T = T2
datatype T2 = C(x: T2) | N
ghost function f(x: T, y: int): T { if y <= 0 then x else f(x, y-1) }
ghost function... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/DefaultExport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 554 | 5b9d2de326d64a457b54c6ec9e307d0ddb78ad0f16ee8be0b73efbb713085b93 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
export provides T
type T = bool
}
module B {
import A
method Test() {
var e : A.T;
var f := e == false; // error
}
}
module C {
module D {
export provides T
type T = bool
}
m... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ExportErrorLocations.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 895 | ef96b87d24c59a61a28831ea466203171fa33c60665df333df848d60285fed2e | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module MyModule {
// the source locations in the following error message should be on the token
// indicated in parentheses
export
provides F, FunctionG, Y // error: not a member ("FunctionG")
provides Undeniable, YourClass.M // error... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ExportImport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,041 | b3bfb02bc955a3eecb7a514792ad05dbd75e6eee06f13278a443090257609cd0 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
export AO provides T
export AR reveals T
type T = bool
}
module B {
export BO provides TT, BAO
export B provides TT
export BR provides BAR reveals TT
type TT = BAR.T
import BAO = A`AO
import BAR ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ExportInductivePredicate.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,238 | 1b35b57bc6c326fda5b8190256fe29e02699f354108c0d43a8057a3844011ee4 | // RUN: %testDafnyForEachResolver "%s"
module M {
least predicate P(x: int)
{
x < 100
}
greatest predicate Q(x: int)
{
x < 100
}
lemma K(x: int)
requires P(x)
{
}
lemma K'(x: int)
requires P#[3](x)
{
}
lemma CoK(x: int)
requires x < 100
ensur... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ExportRefinement.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,258 | 0d2df061cd789358caab54791574b63335242d59d832ae8254f0d86f34229b18 | // NONUNIFORM: Multiple testing scenarios (could be split)
// RUN: %run --print:"%t1.dfy" "%s" &> "%t.result"
// RUN: %build --print-mode Serialization --print:"%t2.dfy" "%t1.dfy" &> "%t"
// RUN: %run --print-mode Serialization --print:"%t3.dfy" "%t2.dfy" &>> "%t"
// RUN: %diff "%t2.dfy" "%t3.dfy"
// RUN: %diff "%... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ExportResolve.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 21,007 | 03aec7b6c0d42e7d21c9f959d1310f0308e7a75fe3bc6752ffd728dd54cc7a7e | // RUN: %exits-with 2 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module NamesThatDontExist {
export
// --- reveals
reveals DoesNotExist // error: unknown identiifer
reveals Trait?.Valid // error: not a type declaration with members
reveals Klass?.Valid // error: not a type declarati... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ExportVerify.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,910 | 7b749604f3e02fdfffcca699890d6cf5350a8f7c31205e73ceb6220d38125a49 | // RUN: %exits-with 4 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Lib {
export ProvideTypes
provides *
export MostlyProvides
provides Ten, Two, Method
provides D, D.M, D.P
provides D.PI, D.n
export Reveals
reveals Ten, Two
provides Method
provides D, D.M, D.P... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/FIFO.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 872 | 13e8221845cebddeec220cce7ca42d97b3ec5ad6e0bf6c9e8be64cd74f07f039 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
include "Queue.dfyi"
module FIFO refines Queue {
type Item = int
method Init() returns (q: Queue) {
q := [];
}
method Push(item: Item, q: Queue) returns (q': Queue) {
return q + [i... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/ImportPathNonShadow.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 730 | e24750f027f66a4a5595ab3669005d35665ba875f7060cbae8edd60c80eae84d | // RUN: %testDafnyForEachResolver "%s"
module A {
export fandg provides f, g
export justf provides f
ghost function f(): int { 0 }
ghost function g(): int { 1 }
}
abstract module B {
import Afandg = A`fandg
import A : A`justf
ghost function h(): int { A.f() + Afandg.g() + Afandg.f() ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/IncludeSkipTranslate.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 241 | 734d09d6adda314b2489018f1403fb56fc756a11515dd76cc19dad9c8ac1295e | // RUN: %testDafnyForEachResolver "%s"
include "ExportRefinement.dfy"
module Z {
lemma Test()
ensures 1 < 2 // this should be the only verification condition produced, plus one top-level one from ExportRefinement
{
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/LIFO.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 872 | cad626cc0a12b9f277b33c3ce322e0c10f1d0f2ee670fa0546f9b534506150ef | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
include "Queue.dfyi"
module LIFO refines Queue {
type Item = int
method Init() returns (q: Queue) {
q := [];
}
method Push(item: Item, q: Queue) returns (q': Queue) {
return [item]... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/OpaqueFunctions.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,009 | b347c8e2a70de2af0397a3e5bfab7ba53a7b8c617ccded7c8b4841e9e07a4982 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module A {
export A provides f
export B reveals f
ghost function f() : nat { 7 }
}
module B {
import A = A`A
ghost function g() : nat { A.f() }
ghost function h() : nat
ensures h() == 7
{ g() } // error
}
module C {... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/OpaqueTypes.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,074 | 14b05754513ad9e32ac7d0fdabc992f045e48d20bff62d9d06079fa069d803ea | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
export A provides T, f
export B extends A reveals T
type T = nat
ghost function f(): T
}
module B {
import A`A
ghost function G(): nat { A.f() } // error, T not known to be nat
ghost function H(n: A.T): bo... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/OpenImport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 857 | 5ff94ee3e6c72c3c8d7b1f97681e99d176354f0ef783f57709f9e1b33af59b10 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module A{
export provides T
export Spec provides f,T
type T = int
ghost function f(): T { 0 }
}
module B {
import opened A`Spec
export Body provides A reveals g,h
ghost function g(): T { f() }
ghost function h(): A.T { f(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/OpenImportRefined.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,015 | e2ea121727f0c31e86d324844982c00a86480c290a0d38d6d0433c3563113d6d | // RUN: %testDafnyForEachResolver "%s"
module GiveT {
type T = int
}
module Base {
import opened GiveT
ghost function f(x : T):int { 0 }
}
module Refined refines Base {
type T = int // OK -- local names take precedence over imported names
}
module ImportBase {
import opened Base
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/RevealProvideAll.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,078 | 996d69134f53e9bcde10338c74e85e22d7a48a855cbd9b8043a7d1151840fef1 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
module A {
export Spec reveals AClass provides * // when class is revealed, "provides *" also provides all the constructors of the class
export Body reveals *
datatype T = CT1 | CT2
ghost function getCT1() : T { CT1 }
ghost function ge... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/SubModuleDefaultExport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 400 | 03addce5e4910a6886e0695ba031e375ad20aaa6fb9e790f9068ddb301d8323a | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module E {
module SubE {
export SubE provides T
export A reveals TT
type T = bool
type TT = int
}
import SubEA = SubE`A
method Test() {
var g : SubE.TT; // error
var gg : SubEA.TT;
var e : Sub... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/xrefine1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,351 | 0db93e540e73ad81cfd9f6aa1ff7c2891e2ee626778ee96965288016e8b175e2 | // RUN: %exits-with 4 %run "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module ProtocolImpl {
export reveals *
export Spec provides ProtoT, Init
type ProtoT = bool
ghost predicate Init(p:ProtoT) { !p }
method orange(i:nat) returns (j:nat)
{
j := i + 1;
}
}
modul... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/xrefine2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,372 | c5d18036ee9298e67568f503753297fdec4ec3f200e5bdefe06fb38a5dc68e4e | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
module ProtocolImpl {
export reveals *
export Spec provides ProtoT, Init
type ProtoT = bool
ghost predicate Init(p:ProtoT) { p }
method orange(i:nat) returns (j:nat)
{
j := i + 1... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/exports/xrefine3.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,256 | ecdd2a6bbd588657352087317e976082e3e4251a76424e8636918e330b21fc0f | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
module AlphaImpl {
export reveals *
export Spec provides Alpha, IsValid, Init
type Alpha(00) = bool
ghost predicate IsValid(a:Alpha) {
a
}
method Init() returns (a:Alpha)
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/Aliasing.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 245 | 16cb578ab759989d1309e62053a57c73d7c51163c7493bf59d54cc16b49c2b03 | // RUN: %testDafnyForEachResolver "%s"
method Test1(a: array<(int, int)>, b: array<(int, int, ghost int)>) {
assert a as object != b;
}
method Test2(a: array<(int, int)>, b: array<(int, ghost int)>) {
assert a as object != b;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/AllowedGhost.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 353 | 152bf9d48b453b612a24e50352accefbee2517d69a1da53e6310b2b12f976b3f | // RUN: %testDafnyForEachResolver "%s" -- --print:-
method Test()
{
// Tuples with a single ghost component are allowed and they are compiled to empty tuples.
var x := (ghost 123);
var (y) := (ghost 123);
ghost var z: (ghost int) := (ghost 123);
var t: (int, ghost int, int) := (20, 2 := 50, ghost 1... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/AllowedGhostBindings.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 399 | 6b3004c62bc465f64b9be6e6b1aa486f99035334265670fc1dcc278d0ae19a59 | // RUN: %testDafnyForEachResolver "%s" -- --print:-
method Test1()
{
var tuple0 := (ghost 0:=123, ghost 1:=234);
var tuple1 := (ghost 123, ghost 234);
assert tuple0 == tuple1;
}
method Test2()
{
var tuple0 := (ghost 10:=10, 3:=3, 0:=0, 1:=1, 2:=2, 4:=4, 5:=5, 6:=6, 7:=7, 8:=8, 9:=9);
var tuple... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/AmbiguousGhost.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 403 | db947afcf576527c2f47d73bb1e3c9a96352cd9743aa8823866d4dfe134e7a4a | // RUN: %testDafnyForEachResolver "%s" -- --print:-
// Test that the `IsTypeSequence` method of the parser allows tuples with ghost components.
function F(x: int): () { () }
function a<T,U>(x: int): int { x }
method M<b, c>(d: int) {
var u;
u := F( a < (b, ghost b), c > (d) );
u := F( a < (b, (ghost b,... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/Comp.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,308 | dd8fb5cc681b2f52db5db07615b29dd85aba3b64988425d81d9e223d3dc44d37 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation
datatype PhantomData<T> = PhantomData(ghost value: T)
method Test0(t0: (ghost int)) { print "Test0: ", t0, "\n"; }
method Test1(t1: (ghost int, int)) { print "Test1: ", t1, "\n"; }
method Test2(t2: (i... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/DisallowedGhost1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 294 | f8506abcec10cd84e7bcc4ffbeca977fe08928d46fe745b1aa2effc4d48f7c57 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print=-
method Test1()
{
var first := 0;
var t := (ghost first:=123, 1:=234); // error
}
method Test2()
{
var t := (1:=123, 2:=234); // error
}
method Test3()
{
var t := (1:=123, 1:=234); // error
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/DisallowedGhost2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 140 | 98dbd59ad53f033c415585ea55c70afec5c4ab4c6b24bdabd600fc4f8e919ba3 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print:-
method Test()
{
var (ghost x) := 123; // syntax error
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/Resolution.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 249 | ddd40d2bded37eba30ebc13ba98ca4a73348236afcd1dee8c1d75fd790a50b14 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
method M<T(==)>(a: T)
method P() {
var x: (int, int, ghost int);
M(x); // Disallowed. It's not possible to compile an equality function that also checks ghost components.
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/ghost/Signature.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 221 | c15efd3fa969014e29637c20b8bc0de2af6fb1133a7a05eff75cd9753fb2a3ad | // RUN: %testDafnyForEachResolver "%s" -- --print:-
// The following signature used to cause the error "Undeclared top-level type or type parameter: _tuple#2OG".
method Test(ghost c: (int, ghost (int, int)))
{
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/4104-git-issue.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 179 | 04eaf6634a7fceb32e0751fb3374aaaa9ceb5f0223f95007c527f280af48f286 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
// This file tests that it's okay for a filename to start with a digit.
method Main() {
print "hello\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/BoundedInts.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,639 | 8380dcd97769d8b48c760056fc2518a48de38cc749f3612ed3f8c0869c94d455 | // RUN: %diff "%s" "%s"
module {:options "-functionSyntax:4"} BoundedInts {
const TWO_TO_THE_0: int := 1
const TWO_TO_THE_1: int := 2
const TWO_TO_THE_2: int := 4
const TWO_TO_THE_4: int := 16
const TWO_TO_THE_5: int := 32
const TWO_TO_THE_8: int := 0x100
const TWO_TO_THE_16: int :=... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/class.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 225 | 3c5f9b00486257560d3abcce3d7b60e5eea90ad43cdce205be6c66a2bd54b39a | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
// This file tests that it's okay for a filename to have a name like "class, which is
// reserved in many languages.
method Main() {
print "hello\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-032-errors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 541 | 2c3181fcd092db1cfd26840fb1b36b8cc66f5bbd696a7ffa713d0318ead06d6e | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method errors() {
var e := ();
var x := (2,3);
match x { case () => print "OK"; case _ => print "BAD"; } // ERROR
match e { case (a,b) => print "OK"; case _ => print "BAD"; } // ERROR
match () { case (a,b) => print "OK"; case... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-032.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 635 | 9952a015f582e0060f697e95adf82358877eb59c27828388710da349847dfbe7 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-warnings --relax-definite-assignment
method Main() {
m();
mm();
}
method m() {
var x := (2,3);
match x { case (2,y) => print "OK",y; case _ => print "DEF"; }
print "\n";
match x { case zz => print "OK"; case _ => print "D... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-032a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 175 | 82ae5459154daa0ba177801e833f543c80e8677bf0210ec2a4762526c1e3d41d | // RUN: %testDafnyForEachResolver "%s" -- --allow-warnings
method m() {
var x := ();
match x { case () => print "OK"; case _ => print "DEF"; }
print "\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1005.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,301 | f58c4bba0a6c68fe3555b53f39aff52020d7c5422794648e08c5e69c7ee6243b | // RUN: %exits-with 2 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype S0 = S0()
datatype S1 = S1(a0: int)
datatype S2 = S2(a0: int, a1: int)
datatype S3 = S3(a0: int, a1: int, a2: int)
method Test0a(x: int) returns (s0: S0, s1: S1, s2: S2, s3: S3) {
s0 := S0;
s1 := S1; // error: too few argu... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1016.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,628 | a31c59f9a2f7523a6f4aa43e04e444af405eade9a4e53543dead1f77a32c0bd1 | // RUN: %exits-with 2 %verify --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Option<T> = Some(value: T) | None {
predicate IsFailure() {
None?
}
function PropagateFailure<U>(): Option<U>
requires None?
{
None
}
function Extract(): T
requires Some?
{
va... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1016a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 640 | 1f8d78d052db4d4c18b68ccdaecd4f0efdb2a820a3f9e84feeb38a6e4bcdf45a | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Option<T> = Some(value: T) | None {
predicate IsFailure() {
None?
}
function PropagateFailure<U>(): Option<U>
requires None?
{
None
}
function Extract(): T
requires Some?
{
value
}
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1029.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 648 | 604a5212cde82091a93dc0c03c80ac685ecfc061c9923758b4dc88ba08a2e874 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
module ValueType {
export S
provides Value, Gimmie
type Value = s: seq<bool> | |s| <= 10
function Gimmie(): Value {
[true, true, false]
}
}
module UI {
import ValueType`S
datatype Op = Ge... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1074.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,739 | 84226777fdcf0912decf98f44fd8b432ea3f4fa62b95ba0eb6cb2b21c281ab17 | // RUN: %build --verbose "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
// This test uses an abstract type as the type of "children" below. This once caused
// a crash in the compiler.
// To distinguish the crashing test output from the correct test output, we need to
// get to a point where th... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1093.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 645 | aad50a12f5a0e09e3215596a0a76f11d9369b92ede9ec589c4ea062eec0b9d7a | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
UnusedLabel();
var c := new C;
c.x := 4;
c.LabelUsedInGhostCode(); // 10
print c.x, "\n";
}
method UnusedLabel()
{
// The following once resulted in malformed Go code, in particular gen... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1094.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,496 | f18173301cc83de8f27d27c3b3f909924093e37e7ef1fc33a2a73ef9da0a3416 | // RUN: %verify --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// ----- Type error -----
method FP() returns (r: FStatus)
{
{
var r: int; // this variable shadows the out-parameter r
:- FTry(); // regression: this once gave an error saying RHS (of type FStatus) not assignable to LHS (o... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 206 | 152d03c9042b15597da7237b153d50c451414d15becd494f21e1a0ce3378f178 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%S/../c++/arrays.dfy" -- --relax-definite-assignment --allow-deprecation --unicode-char false
// Test compilation of a file in another directory
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1105.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 347 | 270cab792909fbd26e149b77b35962b32bef36284ced3219d29d136b016ebe59 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
// Regression: A constructor like PushOp with 1+ ghost parameters and 0 non-ghost parameters
// once caused the Java compiler to emit two 0-parameter constructors
datatype Op =
| NoOp
| PushOp(ghost id: int)
method Main() {
var o := PushOp(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1109.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 177 | c4846767914862857d45c8c31e71867e1cc819321c2be8f7b129f86aeaf72754 | // RUN: %exits-with 4 %verify --stdin < "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
lemma TestStdin()
{
assert 2 == 3; // this error should be labeled <stdin>(6, 11)
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1111.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 361 | 5f4bf212e9cda4b9d8767900941e5c7fad38dfd22b0b7d1b0696b77401f588ff | // RUN: %build --target java "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module Foo {
class A {
const a : int
const b : int
constructor(k : int, j : int)
{
//a := k;
//b := j;
a, b := k, j;
}
}
method Main()
{... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1112.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,893 | 9b85a8993aa6283fc1bb0351ce7c5ae76f9e2cb8578d952f6e6b416c35afcc67 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
class C {
var d: D?
const k: int
}
class D {
var b: bool
}
method Field(c: C)
modifies c
requires c.d != null
{
c.d := null;
label L:
assert c.d == old@L(c.d) == null != old(c.d);
// The following errors were once not pro... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1113.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 956 | 0862c301d602ecb86e684aa79bf8ddde4f078097e7b65a6d632e93bd57424fbf | // RUN: %testDafnyForEachResolver "%s"
// ---------- 1113 ----------
type pair = s:seq<int> | |s| == 2 witness [0,0]
ghost function id<T>(x: T): T { x }
ghost function fst(p: pair): int
{
id(p)[0] // this once gave a type-checking error
}
ghost function pair_id(p: pair): seq<int>
{
id(p)[0..2]... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1127.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 548 | 4830532f5bb124f6759903dabc0b20528ab0f392fcb726ef176bc7995b09630b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
// -----
function Func<T(00)>(): int {
5
}
type PossiblyEmpty = x: int | true witness *
method Test()
{
ghost var w;
w := Func<PossiblyEmpty>(); // error: PossiblyEmpty is not known to be nonempty
}
// -----
ghost function GetI... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1129.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,226 | 9d28fe8fbe90f589cbf789aca7274d1d4fd1e3daea9c7045d44d0da3e90cb821 | // NONUNIFORM: Program expected to fail in backend-specific ways
// RUN: %verify "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --target cs "%s" > "%t".abyss
// RUN: %exits-with 3 %run --no-verify --target java "%s" > "%t".abyss
// RUN: %run --no-verify --target js "%s" > "%t".abyss
// RUN: %exits-with 3 %run ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1130.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,555 | 420500cbf4697f44a21c7de910a8aa0d8aaa7c551fa929177924cd113f36a4db | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
method Main() {
var a := new Issue.Foo<int>();
Issue.CallUseFoo(a);
var b := new Variation.Foo<int>();
Variation.CallUseFoo(b);
var c := new AnotherVariation.Foo<int>();
AnotherVariation.CallUseFoo(c);
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1143.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 636 | 782423b17abbf46434a9b4913d36655bcc733c1bc8a9307bf6fa8aa8b75c279d | // RUN: %testDafnyForEachResolver "%s"
datatype Nat = Zero | Succ(pred: Nat)
{
function MemberToInt(): int {
match this
case Zero => 0
case Succ(p) => 1 + p.MemberToInt()
}
}
function ExternalToInt(n: Nat): int {
match n
case Zero => 0
case Succ(p) => 1 + ExternalToInt(p)
}
f... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1148.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,281 | f3a7c5b0dd517cf8f17f470fed6e4e40b9769821da336d2f961dc3690b2e6cc2 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module AutoInitRegressions {
trait Y { }
datatype Datatype = Make
{
static const Static: Y // error: Y is not auto-init
const Instance: Y // error: Y is not auto-init
}
method Main() {
print Datatype.Static, "\n";
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1150.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 383 | c69e7bd1bc65983af89fdcb7f7cc03ec828c39b9a8a4bb766ab23e6693821137 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
datatype Foo = Foo(x: nat)
{
// the following once generated malformed Boogie
const good?: bool := 0 < x < 5
}
method Main()
{
var x := Foo(2);
assert x.good?;
print x, " ", x.good?, "\n";
var y := F... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 816 | f8ca3e317965811053304ef124541a22a794f4c0d963e1110ce8ebba5d99a3f0 | // RUN: %verify --relax-definite-assignment "%s" > "%t"
// RUN: %exits-with 3 %run --no-verify --target cs "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target java "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target js "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target go "%s" >> "%t"
/... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 556 | c2d3e87bf2b7ce6cef6c3a9fbfae0205bf6d0b82b799d433aed3a676431635f5 | // RUN: %run "%s" --relax-definite-assignment --input %S/git-issue-1151-concrete.cs > "%t"
// RUN: %diff "%s.expect" "%t"
module {:extern "M"} M {
type {:extern "T"} T
method {:extern} GetT() returns (t: T)
datatype D = D(t: T)
datatype E<X> = E(t: T, x: X)
type {:extern "U"} U(0)
type {:exter... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1158.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 506 | cddeebe5a4753a658440df9fc158494829753511545f0c3e736f822e82c09cbe | // RUN: %testDafnyForEachResolver "%s"
type Id(==)
ghost function F(s: set<Id>): int
lemma Test(x: Id)
{
var X := {x};
var a := map i | i <= X :: F(i);
var b := map[{} := F({}), X := F(X)];
assert a.Keys == b.Keys by { // spurious error reported here
forall i
ensures i in a.Keys <... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1163.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,076 | 0e06f82b75f2dcc8854ed3f77de3605754565c07fd1677c29636add12539c7f0 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
ghost function F(i: int): int
method M() {
ghost var f := old(i => F(i)); // the translation of this once had crashed the verifier (warning: old has no effect)
}
class MyClass {
var y: int
method N()
modifies this
{
y := 8;... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1164.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 481 | b3fff83dd9ae6c438badc49ffa3760e0b47a59aa3debe3f5357b65d5bf8b4f43 | // RUN: %testDafnyForEachResolver "%s"
class MyList<T>
{
}
method AAA<U>(aax: MyList?<U>) returns (aay: MyList?<U>)
ensures BBB(aax, aay)
ghost predicate BBB<V>(bbx: MyList?<V>, bby: MyList?<V>)
{
// the translation of this "null", when inlined into the postcondition of AAA above, once
// generat... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1165.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,337 | 7d990ef7b032fc5865b31ec1a04f053099551206150416075e76b133bc06183e | // RUN: %testDafnyForEachResolver "%s"
predicate P()
method TestMapMethod(s0: set<int>, s1: set<int>) {
var m;
m := map key | key in (s0 + s1) && P() :: true;
m := map key | key in (s0 + s1) :: true;
m := map key | key in s0 + s1 && P() :: true;
m := map key | key in s0 + s1 :: true;
assert tr... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1172.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,135 | a96d3ec7c43afc0a63b0e808945df83fa7b4518ebbf529d93ad34f8b1f392853 | // RUN: %exits-with 2 %run "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// The following examples show that verification would be unsound if ghost methods would
// be allowed to avoid termination checking.
ghost function F(): int
ensures false
decreases * // error: this is not allowed on a function
{
F... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1174.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 172 | 41e4434b8e79f6f825ecd47a39d5a6e2a17ec6e5b6d9dd5420da8cd047ba5c3b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
ghost function fm1(): bool
{
(true)
}
function fm2():bool
{
var v := fm1();
(v)
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1180a.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 8,410 | b6a72f769202e9adfb9c7e6a876a251b4923dd5cef391173c4697774889bbc8a | // RUN: %exits-with 2 %verify --show-hints "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// resolution errors
module BadRefiningIndications {
type Opaque ... // error: uses ... but there's nothing to refine
type Opaque' ... { } // error: uses ... but there's nothing to refine
datatype Datatype ... // error... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1180b.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 4,031 | db30914ec1dd32f56b3fc9e441bfeb97a4f5834674a731df071a1f7325b24c64 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// verification errors
module StartingFromOpaqueType {
abstract module A {
type Ty {
const c: nat
function F(x: nat): nat
requires x != 7
ensures F(x) == c
method M(x: nat) returns (r: nat)
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1181.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 209 | e4dfad7bae4a0611e28dcc7836e21919fdf67335782f4276cf719699e6c645fc | // RUN: %testDafnyForEachResolver "%s"
type T {
ghost predicate P(t: T)
ghost predicate Q()
requires P(this) // once got the bogus "type mismatch for argument (function expects T, got T)"
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1184.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 510 | 4477442b52bf13baa172096724cffe736bc45ef6709f9d508b2b0087ce299cf0 | // RUN: %testDafnyForEachResolver "%s"
type IntMap = map<int, int>
ghost function RemoveElement(m: IntMap, x: int): IntMap
{
// The following operation once got resolved as set difference instead
// of map domain subtraction, because the resolver didn't expand the
// IntMap type synonym before checkin... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1185.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 615 | 687270655aee63571ce852ca153347a805507938ee485a65ef8df66bb6c3761f | // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
predicate P(s: set)
requires s != {}
{
// In the following line, the let-such-that is compiled by TrExprOpt
var e :| e in s;
e == e
}
function F... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1195.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 293 | 7e48ea219b91bee9c40518ca1649b87e1d331579e00e02a85236a919a7f40691 | // RUN: %testDafnyForEachResolver "%s"
method M0(B: ORDINAL)
{
var b := B;
var w := 0 < b;
var y := b.IsLimit;
}
method M1(B: ORDINAL)
{
var b := B;
var w := 0 <= b;
var y := b.IsLimit; // this once had bogusly reported "type int does not have member IsLimit"
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1199.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 357 | ba31af230e6aeb418f0ce690992580a9600e434581d41c649da5d1a8a36c7c9c | // RUN: %build "%s" %S/git-issue-1199-extern.cs > "%t"
// RUN: %diff "%s.expect" "%t"
module {:extern "Microsoft"} Microsoft {
module {:extern "Microsoft.Dafny"} Dafny {
class {:extern "Main"} DafnyMain {}
}
}
module M {
import Microsoft
method Foo() {
var dafny: Microsof... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1207.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,586 | 4425eebaf0e33aa95c965f759cc8a9f9025f4b111c4d0e2edc58fd92bc2ac670 | // RUN: %exits-with 4 %verify --error-limit 0 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// The point of all of these tests is to make sure no boolean operators slip into
// the triggers passed to Boogie (which would cause Dafny to crash).
// The verifier is unable to prove many of these assertions, but that's no... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1210.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 162 | d6c4c510c053afc4b0a2a8d0c49c59ea7612a4bad2284baba4feeed34a2108db | // RUN: %testDafnyForEachResolver "%s"
abstract module A {
const c: nat
}
abstract module B refines A {}
module C refines B {
const c: nat := 0
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1211.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 239 | fdfc670336f3c3e5e623f0008ea3cdd898402f4cc7b0017d4fbac9c3bc9c7a63 | // RUN: %testDafnyForEachResolver "%s"
function apply<T,U>(op: T --> U): ()
{
()
}
datatype D = O | LD(c: D, thunk: () -> D)
{
function e(d: D): ()
{
apply((x: D) requires x.LD? => x.(c := d))
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1212.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 859 | 3e5b8de75e4b75c0818c12afcdd207bb572900b3b1c53ee877adb687751108d4 | // RUN: %exits-with 4 %run "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
trait H<Y> extends object { var data: Y }
class K extends H<int> { }
type Singleton = ()
method Main() {
var k := new K;
var a: H<int> := k;
var b: H<Singleton> := BadCast(k);
assert a == k == b as object;
label L:
var x ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1219.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,390 | 86bfb481be91039e7746cdcf30e06ff770fb342ee6494a8cec62808e4c1a2297 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print:-
module Issue1219 {
datatype CheckRussell = ISet(s: iset<CheckRussell>) // error: recursive mentions must be used in a strict (and covariant) context
lemma russell_paradox()
ensures false
{
var t := ISet(iset t: CheckRuss... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1224.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 162 | 2d0fedf24c198af0530b0041540e5545d816b0111f042847705143c46c99abf1 | // RUN: %testDafnyForEachResolver "%s"
abstract module SlowPoke {
lemma {:timeLimitMultiplier 4} SlowLemma()
}
module SlowChild refines SlowPoke { }
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1227.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 923 | 0c95041adc1ec2991a9d2654817168cfbe4d5d2bceeb3cdd02f0a70c864ab178 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
trait T {
function F(): int
}
class C extends T {
method F() returns (res: int) { // error: overwrite makes a change
res := 5;
}
}
class C' extends T {
ghost function F(): int { 5 } // error: overwrite makes a change
}
class C... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1229.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 303 | e1b09910a41620fda7b14fb74ae7bc3594ba07b87057c3691f43459623629f86 | // RUN: %build "%s" %S/git-issue-1229-extern.cs > "%t"
// RUN: %diff "%s.expect" "%t"
module {:extern "MyModule2"} MyModule2 {
type {:extern "MyType"} MyType(==,!new)
}
module MyModule1 {
import MyModule2
datatype MyDatatype = MyDatatype (
t: MyModule2.MyType
)
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1231.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 445 | 7c484ed29241daa561c331f86fc94dc00d5606ea12a27dc96c4d7ccc040eb18c | // RUN: %testDafnyForEachResolver "%s"
datatype Dt = Dt(x:int)
{
method {:timeLimitMultiplier 5} DatatypeTest(y:int) {
var z := y;
assert z == y;
}
}
newtype Even = x : int | x % 2 == 0
{
method {:timeLimitMultiplier 4} NewtypeTest(y:int) {
assert y == y;
}
}
codatatype Stream<... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1248.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 797 | 0bc16ceb9af018b5942248907b9ee9f5a607d9e4ecbbdbf278d3d94273570cc4 | // RUN: %exits-with 4 %build "%s" > "%t"
// RUN: %exits-with 4 %dafny /arith:10 "%s" >> "%t"
// RUN: %diff "%s.expect" "%t"
// When multiplication is axiomatized to include associativity of Mul
// (which is the case with /arith:10), then one can run into a matching loop.
// To try to prevent this, Dafny's axiom ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1250.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,501 | bd80abfbfb7c6b73d90cf123c6ffc8f9cbdc9faa8a4021936165b3f31f1a1428 | // RUN: %testDafnyForEachResolver "%s"
// This file contains the automatic proofs of two nice properties about Fibonacci-like numbers.
// The theorems were inspired by singingbanana's video https://www.youtube.com/watch?v=CWhcUea5GNc.
//
// The attempt to prove them discovered issue 1250, for which this file co... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1252.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,190 | 4300c7dffad551bf819e99a316c36ceb8b860c5a5823f8e80902e986dc990e6c | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
class C {
var more: C?
constructor ()
ensures more == null || fresh(more)
{
if * {
more := null;
} else {
more := this;
}
}
static method MaybeNew() returns (c: C?)
ensures c == null || (fresh(c) && (c... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1253.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 167 | 5b9cf78f45f6a27a356f941a0c97bf1b4192199f70e65e593e65b351a77edfe9 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
module M1 {
import M2.C
export
provides
C
module M2 {
const C: int
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1256.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,185 | 6b16fdc85fedea002683601ecc3146ffe842d939690ff964e0c3bf05194b608d | // RUN: %exits-with 4 %build "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
ghost function f<X(0)>(): X
{
var x: X :| true;
x
}
type low_int = t | 0 <= t < 256
type high_int = t | 1000 <= t < 2000 witness 1000
method False()
// Regression: the following postcondition was once provable
ensures false... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1277.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 383 | 080d308602f7b6296a55d1879cb592161acb588700b11a2502ddad61d75f0bb9 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
ghost function RangeMask(from: nat, to: nat): bv6
lemma CalcEqBits(i: nat, j: nat)
{
// regression: the following once caused a crash in type inference (missing cases for bitvectors)
calc == {
RangeMask(i, j);
-1 << (6 - j); // error (... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1309.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 450 | eb1f15a15f088b9d3f54f2aa22ea709f57bf063d11715ffabc4e05b366ed4a90 | // RUN: %exits-with 2 %verify --allow-axioms "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// Example for Issue 1309 -- not yet fixed
module A {
module C {
datatype Option<T> = None | Some(x : T)
}
}
module B {
module C {
datatype Option<T> = None | Some(x : T)
}
}
module D {
import... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1347.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 552 | 841e3625f504e307322e7b7ef7785fa625da3d7de831fab7ccc7b04b4e82f462 | // RUN: %testDafnyForEachResolver "%s"
module Foo {
datatype T = TX()
datatype U = U
datatype V = TV()
datatype W0 = W0()
datatype W1 = W1()
}
module Bar {
datatype T = TY()
datatype U = U
ghost function V(): int
datatype W0 = W0
datatype W1 = W1
}
module Consumer {
import ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1373.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 257 | b1e6cee69eec6f970c902fcdb36e12f8cfd53b41ab9e7145f42e2fd59dbf9dc0 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
var x := map[1 := () => 1];
print x.Values; // error: map range type must support equality
print x.Items; // error: map range type must support equality
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1377.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,557 | de1c209b12219655d348440ce366e9aca900bdb413b3ee2ef7d450314e0d4af3 | // RUN: %exits-with 2 %run "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class Cell {
var data: int
}
trait Trait {
function baz(): Cell
function xyz(): nat
method M0(n: nat) returns (n': int)
method M1(n: int) returns (n': nat)
function F0(n: nat): int
function F1(n: int): nat
function G... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1384.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 135 | fdd85425983f5910e44a0a2ccd7bf5f0fdc5455aee536a92df79c29395e218bb | // RUN: %testDafnyForEachResolver "%s" -- --print:-
method Test()
{
var f: ((int,int)) -> int := (x: (int,int)) => 1;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1419.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 8,286 | f509814c7eb82444169ac78883cb12ce99806a473204f758f6a72dc60244a3c7 | // RUN: %exits-with 2 %run --target cs "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
module FromBugReport {
ghost predicate P() {
// The following expression depends on the allocation state, so it should not be allowed
// in a function.
exists o: set<object> :: |o| > 10 // error: function body is no... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1423.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 487 | a34bd3ffb1267a2d003dc6f19fec15535808864b9f00b8d4aa85507a1d56f877 | // RUN: %testDafnyForEachResolver "%s"
ghost predicate P(s: seq)
method M(s: seq<int>, i: nat, v: int, n: nat)
requires i < n <= |s|
requires P(s[n..])
{
var t := s[i := v];
// Before issue 1423 was fixed, the following assertion did not prove automatically
assert P(t[n..]);
}
method Workaro... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1435.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 238 | b2d801ef6ffdacd107e1ace866a22323df64ae44ce7590b3aa7033bab1de4ab1 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
class C {
var x:nat
twostate predicate p() { unchanged(this) }
method bad() modifies this ensures false {
assert p();
x := x+1;
assert p();
}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1458.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 154 | b5e8ccdb8211992e2ea3ba7860010782af30f06eb93257e732e7e58e564a0487 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
method Main() {
SwingoutSister();
}
method SwingoutSister() {
break Out;
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1479.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 967 | d10dd494d7b9616dec79c3996524eb9d357ed5f6493519cd25cbb8520bbbf2ed | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
// This file checks that datatype updates have the correct return type.
module A {
type T
datatype BaseType = BaseType(t: T)
ghost predicate P(d: BaseType)
type SubsetType = d: BaseType | P(d) witness *
method m0(dp: SubsetType)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.