Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
install dafny
#Dependencies: Install Mono from the official repositories;
#the version in most distribution repositories is too out of date.
#The mono-devel package is what you need.
sudo apt-key adv --keyserver hkp:// --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get -y update
#Create an empty base directory
mkdir ~/.dafny
cd ~/.dafny
#Download and build Boogie:
git clone
cd boogie
mono ./nuget.exe restore Source/Boogie.sln
msbuild Source/Boogie.sln
cd ..
#Download and build Dafny:
cd ~/.dafny
git clone ~/.dafny/dafny
msbuild dafny/Source/Dafny.sln
#Download and unpack z3 (Dafny looks for z3 in Binaries/z3/bin/)
cd ~/.dafny
mv z3-4.6.0-x64-ubuntu-16.04 dafny/Binaries/z3
#(Optional) If you plan to use Boogie directly, copy (or symlink) the z3 binary so that Boogie, too, can find it:
cd ~/.dafny
rm -f boogie/Binaries/z3.exe
cp dafny/Binaries/z3/bin/z3 boogie/Binaries/z3.exe
# Run Dafny using the dafny shell script in the Binaries directory (it calls mono as appropriate)
cd ~/.dafny/dafny/Bin*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment