Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7af4116
Add bitvectors to theta type converter
as3810t Sep 7, 2020
63c6490
Add bitvector expression conversion to theta converter
as3810t Sep 7, 2020
2d07f82
Add array literal conversion to theta converter
as3810t Sep 7, 2020
4e90f10
Add [[maybe_unused]] to visitor parameters
as3810t Sep 7, 2020
ca4d600
Add bitvector specific theta keywords
as3810t Sep 7, 2020
b4b7eb5
Refactor RecursiveToCyclicTransformer to support other types for the …
as3810t Sep 7, 2020
c2d35f5
Parse bitvectors from cex
as3810t Sep 7, 2020
3641d97
Parse array literals from cex
as3810t Sep 7, 2020
0215081
Remove forced int representation from gazer-theta
as3810t Sep 7, 2020
50ded99
Remove <charconv> dependency
as3810t Sep 9, 2020
7c93243
Correct whitespace discrepancies
as3810t Sep 9, 2020
b26b0de
Add -math-int to theta functional tests
as3810t Sep 9, 2020
e8ebf1b
Fix Ninja build error at ExternalProject_Add
as3810t Sep 9, 2020
e5a8009
Merge branch 'master' of https://github.com/ftsrg/gazer
as3810t Sep 9, 2020
1f5cb83
Merge branch 'master' into bitvectors
as3810t Sep 9, 2020
2cc819e
Add bitvector related functional tests
as3810t Sep 9, 2020
6c15fc5
Refactor ThetaType to use free functions
as3810t Sep 11, 2020
fe29400
Replace boost::intrusive_ptr with Gazer defined ExprRef
as3810t Sep 11, 2020
6041ca9
Adhere to code formatting guidelines
as3810t Sep 11, 2020
c9c7cc2
Remove dependency from std::bitset
as3810t Sep 11, 2020
ab25fe1
Add tests in ThetaExprPrinter for bitvector transformation
as3810t Sep 11, 2020
6c37854
Add methods that create array literals to ExprBuilder
as3810t Sep 11, 2020
589daf7
Add tests targeting array literal transformation in ThetaExprPrinter
as3810t Sep 11, 2020
1afa12a
Fix error regarding recursive usage of ThetaExprPrinter
as3810t Sep 11, 2020
fd97cf6
Run functional tests requiring flat memory model with bitvector compa…
as3810t Sep 11, 2020
48edb2e
Merge remote-tracking branch 'origin/master' into bitvectors
as3810t Sep 11, 2020
d30244e
Enable theta tests that require bitvector support
as3810t Sep 11, 2020
10f481b
Merge remote-tracking branch 'origin/master' into bitvectors
as3810t Sep 15, 2020
1237309
Use more efficient refinement strategy for theta/memory functional tests
as3810t Sep 15, 2020
60ecbfc
Remove tests that timeout
as3810t Sep 15, 2020
eb61fb2
Correct typo in licence
as3810t Sep 15, 2020
65319c2
Fix coding style issues
as3810t Sep 15, 2020
295a637
Update issue templates
radl97 Sep 20, 2020
243c374
Update bug_report.md
radl97 Sep 21, 2020
2a61bb9
Fix input assignments relying on ordering
radl97 Sep 21, 2020
80cce9f
Merge pull request #48 from radl97/fix-input-assigns
radl97 Sep 21, 2020
05b4ea3
Upgrade Theta to 2.5.0
hajduakos Sep 22, 2020
8f44b8c
Merge pull request #50 from ftsrg/theta-2.5
AdamZsofi Sep 24, 2020
1fd3e57
Bump version number to 1.0.0
sallaigy Sep 24, 2020
0576ab9
Add info on versioning/PRs in docs
hajduakos Sep 24, 2020
b539485
Merge pull request #51 from ftsrg/versioning
hajduakos Sep 24, 2020
2b1ecb2
Rework checks and fix signed overflow check
sallaigy Aug 5, 2020
6d3488d
Fix crash with long literals
sallaigy Sep 6, 2020
8401059
Merge pull request #38 from ftsrg/signed-overflow-check
sallaigy Oct 2, 2020
84352b9
Add bitvectors to theta type converter
as3810t Sep 7, 2020
4f1442d
Add bitvector expression conversion to theta converter
as3810t Sep 7, 2020
4cb9a98
Add array literal conversion to theta converter
as3810t Sep 7, 2020
0f6c7bb
Add [[maybe_unused]] to visitor parameters
as3810t Sep 7, 2020
a568d07
Add bitvector specific theta keywords
as3810t Sep 7, 2020
9866f3f
Refactor RecursiveToCyclicTransformer to support other types for the …
as3810t Sep 7, 2020
9cfaf7e
Parse bitvectors from cex
as3810t Sep 7, 2020
01bf9f6
Parse array literals from cex
as3810t Sep 7, 2020
299023e
Remove forced int representation from gazer-theta
as3810t Sep 7, 2020
b351cfe
Remove <charconv> dependency
as3810t Sep 9, 2020
f0e2fcc
Correct whitespace discrepancies
as3810t Sep 9, 2020
6e8defa
Add -math-int to theta functional tests
as3810t Sep 9, 2020
72f6aa9
Fix Ninja build error at ExternalProject_Add
as3810t Sep 9, 2020
2496208
Add bitvector related functional tests
as3810t Sep 9, 2020
f408eaa
Refactor ThetaType to use free functions
as3810t Sep 11, 2020
193c755
Replace boost::intrusive_ptr with Gazer defined ExprRef
as3810t Sep 11, 2020
7bbcefa
Adhere to code formatting guidelines
as3810t Sep 11, 2020
993b361
Remove dependency from std::bitset
as3810t Sep 11, 2020
9df7296
Add tests in ThetaExprPrinter for bitvector transformation
as3810t Sep 11, 2020
2f136c8
Add methods that create array literals to ExprBuilder
as3810t Sep 11, 2020
a487101
Add tests targeting array literal transformation in ThetaExprPrinter
as3810t Sep 11, 2020
6ba4ce8
Fix error regarding recursive usage of ThetaExprPrinter
as3810t Sep 11, 2020
a195403
Run functional tests requiring flat memory model with bitvector compa…
as3810t Sep 11, 2020
a5b9dc9
Enable theta tests that require bitvector support
as3810t Sep 11, 2020
d4ded75
Use more efficient refinement strategy for theta/memory functional tests
as3810t Sep 15, 2020
bd98029
Remove tests that timeout
as3810t Sep 15, 2020
9dd49c1
Correct typo in licence
as3810t Sep 15, 2020
7a0ce0b
Fix coding style issues
as3810t Sep 15, 2020
c3912bc
Refactor ThetaType
as3810t Oct 4, 2020
1b61439
Improve coding style
as3810t Oct 4, 2020
c4751ad
Add utils to collect array literals modeling uninitialized memory
as3810t Oct 4, 2020
50fff82
Create locations in Theta CFA to model uninitialized memory
as3810t Oct 4, 2020
9579dbc
Add tests for Theta uninitialized memory
as3810t Oct 4, 2020
8f9b379
Remove tests timing out
as3810t Oct 4, 2020
7e5056c
Merge remote-tracking branch 'origin/bitvectors' into bitvectors
as3810t Oct 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

