diff --git a/.travis.yml b/.travis.yml
index f8ff1c6ac..3791b47ce 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,18 +9,11 @@ addons:
- cmake
- python3-yaml
- python3-psutil
+ - python3-pip
- unzip
- - libz-dev
- - libedit-dev
+ - ninja-build
- libboost-all-dev
-cache:
- directories:
- - $HOME/build/smackers/boogie
- - $HOME/build/smackers/corral
- - $HOME/build/smackers/symbooglix
- - $HOME/build/smackers/lockpwn
-
env:
global:
- COMPILER_NAME=clang COMPILER=clang++ CXX=clang++ CC=clang
@@ -28,6 +21,7 @@ env:
- TRAVIS_ENV="--exhaustive --folder=c/basic"
- TRAVIS_ENV="--exhaustive --folder=c/data"
- TRAVIS_ENV="--exhaustive --folder=c/ntdrivers-simplified"
+ - TRAVIS_ENV="--exhaustive --folder=c/ntdrivers"
- TRAVIS_ENV="--exhaustive --folder=c/bits"
- TRAVIS_ENV="--exhaustive --folder=c/float"
- TRAVIS_ENV="--exhaustive --folder=c/locks"
@@ -35,36 +29,41 @@ env:
- TRAVIS_ENV="--exhaustive --folder=c/simd"
- TRAVIS_ENV="--exhaustive --folder=c/memory-safety"
- TRAVIS_ENV="--exhaustive --folder=c/pthread"
+ - TRAVIS_ENV="--exhaustive --folder=c/pthread_extras"
- TRAVIS_ENV="--exhaustive --folder=c/strings"
- TRAVIS_ENV="--exhaustive --folder=c/special"
+ - TRAVIS_ENV="--exhaustive --folder=rust/array --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/basic --languages=rust"
+ - TRAVIS_ENV="--exhaustive --folder=rust/box --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/functions --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/generics --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/loops --languages=rust"
+ - TRAVIS_ENV="--exhaustive --folder=rust/panic --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/recursion --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/structures --languages=rust"
- TRAVIS_ENV="--exhaustive --folder=rust/vector --languages=rust"
before_install:
+ - sudo rm -rf /usr/local/clang-7.0.0
+
+install:
+ - source ./bin/versions
- wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- - sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main"
- - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+ - sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${LLVM_SHORT_VERSION} main"
+ - wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+ - sudo dpkg -i packages-microsoft-prod.deb
- sudo apt-get install -y apt-transport-https
- - echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
- sudo apt-get update
+ - sudo apt-get install -y clang-${LLVM_SHORT_VERSION} clang-format-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev dotnet-sdk-3.1
+ - pip3 install -U flake8
+ - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_SHORT_VERSION} 20
+ - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_SHORT_VERSION} 20
+ - sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${LLVM_SHORT_VERSION} 20
+ - sudo update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-${LLVM_SHORT_VERSION} 20
+ - sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-${LLVM_SHORT_VERSION} 20
+ - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${LLVM_SHORT_VERSION} 20
-install:
- - sudo apt-get install -y clang-8 clang-format-8 llvm-8-dev mono-complete ca-certificates-mono ninja-build
- - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 20
- - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 20
- - sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-8 20
- - sudo update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-8 20
- - sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-8 20
- - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 20
- - sudo pip install pyyaml psutil
-
-script:
- - python --version
+before_script:
- python3 --version
- $CXX --version
- $CC --version
@@ -72,5 +71,8 @@ script:
- clang++ --version
- llvm-link --version
- llvm-config --version
+
+script:
- ./format/run-clang-format.py -e test/c/basic/transform-out.c -r lib/smack include/smack share/smack/include share/smack/lib test examples
+ - flake8 test/regtest.py share/smack/ --extend-exclude share/smack/svcomp/,share/smack/reach.py
- INSTALL_RUST=1 ./bin/build.sh
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c73d88a73..f6ea010dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,11 @@ cmake_minimum_required(VERSION 3.4.3)
project(smack)
if (NOT WIN32 OR MSYS OR CYGWIN)
- find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-8 llvm-config PATHS ${LLVM_CONFIG} DOC "llvm-config")
+
+ file(STRINGS "bin/versions" LLVM_VERSION_STR REGEX "LLVM_SHORT_VERSION=[0-9]+")
+ string(REGEX MATCH "[0-9]+" LLVM_SHORT_VERSION "${LLVM_VERSION_STR}")
+
+ find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-${LLVM_SHORT_VERSION} llvm-config PATHS ${LLVM_CONFIG} DOC "llvm-config")
if (LLVM_CONFIG_EXECUTABLE STREQUAL "LLVM_CONFIG_EXECUTABLE-NOTFOUND")
message(FATAL_ERROR "llvm-config could not be found!")
@@ -112,6 +116,7 @@ add_library(smackTranslator STATIC
include/smack/BplFilePrinter.h
include/smack/BplPrinter.h
include/smack/DSAWrapper.h
+ include/smack/InitializePasses.h
include/smack/Naming.h
include/smack/Regions.h
include/smack/SmackInstGenerator.h
@@ -167,7 +172,7 @@ if (Boost_FOUND)
endif ()
# We have to import LLVM's cmake definitions to build sea-dsa
# Borrowed from sea-dsa's CMakeLists.txt
-find_package (LLVM 8.0.1 EXACT CONFIG)
+find_package (LLVM ${LLVM_SHORT_VERSION} CONFIG)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
include(HandleLLVMOptions)
@@ -176,7 +181,7 @@ include(HandleLLVMOptions)
# The following solution is from: https://stackoverflow.com/questions/30985215/passing-variables-down-to-subdirectory-only
set(SMACK_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
set(CMAKE_BUILD_TYPE "Release")
-add_subdirectory(sea-dsa/src)
+add_subdirectory(sea-dsa/lib/seadsa)
set(CMAKE_BUILD_TYPE ${SMACK_BUILD_TYPE})
target_link_libraries(smackTranslator ${LLVM_LIBS} ${LLVM_SYSTEM_LIBS} ${LLVM_LDFLAGS})
diff --git a/Doxyfile b/Doxyfile
index 8f750c35f..a23d248f2 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = smack
-PROJECT_NUMBER = 2.4.1
+PROJECT_NUMBER = 2.5.0
PROJECT_BRIEF = "A bounded software verifier."
PROJECT_LOGO =
OUTPUT_DIRECTORY = docs
diff --git a/LICENSE b/LICENSE
index 833aa4e1d..28c461c44 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,8 +1,8 @@
The MIT License
-Copyright (c) 2008-2019 Zvonimir Rakamaric (zvonimir@cs.utah.edu),
+Copyright (c) 2008-2020 Zvonimir Rakamaric (zvonimir@cs.utah.edu),
Michael Emmi (michael.emmi@gmail.com)
-Modified work Copyright (c) 2013-2019 Marek Baranowski,
+Modified work Copyright (c) 2013-2020 Marek Baranowski,
Montgomery Carter,
Pantazis Deligiannis,
Jack J. Garzella,
@@ -44,10 +44,7 @@ licenses, and/or restrictions:
Program Directories License
------- ----------- -------
-poolalloc include/assistDS lib/DSA/LICENSE
- include/dsa
- lib/AssistDS
- lib/DSA
+sea-dsa sea-dsa sea-dsa/license.txt
run-clang-format format format/LICENSE
In addition, a binary distribution of SMACK contains at least the following
diff --git a/README.md b/README.md
index 912394b6d..03728e081 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
-| **master** | [![Build Status](https://travis-ci.com/smackers/smack.svg?branch=master)](https://travis-ci.com/smackers/smack) | **develop** | [![Build Status](https://travis-ci.com/smackers/smack.svg?branch=develop)](https://travis-ci.com/smackers/smack) |
-| --- | --- | --- | --- |
+
+[![Build Status](https://travis-ci.com/smackers/smack.svg?branch=master)](https://travis-ci.com/smackers/smack)
+[![Build Status](https://travis-ci.com/smackers/smack.svg?branch=develop)](https://travis-ci.com/smackers/smack)
@@ -47,10 +48,10 @@ See below for system requirements, installation, usage, and everything else.
### Acknowledgements
-SMACK project is partially supported by NSF award CCF 1346756 and Microsoft
-Research SEIF award. We also rely on University of Utah's
-[Emulab](http://www.emulab.net/) infrastructure for extensive benchmarking of
-SMACK.
+SMACK project has been partially supported by funding from the National Science
+Foundation, VMware, and Microsoft Research. We also rely on University of
+Utah's [Emulab](http://www.emulab.net/) infrastructure for extensive
+benchmarking of SMACK.
### Table of Contents
diff --git a/Vagrantfile b/Vagrantfile
index 7f342ebd1..bc66fc00b 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -25,7 +25,7 @@ Vagrant.configure(2) do |config|
# opensuse_config.vm.box = "chef/opensuse-13.1"
# end
- config.vm.provision "shell", binary: true, inline: <<-SHELL
+ config.vm.provision "shell", binary: true, privileged: false, inline: <<-SHELL
apt-get update
apt-get install -y software-properties-common
cd /home/vagrant
diff --git a/bin/build.sh b/bin/build.sh
index 1fc78fc7a..5751c9a3d 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -12,6 +12,7 @@
# - LLVM
# - Clang
# - Mono
+# - Boost
# - Z3
# - Boogie
# - Corral
@@ -22,16 +23,17 @@
# Set these flags to control various installation options
INSTALL_DEPENDENCIES=1
+INSTALL_MONO=0 # Mono is needed only for lockpwn and symbooglix
INSTALL_Z3=1
-INSTALL_CVC4=1
-BUILD_BOOGIE=1
-BUILD_CORRAL=1
-BUILD_SYMBOOGLIX=1
-BUILD_LOCKPWN=1
+INSTALL_CVC4=0
+INSTALL_YICES2=0
+INSTALL_BOOGIE=1
+INSTALL_CORRAL=1
+BUILD_SYMBOOGLIX=0
+BUILD_LOCKPWN=0
BUILD_SMACK=1
TEST_SMACK=1
BUILD_LLVM=0 # LLVM is typically installed from packages (see below)
-BUILD_MONO=0 # mono is typically installed from packages (see below)
# Support for more programming languages
INSTALL_OBJECTIVEC=0
@@ -39,19 +41,20 @@ INSTALL_RUST=${INSTALL_RUST:-0}
# PATHS
SMACK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
-ROOT="$( cd "${SMACK_DIR}" && cd .. && pwd )"
-Z3_DIR="${ROOT}/z3"
-CVC4_DIR="${ROOT}/cvc4"
-BOOGIE_DIR="${ROOT}/boogie"
-CORRAL_DIR="${ROOT}/corral"
-SYMBOOGLIX_DIR="${ROOT}/symbooglix"
-LOCKPWN_DIR="${ROOT}/lockpwn"
-MONO_DIR="${ROOT}/mono"
-LLVM_DIR="${ROOT}/llvm"
+ROOT_DIR="$( cd "${SMACK_DIR}" && cd .. && pwd )"
+DEPS_DIR="${ROOT_DIR}/smack-deps"
+Z3_DIR="${DEPS_DIR}/z3"
+CVC4_DIR="${DEPS_DIR}/cvc4"
+YICES2_DIR="${DEPS_DIR}/yices2"
+BOOGIE_DIR="${DEPS_DIR}/boogie"
+CORRAL_DIR="${DEPS_DIR}/corral"
+SYMBOOGLIX_DIR="${DEPS_DIR}/symbooglix"
+LOCKPWN_DIR="${DEPS_DIR}/lockpwn"
+LLVM_DIR="${DEPS_DIR}/llvm"
source ${SMACK_DIR}/bin/versions
-SMACKENV=${ROOT}/smack.environment
+SMACKENV=${ROOT_DIR}/smack.environment
WGET="wget --no-verbose"
# Install prefix -- system default is used if left unspecified
@@ -60,7 +63,7 @@ CONFIGURE_INSTALL_PREFIX=
CMAKE_INSTALL_PREFIX=
# Partial list of dependencies; the rest are added depending on the platform
-DEPENDENCIES="git cmake python3-yaml python3-psutil unzip wget ninja-build libboost-all-dev"
+DEPENDENCIES="git cmake python3-yaml python3-psutil unzip wget ninja-build apt-transport-https dotnet-sdk-3.1 libboost-all-dev"
shopt -s extglob
@@ -183,43 +186,19 @@ puts "Detected distribution: $distro"
# Set platform-dependent flags
case "$distro" in
linux-opensuse*)
- Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-debian-8.10.zip"
- DEPENDENCIES+=" llvm-clang llvm-devel gcc-c++ mono-complete ca-certificates-mono make"
- DEPENDENCIES+=" ncurses-devel zlib-devel"
- ;;
-
-linux-@(ubuntu|neon)-14*)
- Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-14.04.zip"
- DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev mono-complete ca-certificates-mono libz-dev libedit-dev"
+ Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-debian-8.10.zip"
+ DEPENDENCIES+=" llvm-clang llvm-devel gcc-c++ make"
+ DEPENDENCIES+=" ncurses-devel"
;;
linux-@(ubuntu|neon)-16*)
- Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-16.04.zip"
- DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev mono-complete ca-certificates-mono libz-dev libedit-dev"
+ Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-ubuntu-16.04.zip"
+ DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev"
;;
linux-@(ubuntu|neon)-18*)
- Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-16.04.zip"
- DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev mono-complete ca-certificates-mono libz-dev libedit-dev"
- ;;
-
-linux-ubuntu-12*)
- Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/Z3-${Z3_SHORT_VERSION}/z3-${Z3_FULL_VERSION}-x64-ubuntu-14.04.zip"
- DEPENDENCIES+=" g++-4.8 autoconf automake bison flex libtool gettext gdb"
- DEPENDENCIES+=" libglib2.0-dev libfontconfig1-dev libfreetype6-dev libxrender-dev"
- DEPENDENCIES+=" libtiff-dev libjpeg-dev libgif-dev libpng-dev libcairo2-dev"
- BUILD_LLVM=1
- BUILD_MONO=1
- INSTALL_PREFIX="/usr/local"
- CONFIGURE_INSTALL_PREFIX="--prefix=${INSTALL_PREFIX}"
- CMAKE_INSTALL_PREFIX="-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}"
- ;;
-
-linux-cygwin*)
- BUILD_LLVM=1
- INSTALL_Z3=0
- BUILD_BOOGIE=0
- BUILD_CORRAL=0
+ Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-ubuntu-16.04.zip"
+ DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev"
;;
*)
@@ -258,12 +237,9 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then
sudo zypper --non-interactive install ${DEPENDENCIES}
;;
- linux-@(ubuntu|neon)-1[468]*)
+ linux-@(ubuntu|neon)-1[68]*)
RELEASE_VERSION=$(get-platform-trim "$(lsb_release -r)" | awk -F: '{print $2;}')
case "$RELEASE_VERSION" in
- 14*)
- UBUNTU_CODENAME="trusty"
- ;;
16*)
UBUNTU_CODENAME="xenial"
;;
@@ -283,11 +259,13 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then
# Adding LLVM repository
${WGET} -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${LLVM_SHORT_VERSION} main"
- # Adding MONO repository
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
- sudo apt-get install -y apt-transport-https
- echo "deb https://download.mono-project.com/repo/ubuntu stable-${UBUNTU_CODENAME} main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
+
+ # Adding .NET repository
+ ${WGET} -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+ sudo dpkg -i packages-microsoft-prod.deb
+ rm -f packages-microsoft-prod.deb
sudo apt-get update
+
sudo apt-get install -y ${DEPENDENCIES}
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_SHORT_VERSION} 30
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_SHORT_VERSION} 30
@@ -296,20 +274,6 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then
sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-${LLVM_SHORT_VERSION} 30
;;
- linux-ubuntu-12*)
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:andykimpe/cmake
- sudo apt-get update
- sudo apt-get install -y ${DEPENDENCIES}
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
- sudo update-alternatives --config gcc
- sudo update-alternatives --config g++
- ;;
-
- linux-cygwin*)
- ;;
-
*)
puts "Distribution ${distro} not supported. Dependencies must be installed manually."
exit 1
@@ -320,37 +284,19 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then
fi
-if [ ${BUILD_MONO} -eq 1 ] ; then
- puts "Building mono"
-
- git clone git://github.com/mono/mono.git ${MONO_DIR}
- cd ${MONO_DIR}
- git checkout mono-${MONO_VERSION}
- ./autogen.sh ${CONFIGURE_INSTALL_PREFIX}
- make get-monolite-latest
- make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
- sudo make install
-
- # Install libgdiplus
- cd ${MONO_DIR}
- git clone git://github.com/mono/libgdiplus.git
- cd libgdiplus
- ./autogen.sh ${CONFIGURE_INSTALL_PREFIX}
- make
- sudo make install
-
- if [[ ${INSTALL_PREFIX} ]] ; then
- echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${INSTALL_PREFIX}/lib >> ${SMACKENV}
- source ${SMACKENV}
- fi
-
- puts "Built mono"
+if [ ${INSTALL_MONO} -eq 1 ] && [ "$TRAVIS" != "true" ] ; then
+ puts "Installing mono"
+ # Adding Mono repository
+ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+ echo "deb https://download.mono-project.com/repo/ubuntu stable-${UBUNTU_CODENAME} main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
+ sudo apt-get update
+ sudo apt-get install -y mono-complete ca-certificates-mono
+ puts "Installed mono"
fi
if [ ${BUILD_LLVM} -eq 1 ] ; then
puts "Building LLVM"
-
mkdir -p ${LLVM_DIR}/src/{tools/clang,projects/compiler-rt}
mkdir -p ${LLVM_DIR}/build
@@ -366,34 +312,32 @@ if [ ${BUILD_LLVM} -eq 1 ] ; then
cmake -G "Unix Makefiles" ${CMAKE_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=Release ../src
make
sudo make install
-
puts "Built LLVM"
fi
if [ ${INSTALL_OBJECTIVEC} -eq 1 ] ; then
puts "Installing Objective-C"
-
# The version numbers here will have to change by OS
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.8/include/objc /usr/local/include/objc
echo ". /usr/share/GNUstep/Makefiles/GNUstep.sh" >> ${SMACKENV}
-
puts "Installed Objective-C"
fi
+
if [ ${INSTALL_RUST} -eq 1 ] ; then
puts "Installing Rust"
-
${WGET} https://static.rust-lang.org/dist/${RUST_VERSION}/rust-nightly-x86_64-unknown-linux-gnu.tar.gz -O rust.tar.gz
tar xf rust.tar.gz
cd rust-nightly-x86_64-unknown-linux-gnu
sudo ./install.sh --without=rust-docs
cd ..
- rm -r rust-nightly-x86_64-unknown-linux-gnu rust.tar.gz
-
+ rm -rf rust-nightly-x86_64-unknown-linux-gnu rust.tar.gz
+ cargo install rustfilt
puts "Installed Rust"
fi
+
if [ ${INSTALL_Z3} -eq 1 ] ; then
if [ ! -d "$Z3_DIR" ] ; then
puts "Installing Z3"
@@ -406,8 +350,10 @@ if [ ${INSTALL_Z3} -eq 1 ] ; then
else
puts "Z3 already installed"
fi
+ echo export PATH=\"${Z3_DIR}/bin:\$PATH\" >> ${SMACKENV}
fi
+
if [ ${INSTALL_CVC4} -eq 1 ] ; then
if [ ! -d "$CVC4_DIR" ] ; then
puts "Installing CVC4"
@@ -418,52 +364,53 @@ if [ ${INSTALL_CVC4} -eq 1 ] ; then
else
puts "CVC4 already installed"
fi
+ echo export PATH=\"${CVC4_DIR}:\$PATH\" >> ${SMACKENV}
fi
-if [ ${BUILD_BOOGIE} -eq 1 ] ; then
- if ! upToDate $BOOGIE_DIR $BOOGIE_COMMIT ; then
- puts "Building Boogie"
- if [ ! -d "$BOOGIE_DIR/.git" ] ; then
- git clone https://github.com/boogie-org/boogie.git ${BOOGIE_DIR}
- fi
- cd ${BOOGIE_DIR}
- git reset --hard ${BOOGIE_COMMIT}
- cd ${BOOGIE_DIR}/Source
- ${WGET} https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- mono ./nuget.exe restore Boogie.sln
- rm -rf /tmp/nuget/
- msbuild Boogie.sln /p:Configuration=Release
- ln -sf ${Z3_DIR}/bin/z3 ${BOOGIE_DIR}/Binaries/z3.exe
- ln -sf ${CVC4_DIR}/cvc4 ${BOOGIE_DIR}/Binaries/cvc4.exe
- puts "Built Boogie"
+
+if [ ${INSTALL_YICES2} -eq 1 ] ; then
+ if [ ! -d "$YICES2_DIR" ] ; then
+ puts "Installing Yices2"
+ mkdir -p ${YICES2_DIR}
+ ${WGET} https://yices.csl.sri.com/releases/${YICES2_VERSION}/yices-${YICES2_VERSION}-x86_64-pc-linux-gnu-static-gmp.tar.gz -O yices2-downloaded.tgz
+ tar xf yices2-downloaded.tgz
+ cd yices-${YICES2_VERSION}
+ ./install-yices ${YICES2_DIR}
+ cd ..
+ rm -rf yices2-downloaded.tgz yices-${YICES2_VERSION}
+ ln -s ${YICES2_DIR}/bin/yices-smt2 ${YICES2_DIR}/bin/yices2
+ puts "Installed Yices2"
else
- puts "Boogie already built"
+ puts "Yices2 already installed"
fi
- echo export PATH=\"${BOOGIE_DIR}/Binaries:\$PATH\" >> ${SMACKENV}
+ echo export PATH=\"${YICES2_DIR}/bin:\$PATH\" >> ${SMACKENV}
fi
-if [ ${BUILD_CORRAL} -eq 1 ] ; then
- if ! upToDate $CORRAL_DIR $CORRAL_COMMIT ; then
- puts "Building Corral"
- if [ ! -d "$CORRAL_DIR/.git" ] ; then
- git clone https://github.com/boogie-org/corral.git ${CORRAL_DIR}
- fi
- cd ${CORRAL_DIR}
- git reset --hard ${CORRAL_COMMIT}
- git submodule init
- git submodule update
- msbuild cba.sln /p:Configuration=Release
- ln -sf ${Z3_DIR}/bin/z3 ${CORRAL_DIR}/bin/Release/z3.exe
- ln -sf ${CVC4_DIR}/cvc4 ${CORRAL_DIR}/bin/Release/cvc4.exe
- sed -i.debug -e's/Debug/Release/' ${CORRAL_DIR}/bin/corral
- puts "Built Corral"
+if [ ${INSTALL_BOOGIE} -eq 1 ] ; then
+ if [ ! -d "$BOOGIE_DIR" ] ; then
+ puts "Installing Boogie"
+ dotnet tool install Boogie --tool-path ${BOOGIE_DIR} --version ${BOOGIE_VERSION}
+ puts "Installed Boogie"
else
- puts "Corral already built"
+ puts "Boogie already installed"
fi
- echo export PATH=\"${CORRAL_DIR}/bin:\$PATH\" >> ${SMACKENV}
+ echo export PATH=\"${BOOGIE_DIR}:\$PATH\" >> ${SMACKENV}
fi
+
+if [ ${INSTALL_CORRAL} -eq 1 ] ; then
+ if [ ! -d "$CORRAL_DIR" ] ; then
+ puts "Installing Corral"
+ dotnet tool install Corral --tool-path ${CORRAL_DIR} --version ${CORRAL_VERSION}
+ puts "Installed Corral"
+ else
+ puts "Corral already installed"
+ fi
+ echo export PATH=\"${CORRAL_DIR}:\$PATH\" >> ${SMACKENV}
+fi
+
+
if [ ${BUILD_SYMBOOGLIX} -eq 1 ] ; then
if ! upToDate $SYMBOOGLIX_DIR $SYMBOOGLIX_COMMIT ; then
puts "Building Symbooglix"
@@ -486,6 +433,7 @@ if [ ${BUILD_SYMBOOGLIX} -eq 1 ] ; then
echo export PATH=\"${SYMBOOGLIX_DIR}/bin:\$PATH\" >> ${SMACKENV}
fi
+
if [ ${BUILD_LOCKPWN} -eq 1 ] ; then
if ! upToDate $LOCKPWN_DIR $LOCKPWN_COMMIT ; then
puts "Building lockpwn"
@@ -503,6 +451,7 @@ if [ ${BUILD_LOCKPWN} -eq 1 ] ; then
echo export PATH=\"${LOCKPWN_DIR}/Binaries:\$PATH\" >> ${SMACKENV}
fi
+
if [ ${BUILD_SMACK} -eq 1 ] ; then
puts "Building SMACK"
diff --git a/bin/versions b/bin/versions
index 7436fd763..6be059a2c 100644
--- a/bin/versions
+++ b/bin/versions
@@ -1,11 +1,10 @@
-MONO_VERSION=5.0.0.100
-Z3_SHORT_VERSION=4.8.5
-Z3_FULL_VERSION=4.8.5
+Z3_VERSION=4.8.8
CVC4_VERSION=1.7
-BOOGIE_COMMIT=5c829b6340
-CORRAL_COMMIT=6437c41d34
+YICES2_VERSION=2.6.2
+BOOGIE_VERSION=2.6.15
+CORRAL_VERSION=1.0.12
SYMBOOGLIX_COMMIT=ccb2e7f2b3
LOCKPWN_COMMIT=12ba58f1ec
-LLVM_SHORT_VERSION=8
-LLVM_FULL_VERSION=8.0.1
-RUST_VERSION=2019-07-16
+LLVM_SHORT_VERSION=9
+LLVM_FULL_VERSION=9.0.1
+RUST_VERSION=2020-05-21
diff --git a/docs/installation.md b/docs/installation.md
index 9af8d42bf..7a7745d00 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -80,8 +80,8 @@ to Docker's official documentation.
SMACK depends on the following projects:
-* [LLVM][] version [8.0.1][LLVM-8.0.1]
-* [Clang][] version [8.0.1][Clang-8.0.1]
+* [LLVM][] version [9.0.1][LLVM-9.0.1]
+* [Clang][] version [9.0.1][Clang-9.0.1]
* [Boost][] version 1.55 or greater
* [Python][] version 3.6.8 or greater
* [Ninja][] version 1.5.1 or greater
@@ -210,9 +210,9 @@ shell in the `test` directory by executing
[CMake]: http://www.cmake.org
[Python]: http://www.python.org
[LLVM]: http://llvm.org
-[LLVM-8.0.1]: http://llvm.org/releases/download.html#8.0.1
+[LLVM-9.0.1]: http://llvm.org/releases/download.html#9.0.1
[Clang]: http://clang.llvm.org
-[Clang-8.0.1]: http://llvm.org/releases/download.html#8.0.1
+[Clang-9.0.1]: http://llvm.org/releases/download.html#9.0.1
[Boogie]: https://github.com/boogie-org/boogie
[Corral]: https://github.com/boogie-org/corral
[Z3]: https://github.com/Z3Prover/z3/
diff --git a/docs/projects.md b/docs/projects.md
index 3eaaa2236..1bf6d8145 100644
--- a/docs/projects.md
+++ b/docs/projects.md
@@ -19,7 +19,7 @@ might have some expertise in Objective-C and/or Swift. And you could
even base the project around verifying your own iPhone app's code.
3. Try to use and extend SMACK to verify some of the example from the
-annual [Verified Software Competition (VSCOMP)](http://vscomp.org/).
+annual [VerifyThis Competition](http://verifythis.ethz.ch).
SMACK already has a rudimentary support for writing program contracts,
but that would probably have to be extended.
diff --git a/docs/publications.md b/docs/publications.md
index 4a229f951..d43f5a5a7 100644
--- a/docs/publications.md
+++ b/docs/publications.md
@@ -4,7 +4,7 @@
### Main Reference
Please use the following publication when citing SMACK in your papers:
-[SMACK: Decoupling Source Language Details from Verifier Implementations](http://soarlab.org/2014/05/smack-decoupling-source-language-details-from-verifier-implementations/),
+[SMACK: Decoupling Source Language Details from Verifier Implementations](https://soarlab.org/publications/2014_cav_re),
Zvonimir Rakamaric, Michael Emmi,
26th International Conference on Computer Aided Verification (CAV 2014)
@@ -26,7 +26,7 @@ Bo-Yuan Huang, Sayak Ray, Aarti Gupta, Jason M. Fung, Sharad Malik,
Dirk Beyer, Marie-Christine Jakobs, Thomas Lemberger, Heike Wehrheim,
40th International Conference on Software Engineering (ICSE 2018)
-1. [ZEUS: Analyzing Safety of Smart Contracts](http://wp.internetsociety.org/ndss/wp-content/uploads/sites/25/2018/02/ndss2018_09-1_Kalra_paper.pdf),
+1. [ZEUS: Analyzing Safety of Smart Contracts](https://www.ndss-symposium.org/wp-content/uploads/2018/02/ndss2018_09-1_Kalra_paper.pdf),
Sukrit Kalra, Seep Goel, Mohan Dhawan, Subodh Sharma,
25th Annual Network and Distributed System Security Symposium (NDSS 2018)
@@ -34,7 +34,7 @@ Sukrit Kalra, Seep Goel, Mohan Dhawan, Subodh Sharma,
Yiji Zhang, Lenore D. Zuck,
Keynote at the 14th International Conference on Distributed Computing and Internet Technology (ICDCIT 2018)
-1. [Counterexample-Guided Bit-Precision Selection](http://soarlab.org/2017/09/aplas2017-hr/),
+1. [Counterexample-Guided Bit-Precision Selection](https://soarlab.org/publications/2017_aplas_hr),
Shaobo He, Zvonimir Rakamaric,
15th Asian Symposium on Programming Languages and Systems (APLAS 2017)
@@ -42,7 +42,7 @@ Shaobo He, Zvonimir Rakamaric,
Sunjay Cauligi, Gary Soeller, Fraser Brown, Brian Johannesmeyer, Yunlu Huang, Ranjit Jhala, Deian Stefan,
IEEE Secure Development Conference (SecDev 2017)
-1. [Static Assertion Checking of Production Software with Angelic Verification](http://soarlab.org/2017/09/tapas2017-hllr/),
+1. [Static Assertion Checking of Production Software with Angelic Verification](https://soarlab.org/publications/2017_tapas_hllr),
Shaobo He, Shuvendu Lahiri, Akash Lal, Zvonimir Rakamaric,
8th Workshop on Tools for Automatic Program Analysis (TAPAS 2017)
@@ -51,7 +51,7 @@ Alex Gyori, Shuvendu Lahiri, Nimrod Partush,
26th ACM SIGSOFT International Symposium on Software Testing and Analysis
(ISSTA 2017)
-1. [System Programming in Rust: Beyond Safety](http://soarlab.org/2017/06/hotos2017-bbbprr/),
+1. [System Programming in Rust: Beyond Safety](https://soarlab.org/publications/2017_hotos_bbbprr),
Abhiram Balasubramanian, Marek S. Baranowski, Anton Burtsev, Aurojit Panda,
Zvonimir Rakamaric, Leonid Ryzhyk,
16th Workshop on Hot Topics in Operating Systems (HotOS 2017)
@@ -66,15 +66,15 @@ Yaniv David, Nimrod Partush, Eran Yahav,
37th ACM SIGPLAN Conference on Programming Language Design and Implementation
(PLDI 2016)
-1. [SMACK Software Verification Toolchain](http://soarlab.org/2016/02/icse2016-chwre/),
+1. [SMACK Software Verification Toolchain](https://soarlab.org/publications/2016_icse_chwre),
Montgomery Carter, Shaobo He, Jonathan Whitaker, Zvonimir Rakamaric, Michael Emmi,
Demonstrations Track at the 38th IEEE/ACM International Conference on Software Engineering (ICSE 2016)
-1. [Fast and Precise Symbolic Analysis of Concurrency Bugs in Device Drivers](http://soarlab.org/2015/08/ase2015-ddr/),
+1. [Fast and Precise Symbolic Analysis of Concurrency Bugs in Device Drivers](https://soarlab.org/publications/2015_ase_ddr),
Pantazis Deligiannis, Alastair F. Donaldson, Zvonimir Rakamaric,
30th IEEE/ACM International Conference on Automated Software Engineering (ASE 2015)
-1. [SMACK+Corral: A Modular Verifier (Competition Contribution)](http://soarlab.org/2015/01/smackcorral-a-modular-verifier-competition-contribution/),
+1. [SMACK+Corral: A Modular Verifier (Competition Contribution)](https://soarlab.org/publications/2015_tacas_hcelqr),
Arvind Haran, Montgomery Carter, Michael Emmi, Akash Lal, Shaz Qadeer, Zvonimir Rakamaric,
21st International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2015)
@@ -82,15 +82,15 @@ Arvind Haran, Montgomery Carter, Michael Emmi, Akash Lal, Shaz Qadeer, Zvonimir
Pranav Garg, Christof Löding, P. Madhusudan, Daniel Neider,
26th International Conference on Computer Aided Verification (CAV 2014)
-1. [Modular Verification of Shared-Memory Concurrent System Software](http://soarlab.org/2011/03/modular-verification-of-shared-memory-concurrent-system-software/),
+1. [Modular Verification of Shared-Memory Concurrent System Software](https://soarlab.org/publications/2011_thesis_rakamaric),
Zvonimir Rakamaric,
Ph.D. Thesis, Department of Computer Science, University of British Columbia, 2011
-1. [A Scalable Memory Model for Low-Level Code](http://soarlab.org/2009/01/a-scalable-memory-model-for-low-level-code/),
+1. [A Scalable Memory Model for Low-Level Code](https://soarlab.org/publications/2009_vmcai_rh),
Zvonimir Rakamaric, Alan J. Hu,
10th International Conference on Verification, Model Checking and Abstract Interpretation (VMCAI 2009)
-1. [Automatic Inference of Frame Axioms Using Static Analysis](http://soarlab.org/2008/09/automatic-inference-of-frame-axioms-using-static-analysis/),
+1. [Automatic Inference of Frame Axioms Using Static Analysis](https://soarlab.org/publications/2008_ase_rh),
Zvonimir Rakamaric, Alan J. Hu,
23rd IEEE/ACM International Conference on Automated Software Engineering (ASE 2008)
diff --git a/docs/usage-notes.md b/docs/usage-notes.md
index de6825971..246c697c5 100644
--- a/docs/usage-notes.md
+++ b/docs/usage-notes.md
@@ -32,11 +32,11 @@ of `x`, in the 3rd iteration) for the assertion to be reachable.
## Bitwise Operations and Integer Casts
If the program to verify contains bitwise operations or integer casts, then the
-flag `--bit-precise` may be required. The reason is that SMACK uses the SMT
-theory of integers to encode machine integers by default, where bitwise
-operations are encoded using uninterpreted functions returning arbitrary values.
-Furthermore, precise encoding is required to handle integer signedness casts,
-which is not also enabled automatically.
+flag `--integer-encoding=bit-vector` may be required. The reason is that SMACK
+uses the SMT theory of integers to encode machine integers by default, where
+bitwise operations are encoded using uninterpreted functions returning
+arbitrary values. Furthermore, precise encoding is required to handle integer
+signedness casts, which is not also enabled automatically.
The following program demonstrate the problems in the presence of bitwise
operations.
@@ -72,11 +72,11 @@ Some steps in the error trace are omitted. As you can see, the concrete values
of `y` in the error trace before and after the bitwise right shift operation do
not follow its semantics because it is modeled as an uninterpreted function.
-In this case, we need the `--bit-precise` flag that, as its name indicates,
-enables bit-precise modeling of machine integers.
+In this case, we need the `--integer-encoding=bit-vector` flag that, as its
+name indicates, enables bit-precise modeling of machine integers.
```
-$ smack a.c --bit-precise
+$ smack a.c --integer-encoding=bit-vector
SMACK program verifier version 1.9.0
SMACK found no errors with unroll bound 1.
```
@@ -91,11 +91,11 @@ Similar to machine integers, floating-point numbers and arithmetic are modeled
using the theory of integers and uninterpreted functions, respectively.
Therefore, if the assertions to verify depend on precise modeling of
floating-point representations, the flag `--float` is needed. Note that
-occasionally `--bit-precise` has to be used in addition to `--float`, in
-particular when casts between floating-point numbers and integers are present.
-Moreover, reasoning about floating-point numbers is often very slow. Please let
-us know if you encounter any performance issues. We can share some experiences
-that may ease the situation.
+occasionally `--integer-encoding=bit-vector` has to be used in addition to
+`--float`, in particular when casts between floating-point numbers and integers
+are present. Moreover, reasoning about floating-point numbers is often very
+slow. Please let us know if you encounter any performance issues. We can share
+some experiences that may ease the situation.
## Concurrency
Reasoning about pthreads is supported by SMACK with the flag `--pthread`. Please
diff --git a/include/smack/CodifyStaticInits.h b/include/smack/CodifyStaticInits.h
index 8a30c48dc..4ac92ae5e 100644
--- a/include/smack/CodifyStaticInits.h
+++ b/include/smack/CodifyStaticInits.h
@@ -20,4 +20,7 @@ class CodifyStaticInits : public llvm::ModulePass {
virtual bool runOnModule(llvm::Module &M);
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
};
+
+llvm::Pass *createCodifyStaticInitsPass();
+
} // namespace smack
diff --git a/include/smack/DSAWrapper.h b/include/smack/DSAWrapper.h
index 1e16f1c53..63f434d86 100644
--- a/include/smack/DSAWrapper.h
+++ b/include/smack/DSAWrapper.h
@@ -10,24 +10,24 @@
#include
#include
-#include "sea_dsa/DsaAnalysis.hh"
-#include "sea_dsa/Global.hh"
-#include "sea_dsa/Graph.hh"
+#include "seadsa/DsaAnalysis.hh"
+#include "seadsa/Global.hh"
+#include "seadsa/Graph.hh"
namespace smack {
class DSAWrapper : public llvm::ModulePass {
private:
llvm::Module *module;
- sea_dsa::GlobalAnalysis *SD;
+ seadsa::GlobalAnalysis *SD;
// The ds graph since we're using the context-insensitive version which
// results in one graph for the whole module.
- sea_dsa::Graph *DG;
- std::unordered_set staticInits;
- std::unordered_set memOpds;
+ seadsa::Graph *DG;
+ std::unordered_set staticInits;
+ std::unordered_set memOpds;
// Mapping from the DSNodes associated with globals to the numbers of
// globals associated with them.
- std::unordered_map globalRefCount;
+ std::unordered_map globalRefCount;
const llvm::DataLayout *dataLayout;
void collectStaticInits(llvm::Module &M);
@@ -41,15 +41,15 @@ class DSAWrapper : public llvm::ModulePass {
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
virtual bool runOnModule(llvm::Module &M);
- bool isStaticInitd(const sea_dsa::Node *n);
- bool isMemOpd(const sea_dsa::Node *n);
+ bool isStaticInitd(const seadsa::Node *n);
+ bool isMemOpd(const seadsa::Node *n);
bool isRead(const llvm::Value *V);
bool isSingletonGlobal(const llvm::Value *V);
unsigned getPointedTypeSize(const llvm::Value *v);
unsigned getOffset(const llvm::Value *v);
- const sea_dsa::Node *getNode(const llvm::Value *v);
+ const seadsa::Node *getNode(const llvm::Value *v);
bool isTypeSafe(const llvm::Value *v);
- unsigned getNumGlobals(const sea_dsa::Node *n);
+ unsigned getNumGlobals(const seadsa::Node *n);
};
} // namespace smack
diff --git a/include/smack/InitializePasses.h b/include/smack/InitializePasses.h
new file mode 100644
index 000000000..843d18ed7
--- /dev/null
+++ b/include/smack/InitializePasses.h
@@ -0,0 +1,14 @@
+//
+// This file is distributed under the MIT License. See LICENSE for details.
+//
+#ifndef INITIALIZEPASSES_H
+#define INITIALIZEPASSES_H
+
+#include "llvm/InitializePasses.h"
+
+namespace llvm {
+void initializeDSAWrapperPass(PassRegistry &Registry);
+void initializeCodifyStaticInitsPass(PassRegistry &Registry);
+} // end namespace llvm
+
+#endif // INITIALIZEPASSES_H
diff --git a/include/smack/MemorySafetyChecker.h b/include/smack/MemorySafetyChecker.h
index f692a80ad..dd1a64d41 100644
--- a/include/smack/MemorySafetyChecker.h
+++ b/include/smack/MemorySafetyChecker.h
@@ -14,9 +14,6 @@ namespace smack {
class MemorySafetyChecker : public llvm::FunctionPass,
public llvm::InstVisitor {
private:
- std::map leakCheckFunction;
- std::map safetyCheckFunction;
-
llvm::Function *getLeakCheckFunction(llvm::Module &M);
llvm::Function *getSafetyCheckFunction(llvm::Module &M);
diff --git a/include/smack/Naming.h b/include/smack/Naming.h
index c41fa7103..6e19318d3 100644
--- a/include/smack/Naming.h
+++ b/include/smack/Naming.h
@@ -8,6 +8,7 @@
#include "llvm/IR/Value.h"
#include "llvm/Support/Regex.h"
#include