All Projects → seahorn → Crab

seahorn / Crab

Licence: other
CoRnucopia of ABstractions: a library for building abstract interpretation-based analyses

Projects that are alternatives of or similar to Crab

Codeql Go
The CodeQL extractor and libraries for Go.
Stars: ✭ 224 (+119.61%)
Mutual labels:  static-analysis, program-analysis
Ikos
Static analyzer for C/C++ based on the theory of Abstract Interpretation.
Stars: ✭ 1,368 (+1241.18%)
Mutual labels:  static-analysis, program-analysis
Dg
[LLVM Static Slicer] Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode.
Stars: ✭ 242 (+137.25%)
Mutual labels:  static-analysis, program-analysis
Crab Llvm
Static Analyzer for LLVM bitcode based on Abstract Interpretation
Stars: ✭ 143 (+40.2%)
Mutual labels:  static-analysis, program-analysis
Linter
Static Analysis Compiler Plugin for Scala
Stars: ✭ 273 (+167.65%)
Mutual labels:  static-analysis, program-analysis
Pyt
A Static Analysis Tool for Detecting Security Vulnerabilities in Python Web Applications
Stars: ✭ 2,061 (+1920.59%)
Mutual labels:  static-analysis, program-analysis
tiro
TIRO - A hybrid iterative deobfuscation framework for Android applications
Stars: ✭ 20 (-80.39%)
Mutual labels:  static-analysis, program-analysis
iec-checker
Static analysis of IEC 61131-3 programs
Stars: ✭ 36 (-64.71%)
Mutual labels:  static-analysis, program-analysis
Seahorn
SeaHorn Verification Framework
Stars: ✭ 270 (+164.71%)
Mutual labels:  static-analysis, program-analysis
progge.rs
Program analysis playground for a simple, imperative language
Stars: ✭ 29 (-71.57%)
Mutual labels:  static-analysis, program-analysis
Semgrep Rules
Semgrep rules registry
Stars: ✭ 140 (+37.25%)
Mutual labels:  static-analysis, program-analysis
Phasar
A LLVM-based static analysis framework.
Stars: ✭ 503 (+393.14%)
Mutual labels:  static-analysis, program-analysis
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+1257.84%)
Mutual labels:  static-analysis, program-analysis
Detect It Easy
Program for determining types of files for Windows, Linux and MacOS.
Stars: ✭ 2,982 (+2823.53%)
Mutual labels:  static-analysis, program-analysis
clam
Static Analyzer for LLVM bitcode based on Abstract Interpretation
Stars: ✭ 180 (+76.47%)
Mutual labels:  static-analysis, program-analysis
Wala
T.J. Watson Libraries for Analysis
Stars: ✭ 395 (+287.25%)
Mutual labels:  static-analysis, program-analysis
Pyre Check
Performant type-checking for python.
Stars: ✭ 5,716 (+5503.92%)
Mutual labels:  static-analysis, program-analysis
Pest
🐞 Primitive Erlang Security Tool
Stars: ✭ 79 (-22.55%)
Mutual labels:  static-analysis
Patdroid
A Program Analysis Toolkit for Android
Stars: ✭ 95 (-6.86%)
Mutual labels:  program-analysis
Tenkawa Php Language Server
Language server for PHP, with powerful static analysis and type inference.
Stars: ✭ 78 (-23.53%)
Mutual labels:  static-analysis

Crab: A C++ Library for Building Program Static Analyses

crab logo
Windows Ubuntu OS X Coverage
TBD TBD

Description

Crab (CoRnucopia of ABstractions) is a C++ library for building program static analyses based on Abstract Interpretation.

Crab does not analyze directly a mainstream programming language such as C/C++ or Java but instead it analyzes its own CFG-based intermediate representation (CrabIR). This allows building analyses for different programming languages assuming a translator to CrabIR is available. In spite of its simple design, CrabIR is rich enough to represent languages such as LLVM bitcode.

Crab has been designed to have two kind of users:

  1. Program analysis/verification tools that want to use invariants computed by abstract interpretation.

  2. Researchers on abstract interpretation who would like to experiment with new abstract domains or fixpoint algorithms.

The available documentation can be found in our wiki.

Docker

A (nightly) pre-built version of Crab that runs all tests can be obtained using Docker:

docker pull seahorn/crab_elina:bionic
docker run -v `pwd`:/host -it seahorn/crab_elina:bionic

Requirements for compiling from sources

Crab is written in C++ and relies on the Boost library. The main requirements are:

  • Modern C++ compiler supporting c++11
  • Boost >= 1.65
  • GMP
  • MPFR (if -DCRAB_USE_APRON=ON or -DCRAB_USE_ELINA=ON)

In linux, you can install requirements typing the commands:

sudo apt-get install libboost-all-dev libboost-program-options-dev
sudo apt-get install libgmp-dev
sudo apt-get install libmpfr-dev	

Compiling from sources and installation

To install Crab, type:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=_INSTALL_DIR_ ../
cmake --build . --target install 

The Boxes/Apron/Elina domains require third-party libraries. To avoid the burden to users who are not interested in those domains, the installation of the libraries is optional.

  • If you want to use the Boxes domain then add -DCRAB_USE_LDD=ON option.

  • If you want to use the Apron library domains then add -DCRAB_USE_APRON=ON option.

  • If you want to use the Elina library domains then add -DCRAB_USE_ELINA=ON option.

Important: Apron and Elina are currently not compatible so you cannot enable -DCRAB_USE_APRON=ON and -DCRAB_USE_ELINA=ON at the same time.

For instance, to install Crab with Boxes and Apron, type:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=_INSTALL_DIR_ -DCRAB_USE_LDD=ON -DCRAB_USE_APRON=ON ../
cmake --build . --target ldd && cmake ..
cmake --build . --target apron && cmake ..	
cmake --build . --target install 	

The tests directory contains many examples of how to build programs written in CrabIR and compute invariants using different analyses and abstract domains. To compile these tests type:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=_INSTALL_DIR_ -DCRAB_USE_LDD=ON -DCRAB_USE_APRON=ON -DCRAB_ENABLE_TESTS=ON ../
cmake --build . --target ldd && cmake ..
cmake --build . --target apron && cmake ..	
cmake --build . --target install 	

and then, for instance, to run test1:

build/test-bin/test1

Using Crab in other C++ projects

To include Crab in your C++ application you need to:

  • Include the C++ header files located at the _INSTALL_DIR_/crab/include, and

  • Link your application with the Crab libraries installed in _INSTALL_DIR_/crab/lib.

If you compile with Boxes/Apron/Elina you need also to include _INSTALL_DIR_/EXT/include and link with _INSTALL_DIR_/EXT/lib where EXT=apron|elina|ldd.

CMake

If your project uses cmake then you just need to add in your project's CMakeLists.txt:

add_subdirectory(crab)
include_directories(${CRAB_INCLUDE_DIRS})

And then link your executable with ${CRAB_LIBS}

Make

If your project uses make, read this sample Makefile.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].