Giter Site home page Giter Site logo

madaomax / metalift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metalift/metalift

0.0 0.0 0.0 43.78 MB

A program synthesis framework for verified lifting applications

Home Page: https://metalift.pages.dev

Shell 0.07% JavaScript 0.17% C++ 0.34% Python 10.31% C 0.18% Java 1.58% Racket 2.60% CSS 0.05% Nix 0.03% CMake 0.02% LLVM 83.86% SMT 0.77%

metalift's Introduction

A program synthesis framework for verified lifting applications

Get Started at metalift.pages.dev

See tests folder for test cases. Check out any of the python files in that folder to see how to define your target language and build your own lifting based compiler. Do not use main.py.

We currently support Rosette (and cvc5 but cvc5 has been flaky) as the synthesis backend, and Z3 as the verifier.

LLVM instructions

We currently support LLVM 11

Run the following to build the LLVM pass for processing branch instructions (works for LLVM 11):

cd llvm-pass
mkdir build
cd build
cmake ..
make 
cd ..

Then run it with:

opt -load build/addEmptyBlocks/libAddEmptyBlocksPass.so -addEmptyBlock -S <.ll name>

This pass is called in tests/compile-add-blocks.

Deprecated instructions from earlier version

To run synthesis, build CVC5 from source, run configure with debug and then build.

Then run metalift from main.py.

Example synthesis usage: main.py tests/while4.ll tests/while4-grammar.sl tests/out.smt test tests/while4.loops <path to cvc5>

Example verification usage (using pre-generated answer): main.py tests/while4.ll tests/while4-ans.smt tests/out.smt test tests/while4.loops This prints the verification file to out.smt that can be run using an external solver (e.g., z3)

Set up with Nix

To get a development environment up and running, one option is to use Nix, which can automatically pull and build the necessary dependencies. First, you'll need to install Nix. Note that this will require temporary root access as Nix sets up a daemon to handle builds, and will set up a separate volume for storing build artifacts if on macOS.

Once you've got Nix installed, you'll need to enable flakes.

Then, all you have to do is navigate to the Metalift directory and run the following command:

$ nix develop

This will build all of Metalift's dependencies and drop you into a temporary shell with all the dependencies available.

Note: you still will need to install Racket and Rosette separately. There is a solution for doing this through Nix, but it requires nix-ld to be installed and is generally not recommended unless you run NixOS.

Install Python Dependencies

We use Poetry for dependency management. To set up the environment, simply install Poetry, run poetry install, and then poetry shell to enter an environment with the dependencies installed.

metalift's People

Contributors

akcheung avatar shadaj avatar sahilbhatia17 avatar maaz139 avatar dependabot[bot] avatar jwong8314 avatar jieqiu0630 avatar starptr avatar davidmwei avatar firebolt55439 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.