Exact command issued, with the input files attached, possibly minimized.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Version (please complete the following information):**
- Version (branch, etc.)
- Theta version (if applicable)

**Additional context**
Add any other context about the problem here.

**Additional tips to pinpoint when the error was introduced:**

Run with ... and check if the error persists:

- `--no-optimize`
- `--memory=havoc --math=int`
- note that these might break soundness. Check if the CFA is correct!
- `--debug` flag to dump more data

Intermediate state dumps: check these files to pinpoint the problem.

- `clang -S -emit-llvm input.c`
- `gazer-cfa --run-pipeline <args>`
- This (and the next) creates one file (.function.dot) per loop and per function.
- `gazer-cfa ...` (this is for checking the backend only. Probably passing an optimized LLVM IR file is the best)
- When running gazer-theta, check the output file
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ addons:
- python3-setuptools
- python3-psutil
env:
- THETA_VERSION="v2.4.0"
- THETA_VERSION="v2.5.0"
script:
# fetch LLVM and other dependencies
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
Expand Down
30 changes: 29 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
cmake_minimum_required(VERSION 3.8)
project(gazer)

# Set version information

if(NOT DEFINED GAZER_VERSION_MAJOR)
set(GAZER_VERSION_MAJOR 1)
endif()
if(NOT DEFINED GAZER_VERSION_MINOR)
set(GAZER_VERSION_MINOR 0)
endif()
if(NOT DEFINED GAZER_VERSION_PATCH)
set(GAZER_VERSION_PATCH 0)
endif()
if(NOT DEFINED GAZER_VERSION_SUFFIX)
set(GAZER_VERSION_SUFFIX "")
endif()

