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/dafny0/PrintEffectsResolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,301
2add3e11acf1ea7b174fcd839881bd40d39e6d752d9fa5c986139bd0193b7327
// RUN: %exits-with 2 %run "%s" > "%t" // RUN: %exits-with 2 %run --track-print-effects "%s" >> "%t" // RUN: %diff "%s.expect" "%t" // The errors in this file are produced regardless of /trackPrintEffects setting. method {:print} M() { } ghost method {:print} N() { // error: cannot apply {:print} to ghost m...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/PrintUTF8.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
148
092d77c2debe7fa5e66361d9681a3f1908659fef6d1ee30443360b079ba1b634
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment method Main() { print "Mikaël fixed UTF8\n"; }
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Protected.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,504
190859f0b66e585b1548a1e03893103fd3df6769d7ea1481aa52c7c930f78988
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" module Library { export reveals F, G provides H ghost function F(): int { 5 } ghost function {:opaque} G(): int { 5 } ghost function H(): int { 5 } lemma L0() { assert F() == 5; assert H() == 5; } lemma L1() { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ProtectedResolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
311
a38dd9edee408706ad7b00adae7e2486f9ade6920f7db8066b9a25a9dc4d5591
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" module M0 { ghost function F(): int { 5 } ghost predicate P() { true } } module M1 refines M0 { ghost function F... { 7 } // error: not allowed to change body ghost predicate P... { true } // error: not allowed to extend body }
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/QuantificationNewSyntax.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
977
289c0430b4ed04c8798c748a406e12bb95d9b485258c34c0176a4076f4e87ad9
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" module {:options "/quantifierSyntax:4"} NewSyntax { method M() { // Illustrating that per-quantified variable ranges // can be used to ensure later domains and ranges // are well-formed. var numbers := [0, 1, 2, 3]; var _ :=...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/QuantificationNewSyntaxParseErrors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,552
a8d6a3649cdb4c713f69fd68c9cdcad4874b88d85bc194e9b59394644e55175d
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" module {:options "--quantifier-syntax=3"} OldSyntax { method M() { var y := 5; print set x | 0 <= x < 10, y; // Allowed, parsed as two separate arguments to print SomeMethod(set x | 0 <= x < 10, y); // Similarly var c := ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/QuantificationNewSyntaxResolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,898
d5b9b75508587f5c51fe6a7cbdae76e9707ba62175881796d30967e1f741f34a
// RUN: %exits-with 2 %build --type-system-refresh=false --general-newtypes=false "%s" > "%t" // RUN: %diff "%s.expect" "%t" module {:options "/quantifierSyntax:4"} NewSyntax { method M() { // Ensuring we get sensible errors for type mismatches, // despite the current desugaring implementation. ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RangeCompilation.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
563
1ddc94a0305b5ac0e1908902726d27cbbb356749778e331a37969ba3962a14e0
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment newtype Byte = x | 0 <= x < 256 predicate GoodByte(b: Byte) { b % 3 == 2 } predicate GoodInteger(i: int) { i % 5 == 4 } method Main() { assert GoodByte(11) && GoodInteger(24); var b: Byte :| GoodByte(b); ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RankNeg.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
729
d96b98091887432435115807320aa35bc2f54f7fc7bba17f0dedf2058346ce66
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" // Negative tests // Not well-founded mutual recursions. ghost function seq_loop_i(xs: seq<int>): int { if (xs == [1, 2]) then seq_loop_s([[1,2]]) else 0 } ghost function seq_loop_s(xs: seq<seq<int>>): int { if (xs == [[1, 2]]) then seq...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RankPos.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,612
e2139a54a2dcaef3918c9582c1e0c2f0d4bd098a31d71e4f7c3516258ec14e56
// RUN: %testDafnyForEachResolver "%s" datatype list<A> = Nil | Cons(head: A, tail: list<A>) datatype d = A | B(ds: list<d>) datatype d2 = A2 | B2(ds: seq<d2>) datatype d3 = A3 | B3(ds: set<d3>) ghost function d_size(x: d): int { match x case A => 1 case B(ds) => 1+ds_size(ds) } ghost function ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Reads.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
5,560
a9cd34c1bc6c7bd1e9a9375256ea3c9d1d94124e8a8ce66c9d4924defb836eae
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" // Checking that the reads clause also is checked over requires class C { var u : int } ghost function nope1(c : C):() requires c.u > 0 {()} ghost function ok1(c : C):() requires c.u > 0 reads c {()} ghost function nope2(c ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReadsOnMethods-EnabledResolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
917
fb45c5791278f075dc83594f713f800d272e8ed4fbd16ff98a5371bf99f29a28
// RUN: %exits-with 2 %verify --reads-clauses-on-methods "%s" > "%t" // RUN: %diff "%s.expect" "%t" module CContainer { class C { var u : int constructor(u: int) reads {} { this.u := u; } constructor Copy(c: C) reads c { this.u := c.u; } method M() reads {}...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReadsOnMethods-Resolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
529
71fb7858cbd7aa8e17dd38424dd47c5fce673f118147c2db588521bded0267a4
// RUN: %exits-with 2 %verify "%s" > "%t" // RUN: %diff "%s.expect" "%t" class C { var u : int constructor(u: int) reads {} { this.u := u; } constructor Copy(c: C) reads c { this.u := c.u; } method M() reads {} {} static method TrexsCantSeeIt(c: C) reads c {} ghost method...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReadsOnMethods.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
15,749
ebe14492080b74f622b188de15e54f61f63e6b2a1cf3d126de88c6fd158e1c61
// RUN: %exits-with 4 %verify --reads-clauses-on-methods "%s" > "%t" // RUN: %diff "%s.expect" "%t" // The first half of this file is a clone of Reads.dfy, // but modified to use methods instead of functions wherever possible, // to provide more testing coverage of the newer feature // of allowing and enforcing...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReadsOnMethods_Printing.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
662
ddcd3c9020a14dfbbfce8fadf399e4a95a3ec5653f239382b282c7f7c61b1ee2
// RUN: %resolve --print:- --reads-clauses-on-methods:false "%s" > "%t" // RUN: %resolve --print:- --reads-clauses-on-methods:true "%s" >> "%t" // RUN: %resolve --rprint:- --reads-clauses-on-methods:false "%s" >> "%t" // RUN: %resolve --rprint:- --reads-clauses-on-methods:true "%s" >> "%t" // RUN: %diff "%s.expect"...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReadsVisibility.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,124
4a76e21eaf1d6eaede33ae220a802c3760bdc52b3d36891b7427c10c13772701
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" // Test that the export-provided type `T` is not recognized as a reference type in Client. module FarAway { export provides T reveals U reveals M export Everything extends FarAway reveals T type T(==) = object type U =...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RealCompare.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,310
cdfa7861df2378fd53fad7892af78f1570ef9c41c953873d392b39bf3daebd6b
// RUN: %exits-with 4 %verify "%s" > "%t" // RUN: %diff "%s.expect" "%t" method M(x: real) decreases x { if 0.0 <= x { M(x - 15.0); } } method N(x: real, y: real) decreases x, y { if 0.0 <= y { N(x, y - 1.0); } else if 0.0 <= x { N(x - 1.0, 300.0); } } method N_implicit...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RealTypes.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,195
7a2f7201aade7dd0e5febe8076896413743f73ec6d15e96901c365c43fb8635c
// RUN: %exits-with 4 %verify "%s" > "%t" // RUN: %diff "%s.expect" "%t" method R1(ghost x: real, ghost y: real, i: int) { assert x + y == y + x; assert i as real as int == i; assert x.Floor as real <= x; if { case x.Floor as real >= x => assert x.Floor == x as int; // the cast to int is al...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Refinement.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
5,381
336beac952137c2cb3d3bde66cde75af4455534e9fa1e960d94b9677ed332736
// RUN: %exits-with 4 %verify --relax-definite-assignment --allow-axioms "%s" > "%t" // RUN: %diff "%s.expect" "%t" module A { class X { } class T { method M(x: int) returns (y: int) requires 0 <= x ensures 0 <= y { y := 2 * x; } method Q() returns (q: int, r: int, s: ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RefinementErrors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,299
b5cb9879b2f45ac82c4c00a6a05ad8150e7447d10e40dedce6dd47167650cd01
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --allow-deprecation module A { class C { method M(y: int) returns (x: int) { x := 6; } var abc: bool; var xyz: bool; function F<A,B,C>(x: int, y: A, z: set<C>, b: bool): B ghost function G(): int // u...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RefinementModificationChecking.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,153
4be5432942ce08c79efb4645982829850ba705e66209f1918c9a7ddccabdace4
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" abstract module R1 { class HappyBay { var f: int method m(y: set<int>) returns (r: int) modifies this { var t := y; } } } module R2 refines R1 { class HappyBay ... { var g: nat method m ... { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors0.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
15,980
53668e06cdbf6e0d25552bd7b5e055b6cf0f08989b5793a7b8179637e897ed31
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" module Misc { //Should not verify, as ghost loops should not be allowed to diverge. method GhostDivergentLoop() { var a := new int [2]; a[0] := 1; a[1] := -1; ghost var i := 0; while (i < 2) decreases * // e...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
5,076
ec5a31d7abdcba02d5239b53eb4140f84c6464498d4f9f3b01abe77cbfa73f85
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --allow-axioms // ------------------------ inferred type arguments ---------------------------- // Put the following tests in a separate module, so that the method bodies will // be type checked even if there are resolution errors in other modules....
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
12,636
9f1233921cd165662b5c629b60878fb281ef39237c7922c1e95adf20a940fc35
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" // ------------------------- statements in expressions ------------------------------ module StatementsInExpressions { class MyClass { ghost method SideEffect() modifies this { } method NonGhostMethod() { } ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors3.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
14,464
dbaa3f3135fcfb0bf0753b174bbf0df7742554ba9e391f720e821d75b0495eb2
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --allow-axioms // ------------ type variables whose values are not inferred ---------- module NonInferredTypeVariables { class C<CT> { var f: CT } predicate P<PT>(x: int) { x < 100 } ghost function Q<QT>(x: int): QT ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors4.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
10,903
eca4e093287ddcf495a5565b59c36fcf0282f25de6cf577289a2177db402c026
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print-ranges // ------------------- infer array types for Indexable and MultiIndexable XConstraints ---------- // ------------------- using weaker subtyping constraints ---------- module AdvancedIndexableInference { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors5.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
19,303
140249f190913f054a3006d6e85bb260facdd99032a2990dfdaba85d1d693d51
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --allow-axioms // ----- constructor-less classes with need for initialization ----- module ConstructorlessClasses { class C<T(==)> { // error: must have constructor var x: int var s: string var t: set<T> var u: T const c...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors6.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
10,975
660d7e9099f51812ad4177a5a5f678f6cffd64f571944aa0ba415f211c2e1e11
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" // ----- bad use of types without auto-initializers ----- module Initialization { datatype Yt<Y> = MakeYt(x: int, y: Y) type Even = x | x % 2 == 0 type Odd = x | x % 2 == 1 witness 17 type GW = x | x % 2 == 1 ghost witness 17 method De...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors7.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
13,136
6e2c6170db5448600d56da9e0d2882a778d54aeb0fdd964911be1b1fba0b13fd
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" // --------------- ghost function error messages ------------------------------ module GhostFunctionErrorMessages { ghost function GhostFunction(): int ghost predicate GhostPredicate() least predicate LeastPredicate() greatest predicate Gre...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors8.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
13,603
dab4068d49bd685f17892f845f617cb24d8260427fbb02f4319a145624f52bb0
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" // --------------- let-such-that ghost regressions ------------------------------ module LetSuchThatGhost { ghost predicate True<T>(t: T) { true } function F<T>(s: set<T>): int requires s != {} { // once, the RHS for p was (bogusly...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResolutionErrors9.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
6,491
8354f52beca64668c6c36b489d1eadb17f9fc992c29f8a9036ec2ae53517cf2a
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --allow-axioms // --------------- regressions: using "this" in places where there is no enclosing class/type ------------------------------ module UseOfThis { // The following uses of "this." once caused the resolver to crash. type {:badUseO...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RestrictedBoundedPools.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
8,603
2fbbc20debc1853ae786c8c7ba6c6c797bfe3f3f1af685a5f43bcf979aac2262
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" module Methods_EverythingGoes { ghost predicate R<Y>(y: Y) { true } type Opaque(==) type OpaqueNoAlloc(!new) class Cell { var data: int } datatype List<G> = Nil | Cons(G, List<G>) method M0() requires forall x: Opaqu...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResultInTypeNewtype.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
8,558
8d36172651cf1b61844cf666fbb393ec3be76773246fa6d3532c5cbe9d470c79
// RUN: %exits-with 4 %verify --type-system-refresh --general-newtypes "%s" > "%t" // RUN: %diff "%s.expect" "%t" // This file tests that the results of operations that create values of a newtype satisfy the newtype constraint. // See also ResultInTypeSubsetType.dfy for the analogous tests for subset types. mod...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ResultInTypeSubsetType.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
8,502
93edd1858dbf8bac2175d00b33984255a3f49aba93db786548b2b55c19687a5c
// RUN: %exits-with 4 %verify --type-system-refresh "%s" > "%t" // RUN: %diff "%s.expect" "%t" // This file tests that the results of operations that create values of a subset type satisfy the type's constraint. // See also ResultInTypeNewtype.dfy for the analogous tests for newtypes. module Bool { type Fals...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReturnErrors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
829
d51e908d2af429cc3f2d5d51d0f77e2a06c282482ab0ec0fdfd6625f3278ef18
// RUN: %exits-with 2 %verify --allow-deprecation "%s" > "%t" // RUN: %diff "%s.expect" "%t" class N { var i: int; method newN(n: N) requires n != null; modifies this, n; { n.i := 1; i := 1; } method safe(n: N) requires n != null; modifies this; { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ReturnTests.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,385
975342d0417c9ac1866a1fa1c875f759111d85d00ce5c0a44897f1133733aed3
// RUN: %verify --allow-deprecation "%s" > "%t" // RUN: %diff "%s.expect" "%t" class N { var i: int; method newN(n: N) modifies this, n; { n.i := 1; i := 1; } method safe(n: N) modifies this; { i := n.i; } } method m(v: int, n: N) returns (r: int) ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RevealConsistency.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
520
314238077d9445956be0cd5516cd0f270e86f6b539b3381b0bf8dbdebdd26d5b
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" // Check that using the reveal_ lemma to prove the well-definedness of a function // in a lower SCC does not cause a soundness problem ghost function A(): int ensures A() == 5 // error: this result value is not what the postcondition specification ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RlimitMultiplier.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
258
e89352f646c8db09a691b6aef75a63386d4543303579194701bd222e734f28b3
// RUN: %verify "%s" --resource-limit 10e6 > "%t" // RUN: %diff "%s.expect" "%t" ghost function f(i:nat, j:nat):int {if i == 0 then 0 else f(i - 1, i * j + 1) + f(i - 1, 2 * i * j)} lemma {:timeLimitMultiplier 100} L() { assert f(10, 5) == 0; }
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RuntimeTypeTests0.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,608
923e12137daa8485f96ca52d9398a0925fbf32ad1ce72f96c9464653c946b53e
// UNSUPPORTED: windows // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" // The code in this file demonstrates complications in sorting out covariance in some // compilation target languages. // // Part of the solution in Java is to use Java's wildcard types: a "Dafny.Sequence<T>"" is assignable to ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RuntimeTypeTests1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,527
4d74ec387dfe036da6cb6b6b522c071369ba44dc48811262ff7c20a2fc4cbfba
// RUN: %exits-with 2 %run "%s" > "%t" // RUN: %diff "%s.expect" "%t" // The code in this file demonstrates how correct compilation of some features // would require run-time type tests beyond what is reasonable to do at run time. // In more detail, the problem occurs when a type test is needed to distinguish //...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/RuntimeTypeTests2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
736
39d29acb232c274af6a469148b7b7f816f8f0fa0312085f2671e3c877a8ba21c
// RUN: %exits-with 3 %run "%s" --target cs > "%t" // RUN: %diff "%s.expect" "%t" // The errors in this file are produced by the compiler predicate ItWasReal(r: real) { r == 44.1985 } method AssignSuchThat() returns (a: int, b: real) { a :| a % 5 == 0 && a % 7 == 0; assert ItWasReal(44.1985); b...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SeqFromArray.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,515
a7790a438009d2bbd002b9d86280305be0889daedbd9a971b774e36762d3f1f8
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment // /autoTriggers:1 added to suppress instabilities method Main() { } method H(a: array<int>, c: array<int>, n: nat, j: nat) requires j < n == a.Length == c.Length { var A := a[..]; var C := c[..]; if { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SeqSlice.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,133
b98f4f5d15cc074eaf7c0f83eefe98a77fe99b451526123c359dc3b8651fe59d
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" method test(x:seq<int>) requires |x| == 10 { var elts := x[4:2:3]; var a, b, c := elts[0], elts[1], elts[2]; assert |a| == 4; assert |b| == 2; assert |c| == 3; assert forall i :: 0 <= i < |a| ==> a[i] == x[i]; assert forall i ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Shadows.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,867
16c0f278b4bf67cd1574d4cf70a966048a21dc695072b9763f2bf8f834bdb43b
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --warn-shadowing module Module0 { class C<alpha> { method M<beta, beta>(x: beta) // error: duplicate type parameter method P<alpha>(x: alpha) // shadowed type parameter ghost function F<beta, beta>(x: beta): int // error: duplicate...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SharedDestructors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,840
b1af4bf46bba9d4ce3e1af4948406e0605149d7056824fca4b35c3a7bd59efda
// RUN: %exits-with 4 %verify --relax-definite-assignment "%s" > "%t" // RUN: %diff "%s.expect" "%t" datatype Dt = | A(x: int, y: real) | B(h: MyClass, x: int) | C(y: real) | D(u: int, y: real, v: bool) class MyClass { } method M(d: Dt) returns (r: int, s: real) { if case true => r := ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SharedDestructorsCompile.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,824
aa798a62b940605e284c65392f76522b5eae7d54415b5797397b195c1747b853
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment datatype Dt = | A(x: int, y: real) | B(h: MyClass, x: int) | C(y: real) class MyClass { } method Main() { var o := new MyClass; var s := [A(10, 12.0), B(o, 6), C(3.14)]; assert s[0].x == 10 && s[0].y ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SharedDestructorsResolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,674
71a117653fdce9cc6efb954b04cfb5b726e2f4d5431167f2ddf06abfa09dd0e1
// RUN: %exits-with 2 %verify "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Module0 { datatype Dt = | A(x: int, y: real) | B(h: MyClass, x: int) | C(y: real) | D(u: int, y: real, v: bool) | E(u: int, /*unnamed*/int) class MyClass { } method Update(d: Dt) returns (d': Dt) {...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ShowSnippets.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
643
e26bef14dd9bd6c1d2c75c880faa606ec0018cd0ed721163bc0d65fcf21d266e
// There is a known bug in this feature where it can't find the original file if // /useBaseNameForFileName is used and the file isn't in the current directory: // https://github.com/dafny-lang/dafny/issues/1518. // To work around this, we don't pass /useBaseNameForFileName and instead manually // truncate the sour...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SiblingImports.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,378
a543992947aea02d508a5a4de972714f86bef5a567d1f69e2aead89a50bc9db9
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment method Main() { ClientA.Test(); ClientB.Test(); ClientC.Test(); ClientD.Test(); ClientE.Test(); ClientF.Test(); ClientG.Test(); Kevin.Test(); } module Library { export reveals Max export X re...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SiblingImportsErrors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,170
66a4fd7e4bbf510175763a9d7331ff320cefc564700e1e8cc38048b8c9ad27d9
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" module Library { export reveals Max export X reveals More export Y reveals Less export Z extends Library, X function Max(x: int, y: int): int { if x < y then y else x } function More(x: int): int { x + 2 } function Less(x: int...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Simple.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,251
44c5ef7370d43aafae7f6ca44b03f9beffcc0bd1dfd8c5cb001ff318fb95cb26
// RUN: %resolve --allow-warnings --print:- "%s" > "%t" // RUN: %resolve --allow-warnings --print:- --type-system-refresh "%s" > "%t.refresh" // RUN: %diff "%s.expect" "%t" // RUN: %diff "%s.expect" "%t.refresh" // My first Dafny program // Rustan Leino, 27 January 2008 class MyClass<T,U> { var x: int met...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Skeletons.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,119
740938e3ee8bb348ce37bde91db88f55bb0bec2f0e819cd7b446a57612996c8c
// RUN: %exits-with 4 %verify --relax-definite-assignment --allow-axioms "%s" > "%t" // RUN: %diff "%s.expect" "%t" module A { method M(p: int) returns (y: int) requires p <= 30 { assume p < 100; var x; assume x == p + 20; x := x + 1; while (*) invariant x <= 120 de...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SmallTests.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
25,143
c9d2bce57c6293e611c9aee3d57291a732527b93c2f24fdd66f08ea35cfbb9cb
// RUN: %exits-with 4 %verify --relax-definite-assignment --allow-axioms --allow-deprecation --print "%t.dprint.dfy" "%s" > "%t" // RUN: %resolve --allow-axioms --allow-warnings "%t.dprint.dfy" >> "%t" // RUN: %diff "%s.expect" "%t" class Node { var next: Node? ghost predicate IsList(r: set<Node>) rea...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SplitExpr.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,047
2f16ce728996e107272f26abf95b7a76bdb5c04775d02b3925745023e2a12102
// RUN: %exits-with 4 %verify --relax-definite-assignment "%s" > "%t" // RUN: %diff "%s.expect" "%t" class UnboundedStack<T> { var top: Node?<T> ghost var footprint: set<object> ghost var content: seq<T> ghost predicate IsUnboundedStack() reads {this} + footprint { this in footprint && ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/StatementExpressions.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,689
447bf98e44c789732f91579568702279b2810848b36d9affaf3276e7e53a4524
// RUN: %testDafnyForEachResolver --expect-exit-code 4 "%s" lemma M(n: nat) //returns (y: nat) { var y := F(n, 0); } ghost function F(n: nat, p: int): nat { calc { 100; < { if n != 0 { M(n-1); } } 102; } n } lemma MM(n: nat) returns (y: nat) decreases n, 0 { if n != 0 { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Stdin.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
778
59eed8197484edd8651f700e7f874192fb762856c70a133bbbc73cd09ac42611
// RUN: %exits-with 0 %stdin "module A{}" %baredafny verify --show-snippets:false --stdin > "%t" // RUN: %exits-with 4 %stdin "method a() { assert false; }" %baredafny verify --show-snippets:false --stdin >> "%t" // RUN: %exits-with 0 %stdin "" %baredafny verify --allow-warnings --show-snippets:false --stdin >> "%t" ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Strings.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
5,252
fcbe4ee61104ffaf2e4224afa263d16e01171809d1fc4dec9c5bfd45de8a53d5
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-deprecation --unicode-char=false method Char(a: char, s: string, i: int) returns (b: char) { var ch: char := *; if a == ch { b := ch; } else if 0 <= i < |s| { b := s[i]; } else { b := *; } } // An attribute par...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SubsetTypes.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
12,472
7c7ab73e6e6158653e2f3f9e4d13d1d11f6e7d65d13b46d5ba9d5cbf1a15c534
// RUN: %exits-with 4 %verify --type-system-refresh=false --general-newtypes=false "%s" --performance-stats=100 --relax-definite-assignment --allow-axioms > "%t" // RUN: %diff "%s.expect" "%t" module AssignmentToNat { method M(x0: int, x1: int, x2: int, x3: int) { var a: nat := x0; // error a := x1...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/SubsetTypesERR.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,105
bef03e6736042a8c367cd48add33a1574f9282bd5b72b739293406424b20d149
// RUN: %exits-with 4 %verify --relax-definite-assignment "%s" > "%t" // RUN: %diff "%s.expect" "%t" module AssignmentsFromNewAllocation { // Many of the tests in this module are regression tests class Person { } class Cell<T> { } method K(p: Person) returns (a: array<Person?>, b: array<Person>) { ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Superposition.legacy.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,074
0929907602e1fdf046b3ba99cd424d98455770e6361b8c2b8af18c14cde0a487
// RUN: %exits-with 4 %dafny /compile:0 /tracePOs /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t" // RUN: %diff "%s.expect" "%t" module M0 { class C { method M(c: C?, x: int, y: int) returns (r: int) requires 0 <= x && 0 <= y ensures r < 100 { if (c == null) { assert c =...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TailCalls.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
11,673
1ad9ab9f1c70b5957fd40ab758419c47ebef626a1f459beba3ab31b203621657
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --allow-deprecation method {:tailrecursion} A(q: int) returns (x: int, ghost y: bool, z: nat) { if (q < 10) { x, y, z := 15, true, 20; } else { ghost var u; x, u, z := A(q-1); y := !u; } } method {:tailrecursion} B(q: ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
25,695
a96ebb41d57d349ce1bac66da8b31f39475ca905f673bca12f9fe911f967e28b
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char=false class Termination { method A(N: int) requires 0 <= N { var i := 0; while i < N invariant i <= N // this will be heuristically inferred: decreases N...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Tooltips.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
564
85657c23b7c31e010b037fa89f87594e5cabb9536dd318bae17ca4b3f87212dd
// RUN: %dafny /compile:0 /typeSystemRefresh:1 /generalNewtypes:1 /printTooltips "%s" > "%t" // RUN: %diff "%s.expect" "%t" type D<X> = set type B0<Y> = (int, B1<Y>) type B1<YY> = y: set | true newtype NN<!Y3> = iset<Y3> datatype B2<!Y2> = Something(NN<Y2>) newtype OO<!Y5> = y: iset<Y5> | true codatatyp...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TranslationCases.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,075
fad34f35d27174ba059b11459906299b5109ec52ee2ad9590f2a2445c95340dc
// NONUNIFORM: Only testing the translation to Boogie aspect of the pipeline depending on checks // RUN: %baredafny run %args --log-level verbose "%s" > "%t" // RUN: %OutputCheck --file-to-check "%t" "%S/TranslationCasesTranslate.check" // RUN: %baredafny run %args --log-level verbose --no-verify "%s" > "%t" //...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TriggerInPredicate.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
569
aaed3072ce47dcf14837438d437b2a8d4dac9467c574cfe6dc40094685ecc8c0
// RUN: %verify --show-hints "%s" > "%t" // RUN: %diff "%s.expect" "%t" ghost predicate A(x: bool, y: bool) { x } ghost predicate B(x: bool, z: bool) { forall y {:trigger A(x, y)} :: A(x, y) && z } // Inlining is disabled here to prevent pollution of the trigger in B method C() requires B(true || false, true...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Tuples.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,147
42e9e1bf27ebcfd2feec8d71a7368c077d7d141ffaed1c4b2a56beaa6c348893
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" method M(x: int) { var unit := (); var expr := (x); var pair := (x, x); var triple := (x, x, x); } method N(x: int, y: int) { var unit: () := (); var expr: int := (x); var pair: (int,int) := (x, x); var triple: (int,int,int) ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Twostate-Functions.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,690
235768b65dede0df85328b14f399e538caa430d1e6ad4aafddffbd9082090d23
// RUN: %exits-with 4 %verify "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Basic { class U { var aa: int var bb: int var next: U? static twostate function H0(new u: U): int requires 10 <= old(u.aa) // error: u is not available in the old state { 5 } stat...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Twostate-Resolution.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
15,018
cd7a2412ec4374e97b5049c19d95d37c22d9e441151460011024fac46d189477
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print:- module M0 { class A { var f: int var g: A } twostate lemma L8(a: A, new b: A) requires unchanged(a.g) modifies a.g // error: lemmas are not allowed to have modifies clauses decreases old(a.f) {} } ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Twostate-Verification.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
19,201
eb288e5efd267a87de7ef4eed81d684ff35d3c977b0a107b947ac6417edca7c3
// RUN: %exits-with 4 %run "%s" > "%t" // RUN: %diff "%s.expect" "%t" method Main() { var c, d := new A, new A; L(c, d); // error: 'c' is not old } twostate lemma L(c: A, new d: A) { var x := old(c.f); var y := old(d.f); // error: trying to use new 'd' in previous state } class A { var f: ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeAdjustments.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
15,559
e536a8a28b296b7581b1714bc5cc3efcc3231ac76de5b8510171ffcbc9ce126a
// RUN: %exits-with 4 %verify --relax-definite-assignment --type-system-refresh "%s" > "%t" // RUN: %diff "%s.expect" "%t" type Even = u | u % 2 == 0 method M0(n: nat, e: Even) { var x; // nat x := n; x := n; var y; // int y := e; y := n; var z; // int z := n + n; x, y, z := *, *...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeAntecedents.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,793
d252d4bbf27bbb60c8783b1ef0f4e7b65fd264278b6eec412eb22e07551232f7
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation --relax-definite-assignment // -------- This is an example of what was once logically (although not trigger-ly) unsound --- datatype Wrapper<T> = Wrap(T) datatype Unit = It datatype Color = Yellow | Blue ghost function F(a: ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeConstraints.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
11,639
87123075ae7d3113615d1c019c94ce2d76024f6d70cdfedbd5b45af6abcc101e
// RUN: %exits-with 2 %build --rprint:- --type-system-refresh=false --general-traits=legacy --general-newtypes=false "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Tests { class CC { var f: nat var g: int function F(): nat method M() { var a := f; // nat var b := g; // int var c := F(...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeConstraintsE.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
669
5a6ca854aedb789cc18d6163ea39a61200ea33949ed5111d384836a4451e835d
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" module Arrays_and_SubsetTypes { method M() { var b: array<int>; var n := new nat[100]; // array<nat> b := n; // A verification error } } module Arrays_and_SubsetTypesOK { method M() { // Type-wise, all of the following a...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeConstraintsRefresh.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
11,312
cb0147c7c7590afb34b6a78270183deabb34c76db5da6fe4505950a193997376
// RUN: %exits-with 2 %build --type-system-refresh "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Tests { class CC { var f: nat var g: int function F(): nat method M() { var a := f; // nat var b := g; // int var c := F(); // nat var w; // int (with legacy type system: nat) ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeConversions.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
9,596
f90cdc4126f82e7fd00c2027357152cf96e1b5da32df32e413937c7d1204db79
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --relax-definite-assignment --general-newtypes=false --rprint:- newtype EvenInt = x | x % 2 == 0 newtype SmallReal = r | -4.0 <= r < 300.0 // Use of the following predicate will prevent Boogie's cleverness of discarding assignments to dead variable...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeConversionsCompile.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,150
228d34bc0e1509a71c4e7f3c5faf665a9847bf256fe010b4e88a3a49bdfe914f
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --general-newtypes=false // Note the difference in output in Java's case is due to // https://github.com/dafny-lang/dafny/issues/4152 newtype Handful = x | 0 <= x < 0x8000 // this type turns native newtype Abundance = y...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeInferenceRefresh.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
25,585
c49b54988a602cbe50918742f44cc94528a9c643825b822a229a8b5659510a87
// RUN: %exits-with 4 %verify --type-system-refresh --relax-definite-assignment "%s" > "%t" // RUN: %diff "%s.expect" "%t" datatype Color = BlueX | WhiteX | PastelX { predicate IsFailure() { WhiteX? || BlueX? } function PropagateFailure(): int { 15 } function Extract(): real { if Blue...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeInferenceRefreshErrors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
8,662
da1ef4e38ae49b0a1074946bc95be274809b568d5ed91765071727cde8c76e4a
// RUN: %exits-with 2 %verify --type-system-refresh "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Frames { class C { var x: int var y: int } // The following was accepted by the old type checking, but it caused a crash in the // translator. Now, we disallow it. function ToC(): C fu...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeInferenceSubsetTypes.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,225
42d94d91bbd8d5400fef3357859731c2063d497771a61ee1f82aa773b82d0e1b
// RUN: %exits-with 4 %verify --type-system-refresh "%s" > "%t" // RUN: %diff "%s.expect" "%t" class Cell { var data: int constructor () { data := 4; } } method Main() { FromNew(); FromLocalVariable(); var c := new Cell(); FromParameter(c); WithNull(); FromMethodCall(); } met...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeInstantiations.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,178
d0a4e0e3f02bfbad2bb840cf0082098692530023826d73f80f56389ab36439db
// RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t" // RUN: %diff "%s.expect" "%t" abstract module M0 { type A type B = int type C(==) type D(==) type E(==) type F(==) type G type H<X,Y> type J<Z> type K0<W(==)> type K1<W(==)> type L...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeMembers.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
6,208
72193c7d57f45e58d63ab7b470be6789a9bff95f77442fb8410e9d110c42a610
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-warnings --relax-definite-assignment method Main() { BasicTests(); MoreTests(); } // ---------- basic tests ---------- method BasicTests() { var t := Yes; var r := t.W(); // 10 var q := t.Q() + DaTy.Q(); // 13 + 13 pri...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeParameters.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
8,395
d917d92bbae330a4c083cfa24e1c7318a55f7fb71ce1a4014e1484dc4a53cd36
// RUN: %exits-with 4 %verify --relax-definite-assignment --allow-axioms "%s" > "%t" // RUN: %diff "%s.expect" "%t" class C<U(==)> { method M<T>(x: T, u: U) returns (y: T) ensures x == y && u == u { y := x; } function F<X(==)>(x: X, u: U): bool { x == x && u == u } method Mai...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeSynonyms.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,894
0c76f9f159435a69ee50761930b3f2c3d11225e9080a06832ae0b9f468f145a7
// RUN: %exits-with 4 %verify --relax-definite-assignment "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Basic { type MyType<A> = int type Int = int type PairaBools = (bool, bool) datatype List<T> = Nil | Cons(T, List) type Synonym0<T,U> = List<T> type Synonym1<T> = List // type argu...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/TypeTests.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
9,166
62828d156819c3b15ce06e65f0587969b184ffd6fa8814b62f1d6688b1891a45
// RUN: %exits-with 2 %verify --allow-deprecation --type-system-refresh=false --general-newtypes=false "%s" > "%t" // RUN: %diff "%s.expect" "%t" module Tests { class C { ghost function F(c: C, d: D): bool { true } method M(x: int) returns (y: int, c: C) requires F(D.A, this); // 2 errors requir...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Unchanged.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,611
723bcde53ea63aca7da32f22cf81928c47828562c24a0cb7ad3f6cc9aa63961b
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" class C { var f: int var g: int method M(c: C, d: C, x: int) modifies this, c { c.f := c.f + x; assert x != 0 ==> !unchanged(c); assert x != 0 ==> !unchanged(c`f); assert d != c ==> unchanged(d); assert unchan...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/UnfoldingPerformance.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,209
c8f4f96768b67d2891888b8dfb0d9105314cf2a1b09fd06633c48eea527d67ac
// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" class C { var x: nat function IgnoreFuel(): nat reads this { x } } function Fib(n: int): int { if n < 2 then n else Fib(n-2) + Fib(n-1) } method Test0() { var c := new C; var f := Fib(c.IgnoreFuel()); // with the...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/UnicodeCharLiteralParseErrors.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
902
de252edbd8987c575883954e8143f0043901ae9ac8734a08835063ea3e553701
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" module UnicodeCharSupport { const goodUnicodeEscape := '\U{10FFFF}' const badTooLongUnicodeEscape := '\U{1234567}' // error: \U{X..X} escape sequence must have at most six hex digits const badOutOfRangeUnicodeEscape := '\U{110000}' // error: \U{X...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/UserSpecifiedTypeParameters.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,438
4a4378f6579585833016524f1169d83f412b56c918d3b3d908aee3e870ed3690
// RUN: %exits-with 2 %verify --type-system-refresh=false --general-newtypes=false "%s" > "%t" // RUN: %diff "%s.expect" "%t" module M0 { class MyClass<T(==),U(==)> { var s: map<T,set<U>> static ghost function F<W>(w: W, w': W, t: T, u: U): int { if w == w' then 5 else 7 } ghost f...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Variance.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
6,195
df6eaf065837b949ed9452c792a9b84fe233cd5e835ca79c014010300d4cdc5a
// RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s" -- --print:- module VarianceChecks { datatype MyData<+A, *B, !C, D, -E> = | MakeA(A) | MakeB(B) | MakeC(C) | MakeD(D) | MakeE(E) // error: E is used in positive position type Syn<X, -Y, Z> = MyData<X, Y, Z, Z, Z> // erro...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Wellfounded.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,757
9679948650c67203cb1a3748057eb72997a0c8f36da8faa5c32fdca5ca2c8004
// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-warnings method Main() { var d := Int(10); d := Set({d}); d := Seq([d,d,d]); d := Multiset(multiset{d,d}); d := Map0(map[d := 40]); d := Map1(map[15 := d]); d := IMap1(imap[15 := d]); var a1 ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/BDD.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,883
b50b565ed9c53ab74448f1568a1a6e8b7cd9655a155602e0ae28860dba0c9f40
// RUN: %testDafnyForEachResolver "%s" module SimpleBDD { class BDDNode { static ghost predicate bitfunc(f: map<seq<bool>, bool>, n: nat) { forall i:seq<bool> :: i in f <==> |i| == n } ghost var Contents: map<seq<bool>, bool> ghost var Repr: set<object> ghost var n: nat...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/BinaryTree.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
6,214
9f483eb0398527d25ab051e4169f18075bfeed31f927aab0e439a583a6a4e1fb
// RUN: %testDafnyForEachResolver "%s" class IntSet { ghost var Contents: set<int> ghost var Repr: set<object> var root: Node? ghost predicate Valid() reads this, Repr ensures Valid() ==> this in Repr { this in Repr && (root == null ==> Contents == {}) && (root != null =...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/Celebrity.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,228
0ab585a20576a39084878007a132ef24629b5a0c37e319160b264367663400a4
// RUN: %testDafnyForEachResolver "%s" // Celebrity example, inspired by the Rodin tutorial predicate Knows<X>(a: X, b: X) requires a != b // forbid asking about the reflexive case ghost predicate IsCelebrity<Y>(c: Y, people: set<Y>) { c in people && forall p :: p in people && p != c ==> Knows(p, ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/Cubes.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
508
a8a2d7c50628befb7ee5af987f3f9c9c6bcc7c9c88e3d41ae92b7f5866a7816c
// RUN: %testDafnyForEachResolver "%s" method Cubes(a: array<int>) modifies a ensures forall i :: 0 <= i < a.Length ==> a[i] == i*i*i { var n := 0; var c := 0; var k := 1; var m := 6; while n < a.Length invariant 0 <= n <= a.Length invariant forall i :: 0 <= i < n ==> a[i] == i*i*i ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/ExtensibleArray.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,706
65a3834bfb537ae2fab8bcbc175c070c5745a62467a984ea516d92ccad0b29f1
// RUN: %testDafnyForEachResolver "%s" class ExtensibleArray<T> { ghost var Contents: seq<T> ghost var Repr: set<object?> var elements: array?<T> var more: ExtensibleArray?<array?<T>> var length: int var M: int // shorthand for: if more == null then 0 else 256 * |more.Contents| ghost pre...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/ExtensibleArrayAuto.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,198
960f13e74e2c9945a250033e5bf3cf939bc9544599695eaf41b152f0a6b842b3
// RUN: %testDafnyForEachResolver "%s" class {:autocontracts} ExtensibleArray<T> { ghost var Contents: seq<T> var elements: array?<T> var more: ExtensibleArray?<array?<T>> var length: int var M: int // shorthand for: if more == null then 0 else 256 * |more.Contents| ghost predicate Valid() ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/FindZero.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,528
c5e87a3d4bbef023fd296c9d56a44e0b86c19a7ca479830d23d1fc140a17fbe7
// RUN: %testDafnyForEachResolver "%s" -- --allow-deprecation method FindZero(a: array<int>) returns (r: int) requires forall i :: 0 <= i < a.Length ==> 0 <= a[i]; requires forall i :: 0 <= i && i+1 < a.Length ==> a[i]-1 <= a[i+1]; ensures 0 <= r ==> r < a.Length && a[r] == 0; ensures r < 0 ==> forall ...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/Induction.legacy.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
7,465
aa0259a87e3ee0f3d22ecc861b3481e585f0818f2752562e0134db661b206d72
// RUN: %exits-with 4 %dafny /compile:0 /deprecation:0 /dprint:"%t.dprint" "%s" > "%t" // RUN: %diff "%s.expect" "%t" class IntegerInduction { // This class considers different ways of proving, for any natural n: // (SUM i in [0, n] :: i^3) == (SUM i in [0, n] :: i)^2 // In terms of Dafny functions, th...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/InductionOptions.legacy.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,277
75ecacadd00f09fbc7d7a07226a21bf7e0b3a6145768687d1100d74a7263c6db
// RUN: %exits-with 4 %dafny /compile:0 /induction:0 "%s" > "%t" // RUN: %exits-with 4 %baredafny verify %args --manual-lemma-induction "%s" >> "%t" // RUN: %exits-with 4 %dafny /compile:0 /induction:2 "%s" >> "%t" // RUN: %dafny /compile:0 /induction:3 "%s" >> "%t" // RUN: %exits-with 4 %dafny /compile:0 /inductio...
dafny-lang/dafny
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny1/KatzManna.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,928
589d2ed5730a843d6e725cf62bc1c62e89dfc134dae969c91adea30bff3bbf73
// RUN: %testDafnyForEachResolver "%s" method NinetyOne(x: int, ghost proveFunctionalPostcondition: bool) returns (z: int) ensures proveFunctionalPostcondition ==> z == if x > 101 then x-10 else 91 { var y1 := x; var y2 := 1; while (true) // the following two invariants are needed only to prove t...