Dataset Viewer
Auto-converted to Parquet Duplicate
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
docs/HowToFAQ/ERROR_CloseParen.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
23
f03acd7238950aaeceb6276a14e7aaaf5059e5bb240c3cc546e8b0af276975a2
method test(int i) {}
dafny-lang/dafny
docs/HowToFAQ/ERROR_Covariance.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
706
9f72404b470dab6ad78ca1b385aab5bc70a5edfc135356470e43de38f5c9e373
type neg = r : real | r <= 0.0 datatype formula<T> = | Var(z: T) | Plus(x: formula<T>, y: formula<T>) | Minus(x: formula<T>, y: formula<T>) | Mult(x: formula<T>, y: formula<T>) | Divide(x: formula<T>, y: formula<T>) function method toReal(x: formula<real>) : real { match x case Var...
dafny-lang/dafny
docs/HowToFAQ/ERROR_InsufficientReads.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
365
2c13e671789a9ff9074376e10526f30efe0a95eaa69d2dc59ca627a57244fd36
class {:autocontracts} A { ghost predicate Valid() { true } constructor() { // no-op } } class {:autocontracts} B { var things: set<A> ghost predicate Valid() reads things { forall thing | thing in things :: thing.Valid() } const...
dafny-lang/dafny
docs/HowToFAQ/ERROR_InsufficientReads1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
336
59971dbdf231be618a068229471d73a5319b6f7aa18e665c5ef09152e6f717f1
class A { predicate Valid() reads this { true } constructor() { // no-op } } class B { var things: set<A> predicate Valid() reads this, things { forall thing | thing in things :: thing.Valid() } constructor() { things :=...
dafny-lang/dafny
docs/HowToFAQ/ERROR_ModifiesValue.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
62
2f4f2e5d4d5155065071b37201fbe034e35fb81cc3d01b0fd37ba36638c8a607
class A {} method test(m: map<int,A>) modifies m; { }
dafny-lang/dafny
docs/HowToFAQ/ERROR_ModifiesValue1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
69
456212771aa01a64558380299ab97a93d179e1039c943bd3f42a17af63292b89
class A {} method test(m: map<int,A>) modifies m.Values; { }
dafny-lang/dafny
docs/HowToFAQ/ERROR_MutableField.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
335
f7364afbc69e0a1b8ac9396df5ea6fc8522bf60646b3e7503648c4e03093ce59
module M { export provides A, A.foo, // want to export foo, which refers to x A.x // to make export set self-consistent, need to export x class A { var x: int function method foo(): int reads this { x ...
dafny-lang/dafny
docs/HowToFAQ/ERROR_MutableField1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
352
75f45bffaff17d4e862c86da3e48e568e2dd5dedb2f3ce1960a36b4d9e88116c
module M { export reveals A provides A.foo, // want to export foo, which refers to x A.x // to make export set self-consistent, need to export x class A { var x: int function method foo(): int reads this { ...
dafny-lang/dafny
docs/HowToFAQ/ERROR_NoLHS.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
91
a84f582e9a069102aa3ae1bf67f1d601a24417c1db3a84c6dba5be70e89c310b
method PickKey<K, V>(m: map<K, V>) returns (ret: K) { var k :| k in m; return k; }
dafny-lang/dafny
docs/HowToFAQ/ERROR_NoLHS1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
118
f1a0c31a46782b0384b951ecaeca736813fd34784702882d5f48f7c0c3699644
method PickKey<K, V>(m: map<K, V>) returns (ret: K) requires |m.Keys| > 0 { var k :| k in m; return k; }
dafny-lang/dafny
docs/HowToFAQ/ERROR_PostconditionLemma.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
59
ee30502ac6ab759ed2d9bbff689b6bfb58db0c1d1a2bc02c5fd02c52bdf003ec
lemma L() {} method test() ensures L(); true { }
dafny-lang/dafny
docs/HowToFAQ/ERROR_Rbrace1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
36
3e7e934a89c6067a0cebfa9459ad010bd59f6a144635feb633c6fc72cb659e3d
module A { const x: int= 4; }
dafny-lang/dafny
docs/HowToFAQ/ERROR_Rbrace2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
33
462c72cd250c861aab259328e3f398700463ba22123e471ef84ffaeb75d9937f
class A { var x: int = 5; }
dafny-lang/dafny
docs/HowToFAQ/ERROR_Rbrace3.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
33
77905795d69fa2c50e3fede3ad53934656a12362d1b1baf787541f0888588aae
class B { var x: int := 5 }
dafny-lang/dafny
docs/HowToFAQ/ERROR_Rbrace4.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
49
72846e38e7017efbc61ded462e585ad7be08205f3b7e32de8c781ed448b43f72
module A { method m() {} mthod n() {} }
dafny-lang/dafny
docs/HowToFAQ/ERROR_SeqComp.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
109
8917cbfa64e011c019c563c89c8dac90d3eb1d2969af077b98eb92807db69899
function f(i: int): int requires i < 10 { i } method test() { var s := seq(5, i => f(i)); }
dafny-lang/dafny
docs/HowToFAQ/ERROR_SeqComp1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
125
641d127b773eb1dd06374ab0ee4fffae142748aa25180441e34c4bc15ddda5c3
function f(i: int): int requires i < 10 { i } method test() { var s := seq(5, i requires i < 10 => f(i)); }
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionByMethodProof1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
334
769f65395ca843e388cb9f4f9d4e8f28a37efc2b15725d9ad8d77fb7795a6290
function Sum(s: seq<int>): (result: int) { if |s| == 0 then 0 else s[0] + Sum(s[1..]) } by method { result := 0; for i := 0 to |s| invariant result == Sum(s[0..i]) // ^^^^^^^^^^^^^^^^^^^^^^ // Cannot be proved { result := result + s[i]; } assert s[0....
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionByMethodProof2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
799
7f05674d8a48804c191efee71408e0a2e51a0648d401ab1d77890b0cf16db895
function Sum(s: seq<int>): (result: int) { if |s| == 0 then 0 else s[0] + Sum(s[1..]) } by method { result := 0; for i := 0 to |s| invariant result + Sum(s[i..]) == Sum(s) // New invariant { result := result + s[i]; } } // No hint needed at the end lemma IntermediateProperty(r...
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionByMethodProof3.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
423
5b8644ab58e60fe4dc88e62b7bb95dfb578142081bf48018079cf965365764c7
function Sum(s: seq<int>): (result: int) { if |s| == 0 then 0 else Sum(s[0..|s|-1]) + s[|s| - 1] // We add the last element to the sum of the first } by method { result := 0; for i := 0 to |s| invariant result == Sum(s[0..i]) { assert s[0..i+1][0..i] == s[0..i]; // Minimum...
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionByMethodProof4.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
386
9af224cb9a3dc98976ddbf7109f13a53741bb9706525d1244fc92f6ba21b0ecc
function Sum(s: seq<int>): (result: int) { if |s| == 0 then 0 else s[0] + Sum(s[1..]) } by method { result := 0; for i := |s| downto 0 // Reverse. First i == |s| - 1 invariant result == Sum(s[i..]) // The invariant looks like the function { result := s[i] + result; // Note h...
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionUnroll0.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
463
879dbdf3a4fb2ccf6fdcd7653da1989fb30ac65b5b0a71d7c0d6085b68766003
function Sum(s: seq<nat>): nat { if |s| == 0 then 0 else s[0] + Sum(s[1..]) } lemma Sum1(s: seq<nat>) requires |s| == 1 ensures Sum(s) == s[0] { // trivial } lemma Sum2(s: seq<nat>) requires |s| == 2 ensures Sum(s) == s[0] + s[1] { // Doesn't work. I need... // Sum1(s[1..]); } ...
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionUnroll1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
474
fb1fcea8dd1fe7e263db63f6d42f326759b25a376dedae5042ae796b6dcb11b4
function {:fuel 10} Sum(s: seq<nat>): nat { if |s| == 0 then 0 else s[0] + Sum(s[1..]) } lemma Sum1(s: seq<nat>) requires |s| == 1 ensures Sum(s) == s[0] { // trivial } lemma Sum2(s: seq<nat>) requires |s| == 2 ensures Sum(s) == s[0] + s[1] { // Doesn't work. I need... // Sum1(s[1....
dafny-lang/dafny
docs/HowToFAQ/FAQFunctionUnroll2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
678
44301badf9286dafa0b0a43faa1ce1c0d0be7f2026d1df3f6a0590664739c92e
function Sum(s: seq<nat>): nat { if |s| == 0 then 0 else s[0] + Sum(s[1..]) } function Sum_(s: seq<nat>, n: nat): nat ensures Sum(s) == Sum_(s,n) ensures |s| > 0 && n > 0 ==> Sum_(s,n) == s[0] + Sum_(s[1..], n-1) { if |s| == 0 || n == 0 then Sum(s) else s[0] + Sum_(s[1..], n-1) } lemma Sum1(s...
dafny-lang/dafny
docs/HowToFAQ/FAQModuleImport.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
144
124c509d2710aa2b36d0d96a553d97f19af8e6c866501b471a360612f71c3166
module A { type D = string } module Y { import opened A module X { type X = D } module Z { type Z = D } }
dafny-lang/dafny
docs/HowToFAQ/FAQModuleImport1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
167
5af4afb66e05e8c6bc90b3136b5cafa0917305a9fae79159acae6b681c2369fd
module A { type D = string } module Y { module X { import opened A type X = D } module Z { import opened A type Z = D } }
dafny-lang/dafny
docs/HowToFAQ/FAQModuleNames.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
207
127c0d3fee9ef467aeef3ac0e36365c0ee4f47be72a27c863b5ef91e1c613a72
module util { const x: nat := 0 } module util_ { import util } module java { module util { import util_ const y: nat := util_.util.x method test() { assert y == 0; } } }
dafny-lang/dafny
docs/HowToFAQ/FAQModuleNames0.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
147
de2314f21e7ab7456f74c6089400ab8ec0b61790051fbf525d28f3bcdd8d1acc
module util { const x: nat := 0 } module java { module util { const y: nat := util.x method test() { assert y == 0; } } }
dafny-lang/dafny
docs/HowToFAQ/FAQNameConflict.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
183
dc3ca9a8229bc8b61f0dfbbca54937e0dbe25aed6ea20849e7af48037fff1976
module Result { datatype Result<T> = Success(x: T) | Failure(e: string) } module Test { import opened Result function method f(): Result<int> { Success(0) } }
dafny-lang/dafny
docs/HowToFAQ/FAQNameConflict1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
299
6a9d14d49da8b5f08ccf538158d9b4231aa1fa890a2a11c6f7c293e655f45961
module Result { datatype Result<T> = Success(x: T) | Failure(e: string) } module Test { import opened Result function method f(): Result.Result<int> { Success(0) } } module Test1 { import opened R = Result function method f(): Result<int> { Success(0) } }
dafny-lang/dafny
docs/HowToFAQ/FAQNestedModule.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
82
f60ca5e3b0ef03de45fea11c9ed774fd968ce6d9818e0bdbd0c68fb7747a7fbf
module A { const SIZE := 10 module B { const MYSIZE := SIZE } }
dafny-lang/dafny
docs/HowToFAQ/FAQNewtype.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
406
9914357025295c10ed4f5007a7bf68a5ccb236f7fc931a2ab9bc638001c8eeac
type int8 = x: int | -256 <= x < 256 newtype nint8 = x : int | -256 <= x < 256 method test(i: int, i8: int8, ni8: nint8) { var j: int, j8: int8, nj8: nint8; if -256 <= i < 256 { j8 := i; } // implicit conversion OK if in range if -256 <= i < 256 { nj8 := i as nint8; } // explicit conversion required j :...
dafny-lang/dafny
docs/HowToFAQ/FAQPreconditionLabels.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
412
6923d7e8bda0cd61a4fdc25419349e288cce855aa647b4d613d9326c21c0a8aa
method M0(x: int) requires x == 0 { assert x < 10; // verifies } method M1(x: int) requires Zero: x == 0 { // the following assertion does not verify, because labeled // preconditions are hidden assert x < 10; // error } method M2(x: int) requires Zero: x == 0 { // by revealing the hi...
dafny-lang/dafny
docs/HowToFAQ/FAQReadsClause.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
103
4015164f73492504c8737cd46b31b1110b56acc0a551bc3c56524797afd1be39
// dafny Example.dfy class A { var x: string } type AA = a: A | a.x == "" witness * reads a
dafny-lang/dafny
docs/HowToFAQ/FAQTypeCompare.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
213
e645db2b7e3421733150da80bf8c52f4b40e855e3c5eed102cc0f23481ffd1cf
abstract module Mixin1 { type T = int } abstract module Mixin2 { type T = int } abstract module Mixins1and2 { import M1 : Mixin1 import M2 : Mixin2 lemma typeConstraint() ensures M1.T == M2.T }
dafny-lang/dafny
docs/HowToFAQ/text1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
59
d2b742ee4febabe1218e2379da00cb74a1c1b024f44c37da577e4337f9bcbfc0
module M{ method {:test} m() {} method Main() {} }
dafny-lang/dafny
docs/HowToFAQ/text2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
150
9553f27983842b2836cc8e83825d5573ab7c9be6da372ae6d563debf1947fb13
datatype D = A | B | ghost C method m(d: D) returns (r: bool) { r := match d { case A =>true case B =>true case C =>true }; }
dafny-lang/dafny
docs/HowToFAQ/text3.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
71
6b5d3c4f3ae723bb369743e4b965791c26d83a5578834f1df739762b457c5c30
class A { static const f: int } method m(a: A) { var i := A.f; }
dafny-lang/dafny
docs/HowToFAQ/text4.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
55
44836fa621a09adc080e7fa3e848aaf4cfe1eb4f4b05ef292748e64a517c93e0
function f(i: int, j: int): int const c := f(2,3,4)
dafny-lang/dafny
docs/HowToFAQ/text5.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
37
80c56a027328d80a4700527c7460d424887f5f41147b19f15cf79e28b96df006
const z := 1 as bv4 | 1 as bv2 << 2
dafny-lang/dafny
docs/HowToFAQ/text6.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
115
22a07283843f09ef81c5ca24f67a0c9a37219ffef2e2eba534ef7689374beb96
datatype Record = Record(x: int, ghost y: int) method m(r: Record) returns (rr: Record) { rr := r.(y:=43); }
dafny-lang/dafny
docs/images/DutchFlag.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,028
7110a98ff5959ec428166e4d2db2c6143ee48f7d37718093a5d34b085f79ffc2
method Main() { var a := new Color[3]; a[0] := White; a[1] := Blue; a[2] := Red; assert a[..] == [White, Blue, Red]; DutchFlag(a); assert Ordered(a[0], a[1]); assert Ordered(a[1], a[2]); assert a[..] == [Red, White, Blue]; } datatype Color = Red | White | Blue predicate Ordered(c: Col...
dafny-lang/dafny
docs/HowToFAQ/testfiles/a.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
0
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
dafny-lang/dafny
docs/HowToFAQ/testsource/test1.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
42
8bcece96648576a584a5d959ed75a3f3d9b2c01716caeb16bd5ec3e1fc066742
method m(i: int) { assert i := -1; }
dafny-lang/dafny
docs/HowToFAQ/testsource/test2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
30
8006c672ba771c3b99f3cecc8560cc3ad088bb1cd6094deca0db459194f31dd5
const c := 6 const d := 7
dafny-lang/dafny
docs/HowToFAQ/testsource/TestA.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
44
fa5f8da013d19dcb521213610ae81601e8da9f838c9107699870c05074c67c66
// Intentional error const k: int := true
dafny-lang/dafny
Source/AutoExtern/CSharpModel.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,645
c05d8414b4be938d569e1120254774a0632ebe8e758311cefbcf5470ed6cf7ec
module {:compile false} {:extern "System"} System { trait {:compile false} {:termination false} {:extern} IComparable {} trait {:compile false} {:termination false} {:extern} Attribute {} newtype {:compile false} {:extern} {:nativeType "int"} int32 = x: int | -0x8000_0000 <= x < 0x8000_0000 class {...
dafny-lang/dafny
Source/DafnyPipeline.Test/testFile2.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
36
1f9cd4016aa83d5e0e1c1f569375eb4e3b6f1ac0d742e49d81e4faf4b1b5a50c
method f(x: int) { var x := 0; }
dafny-lang/dafny
Source/DafnyRuntime/systemModulePopulator.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,506
3db38efa4eb020db9cd1124b793071ae83fd56f7eb42852773726a32c44ea32c
method HasTuples() { var b := true; var has0 := (); var has1 := (b, ghost b); // Just (b) is a bool in parentheses instead var has2 := (b,b); var has3 := (b,b,b); var has4 := (b,b,b,b); var has5 := (b,b,b,b,b); var has6 := (b,b,b,b,b,b); var has7 := (b,b,b,b,b,b,b); var has8 := (b,b,b,b...
dafny-lang/dafny
Source/AutoExtern.Test/Tutorial/ClientApp/GroceryListPrinter.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,634
12612247db7225a621025f97568e835679321c10442952ec40d30fa1b7f75905
/// # C#/Dafny interop: Dafny side /// /// See README.md for details. This file receives a C# value and prints it. /// We start by including the model generated by AutoExtern (this file does not /// exist in the repository; it must be created by running ``make``). include "LibraryModel.dfy" /// Then we def...
dafny-lang/dafny
Source/DafnyCore/AST/DafnyInterface.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,968
d5f12ba9d7a5dfd59360c5dde1032d62e150661d2b388f079f1df3246a0f0283
include "System.dfy" // Interface with existing Dafny code (IOrigin) @Compile(false) @Options("-functionSyntax:4") module {:extern "Microsoft.Dafny"} MicrosoftDafny { import opened System @Compile(false) trait {:extern "Token"} Token extends object { var val: CsString var LeadingTrivia: CsStr...
dafny-lang/dafny
Source/DafnyCore/AST/Formatting.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
3,165
792e7e19733566fbbbc077fc1e4bf30efd5d00b53ce5617087583f705ec0edd9
/// To compile this program, execute Source/DafnyCore/DafnyGeneratedFromDafny.sh manually for now /// Microsoft.Dafny.Formatting.ReindentProgramFromFirstToken() takes /// - A first token, from which an entire program is available /// - A IIndentationFormatter, that knows how to indent every token /// It then prin...
dafny-lang/dafny
Source/DafnyCore/AST/System.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,470
5d15dbe42496c40532907a10f6b05cda407b08126854934ba0b854ae4dfc5fb1
// Interface with the System namespace @Options("-functionSyntax:4") @Compile(false) module {:extern "System"} System { @Compile(false) class {:extern "Text.StringBuilder"} CsStringBuilder { ghost var built: CsString constructor {:extern} () @Axiom method {:extern "Append"} Append(s: CsSt...
dafny-lang/dafny
Source/DafnyCore/Prelude/Boxes.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
2,755
0e8ae8a5e854ec78c66b753bc8344fe2c882a96df060873c0bfa84c88a5242f4
module Boxes { export provides Box, arbitrary provides Below, Reflexive, Antisymmetric, Transitive, Total reveals Less provides LessIrreflexive, LessAsymmetric, LessBelowAsymmetric, LessTransitive, LessBelowTransitive, Connected provides BelowIsNonStrictLess, NotLess type Box(==,0,!new)...
dafny-lang/dafny
Source/DafnyCore/Prelude/Lists.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
4,677
d13ecdc2f91caf63a5a8d1564ed93e1b4cea61cb8ec02300fe2dd32aee215562
module Lists { export reveals List, List.Length, List.At, List.Contains, List.Append, List.Take, List.Drop, List.Split provides List.HeadTailAt, List.ContainsAt, List.AtContains, List.LengthAppend, List.AppendAt, List.AboutDrop provides List.AppendTake, List.TakeFromAppend, List.AppendDrop, List.DropF...
dafny-lang/dafny
Source/DafnyCore/Prelude/Math.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
1,537
f3ebb0426658296e73cf7672067ad49daa03d470bb575bcae6631108c6bcab7a
module {:extract_boogie} Math { export provides Min, Clip provides Min0, Min1, MinEither provides ClipId, ClipZero // boogie: // function Math#min(a: int, b: int): int; function {:extract_boogie_name "Math#min"} Min(a: int, b: int): int { if a <= b then a else b } // boogie: ...
dafny-lang/dafny
Source/DafnyCore/Prelude/Multisets.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
55,697
c9f6be0bbb52e1156a30c38a44ef66f7a2d27e5683cd4b6853704a9fbb2152e2
module {:extract_boogie} Multisets { import opened Boxes import opened Lists import Math import Sets`Friends import Sequences`Friends // type MultiSet = [Box]int; // The manually authored Boogie type "MultiSet" is defined as a Boogie map from Box to int. // The reason for doing so was to obtai...
dafny-lang/dafny
Source/DafnyCore/Prelude/Sequences.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
27,667
bed17bed35f9b1a2f1f28b3d92de9e33cb724e168fb754f05fde65b145fb164b
module {:extract_boogie} Sequences { export provides Boxes provides Seq, Length, AboutLength provides Empty, LengthEmpty0, LengthEmpty1 provides Index, Append, IndexAppend provides Build, BuildInv0, BuildInv1, BuildInjective, LengthBuild provides Update, IndexUpdate, LengthUpdate p...
dafny-lang/dafny
Source/DafnyCore/Prelude/Sets.dfy
NOASSERTION
3,473
master
368adac6150e6a3825fe2f605dca71353badc779
2026-07-21T22:46:38Z
30,052
11b4e087595b0e418757ddfb7967a3b706849e072a31a6ad932bdebcc80405df
module {:extract_boogie} Sets { import opened Boxes import opened Lists export provides Set, IsMember provides Card, AboutCard provides Empty, EmptyHasNoMembers, CardVsEmpty provides UnionOne, UnionOneAddsElement, UnionOneAddsSelf, UnionOneMaintainsMembership, UnionOneCardIdempotent, Card...
End of preview. Expand in Data Studio

Dafny GitHub Dataset

A corpus of publicly available Dafny (.dfy) source code crawled from GitHub, packaged as JSONL for model training and analysis. Dafny is a verification-aware programming language with built-in specification constructs (pre/postconditions, invariants, assert/assume) checked by an SMT solver.

  • 106,404 unique-by-content .dfy files
  • 966 source repositories (of 1,018 discovered; forks excluded)
  • 753 MB of source (stored as ~44 MB of zstd Parquet), median 5 files per repo
  • Crawled 2026-07-22

Dataset structure

One JSON object per line:

field type description
repo string owner/name of the source repository
path string file path within the repo
license string SPDX id of the repo's license, or null
stars int repo stargazer count at crawl time
default_branch string branch the file was taken from
commit_sha string commit / tree sha the file was read from
pushed_at string repo last-push timestamp (ISO 8601)
size_bytes int file size in bytes
sha256 string SHA-256 of the file content (deduplication key)
content string full UTF-8 source of the .dfy file
from datasets import load_dataset
ds = load_dataset("hath995/DafnyGithub-Dataset", split="train")
print(ds[0]["repo"], ds[0]["path"])
print(ds[0]["content"])

How it was built

  1. Discovery — union of two GitHub channels: repo search language:Dafny (747 repos) and code search extension:dfy sliced by file size to beat the 1,000-result cap (surfacing .dfy files in otherwise non-Dafny repos). Forks are excluded (GitHub search excludes them by default).
  2. Extraction — each repo shallow-cloned with a blobless partial + sparse checkout of *.dfy only (so a 2 GB repo pulls just its Dafny files). Repos that fail to check out on Windows (invalid paths, sparse-checkout edge cases) were recovered via the GitHub trees + raw-blob API.
  3. Deduplication — files are deduplicated by exact content (sha256); ~117k exact duplicates were dropped during the crawl. Near-duplicates are not collapsed.

Considerations for using the data

Licensing

All files are included regardless of license; the license field records each repo's SPDX id so you can filter per your needs. A null or NOASSERTION value does not grant redistribution or training rights — filter accordingly before releasing or training.

Files by license: null/NONE 47,205 · NOASSERTION 33,730 · MIT 20,552 · Apache-2.0 3,880 · GPL-3.0 725 · BSD-2-Clause 94 · AGPL-3.0 73 · GPL-2.0 61 · BSD-3-Clause 33 · CC0-1.0 22 · BSL-1.0 12 · Unlicense 11 · CC-BY-4.0 4 · ISC 2. (NOASSERTION = a LICENSE file GitHub could not map to an SPDX id.)

Synthetic / benchmark corpora dominate the tail

A handful of repos are auto-generated verification benchmarks or LLM / mutation study data. They account for a large share of files, and because each differs by only a token or two, exact-content dedup does not collapse them:

repo files nature
VeriFixer/DSpec2Test 26,875 generated spec→test benchmark
ValentinaWu1112/…LLM-APR 11,119 LLM program-repair attempts
VeriFixer/DafnyFaultLoc 7,878 fault-localization benchmark
Beneficial-AI-Foundation/vericoding-benchmark 6,169 vericoding benchmark
MutDafny/mutdafny-study-data 4,652 mutation-testing variants (partial: GitHub truncated the tree)

For human-authored Dafny, filter these out:

DROP = {
    "VeriFixer/DSpec2Test", "VeriFixer/DafnyFaultLoc",
    "ValentinaWu1112/Automated-Program-Repair-of-Arithmetic-Programs-in-Dafny-using-Large-Language-Models",
    "Beneficial-AI-Foundation/vericoding-benchmark", "MutDafny/mutdafny-study-data",
}
ds_human = ds.filter(lambda r: r["repo"] not in DROP)

Limitations

  • Snapshot of default branches at crawl time; no history, branches, or PRs.
  • mutdafny-study-data is partial (GitHub truncated its recursive tree).
  • Files larger than 2 MB were skipped.
  • Coverage reflects GitHub's code-search index, which does not include every repo exhaustively.

Provenance

Reproducible via the crawler scripts (discover_repos.py, fetch_files.py, retry_api.py). Content belongs to the original repository authors under their respective licenses.

Downloads last month
54