if (NOT PACKAGE_VERSION)
set(PACKAGE_VERSION
"${GAZER_VERSION_MAJOR}.${GAZER_VERSION_MINOR}.${GAZER_VERSION_PATCH}${GAZER_VERSION_SUFFIX}")
endif()

include(ExternalProject)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
Expand Down Expand Up @@ -53,14 +73,22 @@ include_directories(${Boost_INCLUDE_DIR})
add_definitions(-DBOOST_NO_RTTI -DBOOST_EXCEPTION_DISABLE -DBOOST_NO_EXCEPTIONS)

# Project directories
include_directories(include)
set(GAZER_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include")
set(GAZER_MAIN_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")

include_directories(${GAZER_INCLUDE_DIR} ${GAZER_MAIN_INCLUDE_DIR})

# Find out which solvers are enabled
set(GAZER_ENABLE_SOLVERS "z3" CACHE STRING "Semicolon-separated list of solvers to build")

add_subdirectory(src)
add_subdirectory(tools)

# Generate the configuration file
configure_file(
${GAZER_INCLUDE_DIR}/gazer/Config/gazer-config.h.cmake
${GAZER_MAIN_INCLUDE_DIR}/gazer/Config/gazer-config.h)

option(GAZER_ENABLE_UNIT_TESTS "Enable unit tests" ON)

if (GAZER_ENABLE_UNIT_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:18.04

ENV THETA_VERSION v2.4.0
ENV THETA_VERSION v2.5.0

RUN apt-get update && \
apt-get install -y build-essential git cmake \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It provides a user-friendly end-to-end verification workflow, with support for m

Currently we support two verification backends:
* `gazer-theta` leverages the power of the [theta](https://github.com/ftsrg/theta) model checking framework.
* Currently, [v2.4.0](https://github.com/ftsrg/theta/releases/tag/v2.4.0) is tested, but newer releases might also work.
* Currently, [v2.5.0](https://github.com/ftsrg/theta/releases/tag/v2.5.0) is tested, but newer releases might also work.
* `gazer-bmc` is gazer's built-in bounded model checking engine.

# Usage
Expand Down
11 changes: 11 additions & 0 deletions doc/Contribution.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Contribution Guidelines

## General

As the main repository is read-only, we suggest you to create your own [fork](https://help.github.com/articles/fork-a-repo/).
Within your fork, we also recommend to create new _branches_ for your development.
This enables us later on to easily integrate your work into the main repository by using [pull requests](https://help.github.com/articles/about-pull-requests/).

As the framework is under development, we suggest you to [sync your fork](https://help.github.com/articles/syncing-a-fork/) often and merge the master branch into your development branch(es).

Gazer uses [semantic versioning](https://semver.org/) in a `MAJOR.MINOR.PATCH` format, e.g., `1.2.3`.
The preferred development workflow is to bump the version number (see `CMakeLists.txt `) each time a PR gets merged.

## Coding style and naming convention

You can use `clang-format` with our provided style configuration file to reformat source code files to the appropriate coding style before commiting a patch.
Expand Down
31 changes: 31 additions & 0 deletions include/gazer/Config/gazer-config.h.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//==-------------------------------------------------------------*- C++ -*--==//
//
// Copyright 2019 Contributors to the Gazer project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//===----------------------------------------------------------------------===//
#ifndef GAZER_CONFIG_GAZER_CONFIG_H
#define GAZER_CONFIG_GAZER_CONFIG_H

#define GAZER_VERSION_MAJOR ${GAZER_VERSION_MAJOR}

#define GAZER_VERSION_MINOR ${GAZER_VERSION_MINOR}

#define GAZER_VERSION_PATCH ${GAZER_VERSION_PATCH}

#define GAZER_VERSION_SUFFIX ${GAZER_VERSION_SUFFIX}

#define GAZER_VERSION_STRING "${PACKAGE_VERSION}"

#endif
10 changes: 10 additions & 0 deletions include/gazer/Core/Expr/ExprBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ class ExprBuilder
return IntLiteralExpr::Get(IntType::Get(mContext), value);
}

ExprRef<ArrayLiteralExpr> ArrayLit(ArrayType& arrTy, const ArrayLiteralExpr::MappingT& entries, const ExprRef<LiteralExpr>& elze = nullptr) {
return ArrayLiteralExpr::Get(arrTy, entries, elze);
}

ExprRef<ArrayLiteralExpr> ArrayLit(const ArrayLiteralExpr::MappingT& entries, const ExprRef<LiteralExpr>& elze = nullptr) {
assert(!entries.empty());
const auto& [index, elem] = *entries.begin();
return this->ArrayLit(ArrayType::Get(index->getType(), elem->getType()), entries, elze);
}

ExprRef<BoolLiteralExpr> BoolLit(bool value) { return value ? True() : False(); }
ExprRef<BoolLiteralExpr> True() { return BoolLiteralExpr::True(BoolType::Get(mContext)); }
ExprRef<BoolLiteralExpr> False() { return BoolLiteralExpr::False(BoolType::Get(mContext)); }
Expand Down
11 changes: 10 additions & 1 deletion include/gazer/LLVM/Instrumentation/Check.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,21 @@ class Check : public llvm::ModulePass
virtual bool mark(llvm::Function& function) = 0;

protected:

/// Creates an error block with a gazer.error_code(i16 code) call and a terminating unreachable instruction.
llvm::BasicBlock* createErrorBlock(
llvm::Function& function, const llvm::Twine& name = "", llvm::Instruction* location = nullptr
);

/// Replaces all instructions matching the given predicate with an error call.
/// This function assumes that all instructions that follow a matching instruction within the
/// block are unreachable.
/// \return True if there were any matches; false otherwise.
bool replaceMatchingUnreachableWithError(
llvm::Function& function,
const llvm::Twine& errorBlockName,
std::function<bool(llvm::Instruction&)> predicate
);

CheckRegistry& getRegistry() const;

private:
Expand Down
4 changes: 1 addition & 3 deletions include/gazer/LLVM/Instrumentation/Intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GazerIntrinsic

enum class Overflow
{
SAdd, UAdd, SSub, USub, SMul, UMul, SDiv, Shl
SAdd, UAdd, SSub, USub, SMul, UMul
};

public:
Expand All @@ -76,8 +76,6 @@ class GazerIntrinsic

/// Returns a 'gazer.KIND.no_overflow.T(T left, T right)' intrinsic.
static llvm::FunctionCallee GetOrInsertOverflowCheck(llvm::Module& module, Overflow kind, llvm::Type* type);

static bool isPredicate(llvm::Function& function);
};

}
Expand Down
2 changes: 2 additions & 0 deletions include/gazer/LLVM/Transform/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ llvm::Pass* createNormalizeVerifierCallsPass();
/// A simpler (and more restricted) inlining pass.
llvm::Pass* createSimpleInlinerPass(llvm::Function& entry, InlineLevel level);

llvm::Pass* createCanonizeLoopExitsPass();

}

#endif
Loading