GithubHelp home page GithubHelp logo

noyafangzhou / sparta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/sparta

0.0 1.0 0.0 375 KB

SPARTA is a library that provides the basic blocks for building high-performance static code analyzers based on Abstract Interpretation.

License: MIT License

CMake 1.22% Shell 0.08% C++ 98.70%

sparta's Introduction

SPARTA

SPARTA is a library of software components specially designed for building high-performance static analyzers based on the theory of Abstract Interpretation.

Abstract Interpretation

Abstract Interpretation is a theory of semantic approximation that provides a foundational framework for the design of static program analyzers. Static analyzers built following the methodology of Abstract Interpretation are mathematically sound, i.e., the semantic information they compute is guaranteed to hold in all possible execution contexts considered. Moreover, these analyzers are able to infer complex properties of programs, the expressiveness of which can be finely tuned in order to control the analysis time. Static analyzers based on Abstract Interpretation are routinely used to perform the formal verification of flight software in the aerospace industry, for example.

Why SPARTA?

Building an industrial-grade static analysis tool based on Abstract Interpretation from scratch is a daunting task that requires the attention of experts in the field. The purpose of SPARTA is to drastically simplify the engineering of Abstract Interpretation by providing a set of software components that have a simple API, are highly performant and can be easily assembled to build a production-quality static analyzer. By encapsulating the complex implementation details of Abstract Interpretation, SPARTA lets the tool developer focus on the three fundamental axes in the design of an analysis:

  • Semantics: the program properties to analyze (range of numerical variables, aliasing relation, etc.)
  • Partitioning: the granularity of the properties analyzed (intraprocedural, interprocedural, context-sensitive, etc.)
  • Abstraction: the representation of the program properties (sign, interval, alias graph, etc.)

SPARTA is an acronym that stands for Semantics, PARTitioning and Abstraction.

Using SPARTA

A detailed documentation for SPARTA can be found in the code of the library itself. It includes code samples, typical use cases and references to the literature. Additionally, the unit tests are a good illustration of how to use the API. The unit test for the fixpoint iterator, in particular, implements a complete analysis (live variables) for a simple language.

SPARTA is the analytic engine that powers most optimization passes of the ReDex Android bytecode optimizer. The ReDex codebase contains multiple examples of analyses built with SPARTA that run at industrial scale. The interprocedural constant propagation illustrates how to assemble the building blocks provided by SPARTA in order to implement a sophisticated yet scalable analysis.

Dependencies

SPARTA requires Boost 1.71 or later.

macOS

You will need Xcode with the command line tools installed. To get the command line tools, please use:

xcode-select --install

Boost can be obtained via homebrew:

brew install boost

Ubuntu (64-bit)

On Ubuntu 16.04 or later, Boost can be installed through the package manager:

sudo apt-get install libboost-all-dev

For earlier versions of Ubuntu, we provide a script to install Boost:

sudo ./get_boost.sh

Setup

SPARTA is a header-only C++ library. You can just copy the contents of the include directory to any location in the include path of your compiler.

We also provide a quick setup using cmake that builds all the tests:

# Assume you are in the SPARTA directory
mkdir build-cmake
cd build-cmake
# .. is the root source directory of SPARTA
cmake ..
cmake --build .

To run the unit tests, please type:

./sparta_test

To copy the header files into /usr/local/include/sparta and set up a cmake library for SPARTA, you can use the following command:

sudo make install

Issues

Issues on GitHub are assigned priorities which reflect their urgency and how soon they are likely to be addressed.

  • P0: Unbreak now! A serious issue which should have someone working on it right now.
  • P1: High Priority. An important issue that someone should be actively working on.
  • P2: Mid Priority. An important issue which is in the queue to be processed soon.
  • P3: Low Priority. An important issue which may get dealt with at a later date.
  • P4: Wishlist. An issue with merit but low priority which is up for grabs but likely to be pruned if not addressed after a reasonable period.

License

SPARTA is MIT-licensed, see the LICENSE file in the root directory of this source tree.

sparta's People

Contributors

ssj933 avatar yuxuanchen1997 avatar arnaudvenet avatar ntillmann avatar int3 avatar agampe avatar skkeem avatar zertosh avatar zpao avatar rybalkinsd avatar thezhangwei avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.