Skip to content

michelou/dafny-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playing with Dafny on Windows

Dafny project This repository gathers Dafny code examples coming from various websites.
It also includes several build scripts (bash scripts, batch files, Make scripts) for experimenting with Dafny on a Windows machine.

Ada, Akka, C++, COBOL, Dart, Deno, Docker, Flix, Golang, GraalVM, Haskell, Kafka, Kotlin, LLVM, Modula-2, Node.js, Rust, Scala 3, Spark, Spring, TruffleSqueak, WiX Toolset and Zig are other topics we are continuously monitoring.

Project dependencies

Optionally one may also install the following software:

Installation policy
When possible we install software from a Zip archive rather than via a Windows installer. In our case we defined C:\opt\ as the installation directory for optional software tools (in reference to the /opt/ directory on Unix).

For instance our development environment looks as follows (December 2024) 1:

C:\opt\ConEmu\                        ( 26 MB)
C:\opt\Git\                           (393 MB)
C:\opt\dafny\                         (133 MB)
C:\opt\VSCode\                        (381 MB)
C:\Program Files\dotnet\sdk\6.0.428\  (329 MB)

🔎 Git for Windows provides a Bash emulation used to run git from the command line (as well as over 250 Unix commands like awk, diff, file, grep, more, mv, rmdir, sed and wc).

Directory structure

This project is organized as follows:

bin\
docs\
examples\{README.md, Competition, Fibonacci, ..}
README.md
setenv.bat

where

  • directory bin\ contains utility tools.
  • directory docs\ contains Dafny related documents.
  • directory examples\ contains Dafny code examples (see README.md file).
  • file README.md is the Markdown document for this page.
  • file setenv.bat is the batch command for setting up our environment.

Batch commands

setenv.bat 4

We execute command setenv once to setup our development environment; it makes external tools such as git.exe and sh.exe directly available from the command prompt.

> setenv
Tool versions:
   dafny 4.9.0, code 1.95.3,
   git 2.47.1, diff 3.10, bash 5.2.37(1)

> where git sh
C:\opt\Git\bin\git.exe
C:\opt\Git\mingw64\bin\git.exe
C:\opt\Git\bin\sh.exe
C:\opt\msys64\usr\bin\sh.exe
C:\opt\Git\usr\bin\sh.exe

Command setenv-verbose also prints :

  • the tool paths.
  • the environment variables defined in the current session.
  • the path associations (globally defined).
> setenv -verbose
Tool versions:
   dafny 4.9.0, code 1.95.3,
   git 2.47.1, diff 3.10, bash 5.2.37(1)
Tool paths:
   C:\opt\dafny\Dafny.exe
   C:\opt\Git\bin\git.exe
   C:\opt\Git\usr\bin\diff.exe
   C:\opt\Git\bin\bash.exe
Environment variables:
   "DAFNY_HOME=C:\opt\dafny"
   "GIT_HOME=C:\opt\Git"
   "JAVA_HOME=C:\opt\jdk-temurin-17.0.13_11"
Path associations:
   G:\: => %USERPROFILE%\workspace-perso\dafny-examples

Footnotes

[1] Downloads

In our case we downloaded the following installation files (see section 1):
dafny-4.9.0-x64-windows-2019.zip   (60 MB)
dotnet-sdk-6.0.428-win-x64.exe    (198 MB)
PortableGit-2.47.1-64-bit.7z.exe   (55 MB)
VSCode-win32-x64-1.95.3.zip       (131 MB)

mics/December 2024  

About

Playing with Dafny on Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published