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/hofs/WhileLoop.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,305 | 01283faedaec96b53b310d80a4f75568fb1beb7eee88358531398449a2a39fc0 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
class Ref<A(0)> {
var val: A
}
method Nice(n: int) returns (k: int) {
var f : int -> int := x => x;
var i := new Ref<int>;
i.val := 0;
while i.val < n
invariant forall u :: f.requires(u)
invariant... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/irondafny0/inheritreqs0.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 438 | 393f20899b985805fe18077d1323d4130cb388d335dc45e07d52d71c2de8dd32 | // RUN: %exits-with 4 %dafny /compile:3 /optimize /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
abstract module Spec {
method Greet(b: bool)
requires b
}
module Impl refines Spec {
method Greet(b: bool) {
print "o hai!\n";
}
method Xyzzy... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/irondafny0/inheritreqs1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 437 | 75fc2458bda7a1ea28585873c57e3fd58de7eb5744ebaebe05d7c99b8fdf3ac1 | // RUN: %exits-with 4 %dafny /compile:3 /optimize /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
abstract module Spec {
method Greet(b: bool)
requires b
}
module Impl refines Spec {
method Greet(b: bool) {
print "o hai!\n";
}
method Xyzzy... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/irondafny0/opened_workaround.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 334 | 0f7bbac20f25181cda73536228f1f960ff2dc7b0af28435b030c1e91b14a6cdb | // RUN: %exits-with 3 %build %s > "%t"
// RUN: %diff "%s.expect" "%t"
module A {
ghost predicate P() ensures false
class C
{
static ghost method {:axiom} M()
ensures P()
}
}
abstract module B {
import opened A
}
abstract module C {
import Bee : B ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/irondafny0/optimize0.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 279 | 9b93d46441618ca602d186d602f11828159cada5497c35c2bd3bbea1f3821325 | // NONUNIFORM: /optimize option not supported by the new CLI
// RUN: %dafny /compile:3 /optimize /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// See https://github.com/dafny-lang/dafny/issues/508
method Main() {
print "o hai!";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/lambdas/LambdaEq.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 504 | 27e878ea8e330f6c6f085ffe158438d1d319481894c7c0ce81152deccc9eaaa3 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
lemma Eq1(b: bool)
{
var f: nat -> int := (x: nat) => x;
var g: int -> int := (x: int) => x;
var h: int -> int := (x: int) => x;
assert g == h; // should pass
assert f == g; // should fail because f's and g's domains are different
}
le... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/lambdas/LitInt.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,053 | 2d3419d693b7e44fd81c20916ab33176d8ce03516ec6b74a823a12a630ac1da6 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s"
const N: nat
const M := 12
ghost function Fibonacci(n: int): int
{
if n < 2 then n
else Fibonacci(n - 2) + Fibonacci(n - 1)
}
ghost function Wrong(): bool
{
// The following assertion should fail.
// Specifically, the verifier should... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/lambdas/MatrixAssoc.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 10,345 | 684bbdd4c0120bb8900a24fe7e35405508b7f1d69f7ad908759806379d09f356 | // RUN: %verify --allow-axioms --type-system-refresh=false --general-newtypes=false "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
type Pos = x | 0 < x witness 1
/** Matrix dimension */
const N : Pos
/** Matrix indices */
type Index = x | 0 <= x < N // matrix indices
type Matrix = Index -> Index -> int
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/lambdas/StateMonad.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 10,764 | c3a77425ceb90f1ec91e284ed670a25d755d0eb799989d1fb0bf2ac5afaad502 | // RUN: %build "%s" --type-system-refresh=false --general-newtypes=false > "%t"
// RUN: %diff "%s.expect" "%t"
abstract module Monad {
type M<A>
function Return<A>(x: A): M<A>
function Bind<A,B>(m: M<A>, f:A -> M<B>): M<B>
// return x >>= f = f x
lemma LeftIdentity<A,B>(x : A, f : A -> M<B>)
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot1.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 311 | a0b99c66e9d16ec0c26d9c076b9c086dc5a6e135c5a937f84823b909d852a62b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Ref {
ghost var hogp: () ~> int
}
method Main()
ensures false
{
var r := new Ref;
// error: r.hogp calls itself without decreasing
r.hogp := () reads r, r.hogp.reads() => if r.hogp.requires() then 1 + r.hogp() else 0;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot10.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,561 | 48bf24ba04c3dd666a324514d1d6e846e9eb69f27790130a27698aa9362acd23 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
datatype Pack<T> = Pack(ghost c: T)
method M()
ensures false
{
var r := new Pack<() ~> bool>[1];
var tf := Pack(() reads r, r[0].c.reads =>
if r[0].c.requires() then !r[0].c() else false
);
// t... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot11.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 368 | 3b62ed60e7b5bfb47fdf0012e041294e71e6aea95519d207ba8e2185070999e3 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
datatype Pack<T> = Pack(ghost c: T)
class Ref {
ghost var hogp: Pack<() ~> int>
}
method Main()
ensures false
{
var r := new Ref;
// error: r.hogp calls itself without decreasing
r.hogp := Pack(() reads r, r.hogp.c.reads() => if r.h... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot12.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 542 | 8fb5f333f1c7ef4bb71c4280ba5ecb24888d6aa39942a78991c2a55ae6c8bca3 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
datatype Pack<T> = Pack(ghost c: T)
method M()
ensures false
{
var r := new array<Pack<() ~> bool>>[1];
r[0] := new Pack<() ~> bool>[1];
var p: Pack<() -> bool> := Pack(() => false); // see comments in Knot10.dfy
r[0][0] := p;
var tf... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot13.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 407 | 8c2990aeb041b182050bbce99a9624f87e6ada2b31b7327d26fd050dbb906e8b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Ref1 {
ghost var hogp: () ~> int
}
class Ref2 {
ghost var r: Ref1
constructor()
}
method Main()
ensures false
{
var r := new Ref2();
r.r := new Ref1;
// error: r.r.hogp calls itself without decreasing
r.r.hogp := () ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot14.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 369 | 0d22bc375301835012bcc13d53a5d014aefa2c6b76d48f2b05005a261a16e8d1 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Y {
const f: Y? -> nat
constructor(f: Y? -> nat)
ensures this.f == f
{
this.f := f;
}
}
method Main()
ensures false
{
// error: knot.f calls itself without decreasing
var knot := new Y((x: Y?) => if x == null then... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot15.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 431 | 90faa0a0a0ef28e7371eda0eeac2b70e84140b2878e1d366d23f14d551696d35 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Y {
const f: YWithConstraint -> nat
constructor(f: YWithConstraint -> nat)
ensures this.f == f
{
this.f := f;
}
}
type YWithConstraint = y: Y | true witness *
method Main()
ensures false
{
// error: knot.f calls i... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot16.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 398 | 2e4c25a0bcf6d0871bd2e7032ae1a4ac516d2c1914663cdf185cbe4f253c01fa | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
trait YT {
const f: Y -> nat
}
class Y extends YT {
constructor(f: YT -> nat)
ensures this.f == f
{
this.f := f;
}
}
method Main()
ensures false
{
// error: knot.f calls itself without decreasing
var knot := new Y((... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot17.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 399 | 99c510afd15d52c64c8cadad0de237bddd4b0cfa822fc67b8b18bc445e95af4b | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
trait YT {
const f: YT -> nat
}
class Y extends YT {
constructor(f: YT -> nat)
ensures this.f == f
{
this.f := f;
}
}
method Main()
ensures false
{
// error: knot.f calls itself without decreasing
var knot := new Y(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot18.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 753 | 475c148493b47f3ec388aab61c110f5eac5d37116adde117395252a745048fd4 | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Pack<T> = Pack(ghost c: T)
method R0(r: array<Pack<() ~> bool>>)
requires r.Length != 0
modifies r
{
// For a description, see method R0 in Knot10.dfy.
var p: Pack<() -> bool> := Pack(() reads {} => false);
r[0] := p;
}
metho... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot2.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 551 | b5719e44bebc78cc51d2b07e152970048ae75237127432680c7c2b22a3fc902d | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Ref {
ghost var hogp: () ~> int
}
method LogicKnot(r1: Ref,r2: Ref)
modifies r1, r2
ensures false
{
// error: r1.hogp and r2.hogp call each others without decreasing
r1.hogp := () reads r2, r2.hogp.reads() => if r2.hogp.requires(... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot3.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 610 | 707c28c8a263023fb5809c954985d251bf5530655fcec48601b5f6fd21eba8b3 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class C {
var f: () ~> bool
constructor()
ensures Invariant()
{
f := () requires true => true;
}
ghost predicate Invariant()
reads this, f.reads()
{
f.requires()
}
}
method update(t: C)
modifies t
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot4.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 488 | a5a90455d87d3e5314f256cd6e1f945e1ab0263caef88883f542f8c21a63c091 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Y {
const f: Y -> nat // Type error here? because since Y can be accessed, -> should be ~>
constructor(f: Y -> nat)
ensures this.f == f
{
this.f := f;
}
}
method Main()
ensures false
{
// error: knot.f calls itself w... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot5.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 401 | e525fab14faa2c2a85a5e249c8054a82aef6a70123f1f038b175ee2be82ad9e9 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
datatype Pack<T> = Pack(ghost c: T)
class Y {
const f: Pack<Y -> nat>
constructor(f: Pack<Y -> nat>)
ensures this.f == f
{
this.f := f;
}
}
method Main()
ensures false
{
// error: x.f.c calls itself without decreasing
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot6.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 892 | 1e5267cfa8a560017a75e8d15931020cfc0f868e18b9acdab6bd34e74fc8db83 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Ref {
ghost var hogp: () ~> int
}
method LogicKnot1(r1: Ref,r2: Ref)
modifies r1
ensures r1.hogp == (() reads r2, r2.hogp.reads() => if r2.hogp.requires() then 1 + r2.hogp() else 0)
{
// error: r1.hogp calls itself through r2.hogp w... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot7.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 381 | 0403949e7b0e53998fb72b4617289c47f332efef93fd576431a72c6acb677dd1 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Ref {
ghost var hogp: Ref ~> int
}
ghost function F(r: Ref): int
reads r, r.hogp.reads(r)
{
if r.hogp.requires(r) then 1 + r.hogp(r) else 0
}
method Main()
ensures false
{
var r := new Ref;
r.hogp := F;
// error: r.h... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot8.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 336 | e139095b25ba755ad13fb1046153ab206c6143e3c83d9bd083534c4fa9de2c33 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
class Ref<T> {
ghost var hogp: T
constructor()
}
method Main()
ensures false
{
var r := new Ref<() ~> int>();
// error: r.hogp calls itself without decreasing
r.hogp := () reads r, r.hogp.reads() => if r.hogp.requires() then 1 + r.h... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/Landin/Knot9.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 517 | 88e6735cbcf23102c8c16c4b2fb256ede5d81f87b813816d62a930f4de43c42e | // RUN: %testDafnyForEachResolver --expect-exit-code=2 "%s"
trait T<U> {
const f: U -> nat // Type error here? because since Y can be accessed, -> should be ~>
}
class Y extends T<Y> {
constructor(f: Y -> nat)
ensures this.f == f
{
this.f := f;
}
}
method Main()
ensures false
{
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/linters/constructorCaseWithoutParentheses.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,036 | 003dbce0d72abf3a74592ff9357c476e0c33adb6757638aa8ea0575903667b35 | // RUN: %exits-with 2 %verify --warn-missing-constructor-parentheses "%s" --allow-warnings > "%t"
// RUN: %diff "%s.expect" "%t"
/* These tests were originally designed to test --warn-missing-constructor-parentheses, which reported
* a warning when a nullary constructor in a match-case did not include parentheses... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/ByProofRefactoring.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 911 | 2957130a817c2bd9dd0ca94c46dcd8e66be971b275bb68b27dd658fffcfcc2b6 | // RUN: %baredafny verify --use-basename-for-filename --show-snippets false --show-hints --isolate-assertions --suggest-proof-refactoring --type-system-refresh "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
opaque predicate P() { true }
method M() requires P() { }
method N() ensures P() { reveal P(); }
method ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/CoverageReport.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,910 | aaf5347d9b9cc883017b2dec105cc4add80bd1c550152a769c47f40d0cf16f18 | // NONUNIFORM: Not a compiler test
// Verification coverage:
// RUN: rm -rf "%t"/coverage_verification
// RUN: %verify --allow-axioms --verify-included-files --no-timestamp-for-coverage-report --verification-coverage-report "%t/coverage_verification" %s
// RUN: %sed 's/<h1 hidden.*//' "%t"/coverage_verification/Pro... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/CSVLogger.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,290 | f4ce888c9bfeaba2370c65bf70a41ba91493ff981ba558f0453899293b961470 | // RUN: %exits-with 4 %baredafny verify --log-format:csv";"LogFileName="%t.csv" "%s" > %t
// RUN: %OutputCheck --file-to-check "%t.csv" "%s"
// CHECK: TestResult\.DisplayName,TestResult\.Outcome,TestResult\.Duration,TestResult\.ResourceCount
// The CHECK-NOT directives are a regression test: previously the BoogieX... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/FunctionHidingRefactoring.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,089 | a6590b51142ad8b5cccfca3e05dd16c6e15c284119022d1608dcf8ed0359fe49 | // RUN: %baredafny verify --use-basename-for-filename --show-snippets false --show-hints --isolate-assertions --suggest-proof-refactoring --type-system-refresh "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function Id(i: int): int { i }
function Square(i: int): int { Id(i) * Id(i) }
function Zero(i: int): int { ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/JsonLogger.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 547 | 7bfd6ef76f1c64f80c6300582349090883c8ed517bc14ea0337ccd5cfd784cc0 | // RUN: %exits-with 4 %baredafny verify --show-snippets:false --log-format:json --isolate-assertions "%s" > "%t"
// Also test old CLI
// RUN: %exits-with 4 %baredafny /compile:0 /verificationLogger:json /vcsSplitOnEveryAssert "%s" >> "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: vcNum.:1,.outcome.:.... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/MultipleLoggers.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 952 | 34cd432c6e288b12bdc4289de1e1beb863cae30472d682cdbd2cebea41ed6aef | // RUN: %exits-with 4 %baredafny verify --log-format:text --log-format:csv";"LogFileName="%t.csv" "%s" > "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: Overall outcome: Errors
// Check that the CSV file exists
// RUN: %diff "%t.csv" "%t.csv"
method ExampleWithSplits() returns (y: int)
ensures y... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/NoProofDependenciesOnError.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 298 | 1fed9a21a5af6bf00fae10463ed9f16502ba3a2213767b80693f930c23f88d78 | // RUN: %exits-with 4 %baredafny verify --log-format:text --boogie -trackVerificationCoverage "%s" > "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK-NOT: Proof dependencies:
// CHECK-NOT: Unused by proof:
lemma NotTrue(x: int)
requires x > 0
ensures x + 1 < 0
{}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/ProofDependencies.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 7,838 | ffcd05c4d9c5b76f9741fd18874b82ef40839e400d061027eacc49a1a8c7ed19 | // RUN: %diff "%s" "%s"
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/ProofDependencyLogging.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 11,261 | 6caa851b71c6bed1f743e40f29045fcbf2172669d310e83dd4675d9af4c0463f | // RUN: %baredafny verify --log-format:text --verify-included-files --allow-axioms --boogie -trackVerificationCoverage "%s" > "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: Results for M.RedundantAssumeMethod \(correctness\)
// CHECK: Proof dependencies:
// CHECK: ProofDependencies.dfy\(177... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/ProofDependencyWarnings.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 486 | 6645390c1eb937e8d0fca7c1da0bed41ece301897f18fe752477eab7e1050d2f | // RUN: %baredafny verify --use-basename-for-filename --allow-axioms --show-snippets false --verify-included-files --warn-contradictory-assumptions --warn-redundant-assumptions --allow-warnings "%s" > "%t.new"
// RUN: %diff "%s.expect" "%t.new"
// Also test old CLI
// RUN: %baredafny /compile:0 /useBaseNameForFileNa... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/ResCountXML.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 823 | fd8cea2775ca07e02cb1117bdb96b3974f8f7dd112a0c04c80ca105138c59767 | // RUN: %exits-with 4 %dafny /xml:%t.xml "%s"
// RUN: %OutputCheck --file-to-check "%t.xml" "%s"
// CHECK: resourceCount=\".*\"
method ExampleWithSplits() returns (y: int)
ensures y >= 0
{
var x: int;
x := 5;
y := 0;
while (x > 0)
invariant x + y == 5
invariant x*x <= 25
{
x := ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/TextLogger.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,397 | d77d59c6d2954c14549672fd6e3496c89f6e10031404e4ee8334c1bb94a8f946 | // RUN: %exits-with 4 %baredafny verify --show-snippets:false --log-format:text --isolate-assertions "%s" > "%t"
// RUN: %exits-with 4 %baredafny /compile:0 /verificationLogger:text /vcsSplitOnEveryAssert "%s" >> "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: Overall outcome: Errors
// CHECK: Overall... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/TextLoggerBatch.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 700 | 59b4cc8d2d0a879a539adf2fb6c15bb859da7a37e29d4dfd5fdfc111201b7195 | // RUN: %exits-with 4 %baredafny verify --show-snippets:false --log-format:text "%s" > "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: Overall outcome: Errors
// CHECK: Overall time: .*
// CHECK: Overall resource count: .*
// CHECK: Maximum assertion batch time: .*
// CHECK: Maximum assertion batch ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/TripleDescription.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 375 | f2d28b84b7405a74e79b5769bdb97a566cdbfecb701225d52a281fab3371b984 | // RUN: %exits-with 4 %baredafny verify --show-snippets:false --log-format:text "%s" > "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK: Outcome: Invalid
// CHECK: TripleDescription.dfy(.*,.*): this postcondition holds
method BadAbs(x: int) returns (r: int)
ensures r > 0
{
if(x < 0) {
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/VerboseName.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 718 | 9593d37dec73c070018218e7a87fad78fa4cd14fd20ba2fc54a3e71f7a54df77 | // RUN: %verify --progress Symbol --cores 1 "%s" > "%t"
// RUN: %OutputCheck --file-to-check "%t" "%s"
// CHECK-L:Verified 0/5 symbols. Waiting for smallPrime to verify.
// CHECK-L:Verified 2/5 symbols. Waiting for posIdMeth to verify.
// CHECK-L:Verified 4/5 symbols. Waiting for AM1.T2Client.Calc to verify.
newty... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/logger/VerificationLogger.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,172 | d2408575ac0af301b140e343a881bbeb9fa2389f4520919b9c09ab53887ee032 | // RUN: %exits-with 4 %baredafny measure-complexity --mutations=3 --random-seed=1 --log-format:trx";"LogFileName="%t.trx" "%s"
// RUN: %OutputCheck --file-to-check "%t.trx" "%s"
// CHECK: \<UnitTestResult.* testName="ExampleWithSplits \(correctness\) \(assertion batch 3\).*\>
// CHECK: \<UnitTestResult.* testName=... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/ConsistentWhenSupported.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 773 | dbf398b88a138e3e0e762e3b0965917d8533358ae1b6d219f1adb8c0d55c69c4 |
// Old way:
// RUN: %exits-with 0 %verify "%s" > "%t"
// RUN: %exits-with 0 %run --no-verify --target cs "%s" >> "%t"
// RUN: %exits-with 0 %run --no-verify --target js "%s" >> "%t"
// RUN: %exits-with 0 %run --no-verify --target go "%s" >> "%t"
// RUN: %exits-with 3 %run --no-verify --target java "%s" >> "%t"... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/EachResolverUniformSuccess.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 407 | c2079c51d8c05be59774c7af6de87b97d76eb116254a2e67a642a2a50e88e67c | // RUN: %testDafnyForEachResolver "%s"
// This little program type checks and verifies with both the legacy resolver and the refresh resolver.
// This is a Main method, but the compiler is not run as part of this test. Hence, the meta-test also tests
// that the compiler is not run.
method Main() {
var x: ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/InconsistentCompilerBehavior.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 503 | 9010ca962babd32cbfbb7c294b350a0fcb9752d24b33ee0df80672c7b1b05a2c | // Note we specify the set of compilers to test explicitly since we're looking at the actual output,
// and otherwise using DAFNY_INTEGRATION_TESTS_ONLY_COMPILERS breaks this test.
// RUN: ! %testDafnyForEachCompiler --refresh-exit-code=0 --compilers cs,java,go,js,cpp,dfy,py,rs "%s" > "%t"
// RUN: %diff "%s.testda... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/LegacyResolverFails.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 370 | 1d462ac0e4d5eef501dbcb175486e0f7feef280d0d5e11cbfa8c4bda185db400 | // RUN: %testDafnyForEachResolver --expect-exit-code=2 --refresh-exit-code=0 "%s" -- --relax-definite-assignment
const X := 1
method LegacyTypeSystemCannotInferTypes() {
var c; // error: type inferred to be int in refresh resolver, but fails in legacy resolver
match c
case X => // the literal 1
asse... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/OutputEncoding.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 450 | 95747a5ba8493307972da94b46b326c085392f7d5538adcb6515cef5ba8a092b | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s"
method Main() {
// This works fine in all languages because € is a single UTF-16 code unit.
print "Euro sign: " + [0x20AC as char], "\n"; // €
// Unfortunately, the following does *not* work in all languages: some of our
// compilers don't co... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/RefreshResolverFails.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 233 | f1473b81fd0c9a8091c5f0017939eeae3a65ab1cc73c03bffa54c4c11ed95392 | // RUN: %testDafnyForEachResolver --refresh-exit-code=2 "%s"
trait Trait { }
class Class extends Trait { }
method M(c: Class) {
var t: Trait := c;
var d: Class := t; // error: needs an "as Class" in refresh resolver
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/StdLibsOffByDefaultInTests.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 328 | 03a8bf0dd9c88f395de8243f6495b1810ce1b1ecf8f6c61cfdc6ca965bd313c1 |
// RUN: %exits-with 2 %verify --allow-axioms "%s" > "%t"
// RUN: %verify --standard-libraries:true --allow-axioms "%s" >> "%t"
// RUN: %diff "%s.expect" "%t"
module TriesToUseWrappers {
import opened Std.Wrappers
function SafeDiv(a: int, b: int): Option<int> {
if b == 0 then None else Some(a/b)
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/TestBeyondVerifierExpect.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 486 | 7093b89145e57e916a1db423f23285c528ca015cfb132deb213f006bf3c78f5a | // Note we specify the set of compilers to test explicitly since we're looking at the actual output,
// and otherwise using DAFNY_INTEGRATION_TESTS_ONLY_COMPILERS breaks this test.
// RUN: ! %testDafnyForEachCompiler --refresh-exit-code=0 --compilers cs,java,go,js,cpp,dfy,py,rs "%s" -- --allow-warnings > "%t"
// R... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/TestDoesNotVerify.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 239 | a73bbb28cb2ae5021a9f902f5aaad5a599a3012d529a659acb75f30245163b27 | // RUN: ! %testDafnyForEachCompiler --refresh-exit-code=0 "%s" > "%t"
// RUN: %diff "%s.testdafny.expect" "%t"
method Main() {
ghost var n := 15;
assert n < 12; // error: the verifier complains about this
print "hello\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/metatests/TestMissingVerifierExpect.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 241 | d3a050d90fd1d322717790a0cd7e3e99ee4f7b2b3e13d4dea03ade9e692d46c3 | // RUN: ! %testDafnyForEachCompiler --refresh-exit-code=0 "%s" > "%t"
// RUN: %diff "%s.testdafny.expect" "%t"
method Main() {
ghost var n := 15;
if j :| 0 <= j < n { // this gives a no-trigger warning
}
print "hello\n";
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/name with space/run.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 110 | c42c4b6fd35f49f6a149065ccf0deecac15b8ed5bf2d9b3de766086eaecdf64b | // RUN: %exits-with 0 %run "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method Main() {
print "hello";
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/newtype/aliases.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 244 | 57fa8c1fd3ff49deda57289334327be59d3a074f9e08272fe1abb0f5c619a0a7 | // RUN: %baredafny resolve --use-basename-for-filename %s > %t
// RUN: %diff "%s.expect" %t
newtype VerySpecificInt = x : SpecificIntAlias | x == 1 witness 1
type SpecificIntAlias = SpecificInt
newtype SpecificInt = x : int | 0 <= x <= 10 |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/abstractModuleAndMatchFlattening.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 322 | 35a7cb60257be19b6f6f93c3be819f262307a70e5f74aa7288b8712c12157963 | // RUN: %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
abstract module FooM {
method Foo(x: int) returns (r: int) modifies match x { case 0 => {} case _ => {} } ensures r == 3
}
abstract module Bla {
import Operations : FooM
method Foo(x: int) returns (r: int) {
r := Operations.Foo(3);
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/constructorInsteadOfTuple.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,071 | ff80cf8ddb0950db91f883442cbfe234f1d108098b6ca10eb5516241363325ad | // RUN: ! %resolve "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype Expr =
| Const(value: int)
| Var(name: string)
| Add(left: Expr, right: Expr)
| Mult(left: Expr, right: Expr)
function Optimize(expr: Expr): Expr
{
match expr
case Const(value) => Const(value)
case ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/nested.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 286 | f122d3eb95f7411d7bbd45174828855052115e7f07d979398da093aa947701e4 | // RUN: %exits-with 4 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
lemma test()
{
match 0
case 0 =>
forall i: nat ensures match true {}
}
datatype T = X
lemma Crash(e: T)
{
match e
case X =>
assert forall k :: match k == true case p => p;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/OrPatternErrors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 616 | ff857a104e532a068191ac198b83810e66cf72fdf65f8271ae1088fb08bf4426 | // RUN: %exits-with 2 %verify "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype T = A(int) | B(nat) | C(bool)
method Variables(t: T) {
match t
case A(n) // Error: Or-patterns may not bind variables
| B(n) => // Error: Or-patterns may not bind variables AND Error: duplicate name
case _ =>... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/OrPatterns.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 3,387 | df79b8f33081fc8ede09b984f2df37ca4d8f8dcb4921c5206b30ab2e623ba6c2 | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment
datatype Enum = One | Two | Three {
predicate Even() {
this.Two?
}
predicate Even'() {
match this
case One | Three => false
case Two => true
}
predicate Even''() {
match this
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/PatternMatching.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 5,167 | 8a9c632b72035477cc9cebc7ff6d7624e069124f1caf21c19577128f11af018a | // RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-warnings --relax-definite-assignment
/*
* This file contains a collection of tests for features modified or introduced in PR 458
*/
datatype Alt = A(int) | B(int)
datatype MyOption = Some(v: Alt) | None
datatype MyPair = Pair(x: Alt, y... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/patterns/PatternMatchingErrors.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 2,336 | 2233c918fc8ccdc12a0f363b09b7e1b5ab5f6e102f4460e323ab85182aadecb8 | // RUN: %exits-with 4 %verify --error-limit 0 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
/*
* This file demonstrates verification errors related to pattern matching
*/
// missing case in match expression : Nil
datatype List<T> = Nil | Cons(head: T, tail: List)
ghost function F(xs: List<int>): int {
m... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/printing/ModulePrint.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,063 | dca58a84274aa121fbf3d4e06fa323899bfd6dfe35849933066ce190ca5ba4c6 | // NONUNIFORM: Tests printing much more than compilation
// RUN: %resolve --print "%t.dfy" "%s" > "%t"
// RUN: %resolve --print-mode Serialization --print:"%t1.dfy" "%t.dfy" >> "%t"
// RUN: %run --print-mode Serialization --print:"%t2.dfy" "%t1.dfy" >> "%t"
// RUN: %resolve --print-mode NoGhostOrIncludes --print:"%... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/alternative-is-complete.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 221 | ca4cc215d829e381f7e348130afad5aad75414cacf3c4d105642ccf13a312519 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype D = D0 | D1
method F(d: D) returns (res: D) {
if {
case d == D0 => return D1;
}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/array-init-empty.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 171 | f19f372f6a94f0343b9bd604068005227a80d59cc7a332048af11520c1dd83ea | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method ArrayInitEmpty<T>() {
var a := new T[1];
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/array-init-size-valid.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 179 | 868924216cd86c88259700dbc1254025fa00eb6303258cd14aeee5ac44d2c40e | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method ArrayInitSizeValid() {
var a := new int[1] [];
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/assignment-shrinks.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 532 | db910ae5bcf951ed24a3807a434b595d80183d053f1d94ed0e390249246e48de | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
iterator Repeat(val: int, count: nat) yields (res: int)
yield ensures res == val
{
for i := 0 to count { yield val; }
}
class C {}
method Main() {
var repeat := new Repeat(0, 10);
var c ... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/bounded-below.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 341 | 148fd664bf03314d7ee309aabfe9f8dc3417547c7baaf52cca06a3a10b155550 | // RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --show-proof-obligation-expressions
method Termination(start: int, up: bool) {
for i := start downto *
invariant start - 768 < i
decreases i - start + 765 // error: not bounded below
{
if i == start - 768 {
return;... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/calc-step.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 986 | e5375ce04cdcc8b180a23445f9e413a981d49758680b02a95a4f34f51557be4b | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
ghost function f(x: int, y: int): int
lemma {:axiom} Associativity(x: int, y: int, z: int)
ensures f(x, f(y, z)) == f(f(x, y), z)
lemma {:axiom} Monotonicity(y: int, z: int)
requires y <= z
ensu... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/char-overflow-non-unicode.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 201 | d4783c165b8d097e2a5bd104e3c699172eaf17d2469dae489cb88e26a6f9144c | // RUN: %exits-with 4 %verify --unicode-char=false --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function CanOverflow(c0: char, c1: char): char {
c0 + c1
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/char-overflow-unicode.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 180 | 00543f44f40011bfbd50a031ddca0692c2fd6a45586fe9f8eb86dd9d254fe422 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function CanOverflow(c0: char, c1: char): char {
c0 + c1
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/char-underflow-non-unicode.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 202 | 58023b4523a479a3b2de0c71fdcecac345f3a50fb9f3ca3feffdd5785c5456eb | // RUN: %exits-with 4 %verify --unicode-char=false --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function CanUnderflow(c0: char, c1: char): char {
c0 - c1
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/char-underflow-unicode.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 181 | 4973306c84d4230c32892950d0f00f29931b8010fa3fc5e9b326f43c2e88fceb | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function CanUnderflow(c0: char, c1: char): char {
c0 - c1
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/comprehension-no-alias.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 237 | 9e74b02f9654d9d1fcfe93772b9ca3953991f4ccb985f8214218ebaa61733988 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function ComprehensionNoAlias(i: nat, j: nat): map<int, nat>
{
map x: nat, y: nat | x < i && y < j :: x + y := x
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/concurrent-frame-empty.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 330 | 50bdb06edc5dddd1cc2ff85395c780d7d7ca257f2ab708e3364175236b2dda72 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions --reads-clauses-on-methods "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C<T> {}
function {:concurrent} ReadsEmpty<T>(c: C<T>): bool
reads {c}
{
true
}
method {:concurrent} ModifiesEmpty<T>(c: C<T>)
reads {}
modifies {... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/conversion-fit.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 171 | 1084f2ae67b42ad8630f54f8fbeccecadcb108f83e54aa1065e94405670169b1 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function ConversionFit(i: int): bv8
{
i as bv8
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/conversion-is-natural.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 185 | c0152eb348264d6ca92942ff121628ec1bb681228d2f20c69ffe81a5fd2e7a78 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function ConversionIsNatural(ord: ORDINAL): int
{
ord as int
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/conversion-positive.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 184 | e9633f817cc91e3809a5f1511c61860ab98b6864e583bd1c13cb576a37bf173f | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function ConversionPositive(i: int): ORDINAL
{
i as ORDINAL
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/conversion-satisfies-constraints.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 235 | 793539510564a0e93d6953030f235246f674bb47a035cae72acdf866e241845c | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
newtype uint8 = x: int | 0 <= x < 0x100
function ConversionSatisfiesConstraints(i: int): uint8
{
i as uint8
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/definite-assignment.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,341 | 1f3690b24b557a1290b658324f153092ec015deb46aa43607d93c76618e6fdfc | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C<G>
{
var x: G
const y: G
constructor Con0(i: int, a: G, b: G)
{
if i > 0 {
x := a;
} else {
y := b;
}
new;
if i > 10 {
x := y;
}
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/destructor-valid.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 206 | 2a4fd6854be0026776db843935b23ad1f895b0fdc8484c89629187a21f8e70aa | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype D = D0(n: nat) | D1 | D2(b: bool, n: nat)
method F(d: D) {
var n := d.n;
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/distinct-lhs.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 681 | cb8ed3bbc3035a86b6ded77423193d992e75527e1413c3ef0df1d013d6621317 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method AssignArray(i: nat, j: nat, a: array<int>, x: int)
requires 0 <= i < a.Length
requires 0 <= j < a.Length
modifies a
{
a[i], a[j] := x, x + 1;
}
method AssignMultiArray(i0: nat... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/ensures-stronger.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 433 | d5613b18e69ab1306a4b227dc8d31853a2cb5d23776c87dcdba1abae1addb5ac | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
predicate P(i: int)
predicate Q(i: int)
trait T {
method M(b: bool)
returns (res: int)
ensures P(res)
ensures P(res + 1)
ensures b ==> Q(res)
}
class C extends T {
method M... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/for-range-assignable.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 179 | cb9dfcb94bc845a0cf314e805ab4cc8529ced0ebe4fca46205b2284d60291cb5 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method ForRangeAssignable()
{
for i: nat := -1 to 0 {}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/for-range-bounds-valid.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 174 | 68d9ad52ac276b1db737e4e5b774802effa229e5ca28d2ebafda13442bf2a997 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method ForRangeBoundsValid()
{
for _ := 1 to 0 {}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/forall-lhs-unique.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 614 | 6a3c3a8e73d342d9b00157ff65ad5820f3d961a97516173f50230c368c80143a | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method ForallLHSUniqueArray(a: array<int>)
modifies a
{
forall i | 0 <= i < a.Length {
a[0] := i;
}
}
method ForallLHSUniqueArray2(a: array2<int>)
modifies a
{
forall... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/forall-postcondition.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 185 | 98b18583ea1423cf63768b3ceae21c98d3fb5f98692082277f947fedca49b48a | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method ForallPostcondition()
{
forall b: bool ensures b {}
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/frame-dereference-non-null.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 212 | 61eab19a6955d35a3473c9c4a658fd2ef01e9830734240abc464c31251335d93 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C { var f: int }
function FrameDereferenceNonNull(c: C?): bool
reads c`f
{ true } |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/function-contract-override.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 379 | 4a30dd51757fabf805cdba8d5573e9835f3ec3fe8f469d4d228c0025e5e81f61 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
predicate P(x: int)
trait T {
function F(i: int): int
requires i < 10
ensures F(i) < 5
ensures P(F(i))
}
trait T' extends T {
function F(i': int): int
requires i' < 5
r... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/indices-in-domain.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 307 | 47b62f36fe0f5af92d67c9ec2545af471a3aaa5af78663f8c4e9e7054569291b | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method IndicesInDomain() {
var a1 := new int[1](i requires i > 0 => 1);
var a2 := new int[1, 1]((i, j) requires i > 0 && j < 0 => 1);
var s := seq(1, i requires i > 0 => 1);
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/is-allocated.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 221 | 2aeff516af7a3852b5847fe03572b6d78e16f4dec0fc7aed1b8c4b4b68d4482f | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C {
var f: int
}
method IsAllocated()
{
var c := new C;
var f := old(c.f);
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/is-integer.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 168 | 426084bb4c471ea48cb0b214bf0e675bc37d00918f140b912c38427a500c5acd | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function IsInteger(r: real): int
{
r as int
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/loop-invariant.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 247 | f01c161b5789d620a9f5377342bb2d4c32c4eeb55731647df8bc36b4f58a3a61 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
method LoopInvariant() {
var i := 10;
while 0 <= i
invariant 0 <= i <= 10
decreases i
{
i := i - 1;
}
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/match-is-complete.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 194 | 6c855cfd2b67e4aafb6389aca5d658fa480887b1862b2ce470ccf95fa153df9b | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype D = D0 | D1
function F(d: D): D {
match d
case D0 => D1
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/modifiable.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 1,326 | e6cb9210b6c602d78560448c402d14d42f9ef0f8018ebbefff652ecbb272c375 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C {
var x: int
var y: int
method ModifyClassField()
modifies this`y
{
x := 0;
}
}
class C2 {
var x: int
var y: int
}
method ModifyObject(s: seq<C>, t: seq<C2>)
... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/modify-frame-subset.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 709 | 7c7fdf47500e658ffe156f31df0602ee112aff46726b8da3d82d385054145514 | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
class C {
var x: int
var y: int
}
method ModifyStmt(s: seq<C>)
requires |s| > 5
modifies s[3]
modifies {s[4]}`x
modifies {s[5]}`y
{
modify s[0], {s[1]}`x, {s[2]}`y;
}
method Loo... |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/non-negative.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 175 | 33f549ffb56d583f91a5acb6d2418f97c80befc3064a2fb697b4146acdb2736a | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function NonNegative(): seq<int>
{
seq(-1, i => 0)
} |
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/non-null.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 175 | 725902e17d6796eae91d51802b8b17b863bc9e863789691d73cf48e33254f00c | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
function NonNull(a: array?<int>): int
{
a.Length
}
|
dafny-lang/dafny | Source/IntegrationTests/TestFiles/LitTests/LitTest/proof-obligation-desc/not-ghost-variant.dfy | NOASSERTION | 3,473 | master | 368adac6150e6a3825fe2f605dca71353badc779 | 2026-07-21T22:46:38Z | 386 | 57bdab3332afbf6de5db6100bf4f8e7cc2f3fbce6f3df1b573adbb3974599a7e | // RUN: %exits-with 4 %verify --show-proof-obligation-expressions "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype D = ghost G0 | ghost G1 | C0 | C1
method NotGhostVariantDiscriminator(d: D) returns (res: nat) {
res := 0;
if d.C0? {
res := 1;
}
}
method NotGhostVariantEquality(d: D) returns... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.