Datasets:
Download sources/program_0029.dfy from neurips2026-crychic/crychic-dafny-acsl: direct link, hf CLI and curl.
- Browser
- Download file 311 Bytes
-
https://huggingface.co/datasets/neurips2026-crychic/crychic-dafny-acsl/resolve/main/sources/program_0029.dfy
- Command line
-
hf download hf://datasets/neurips2026-crychic/crychic-dafny-acsl/sources/program_0029.dfy
-
curl -L -o program_0029.dfy https://huggingface.co/datasets/neurips2026-crychic/crychic-dafny-acsl/resolve/main/sources/program_0029.dfy
311 Bytes
| method SwapFirstAndLast(a: array<int>) | |
| requires a.Length > 0 | |
| modifies a | |
| ensures a[0] == old(a[a.Length - 1]) | |
| ensures a[a.Length - 1] == old(a[0]) | |
| ensures forall k :: 1 <= k < a.Length - 1 ==> a[k] == old(a[k]) | |
| { | |
| var tmp := a[0]; | |
| a[0] := a[a.Length - 1]; | |
| a[a.Length - 1] := tmp; | |
| } |