GithubHelp home page GithubHelp logo

bedrocksystems / brick Goto Github PK

View Code? Open in Web Editor NEW
65.0 5.0 9.0 77.67 MB

Formalization of C++ for verification purposes.

Home Page: https://bedrocksystems.github.io/BRiCk

License: Other

CMake 0.10% Makefile 0.22% HTML 0.06% JavaScript 0.26% CSS 0.24% C++ 10.86% Awk 0.04% Coq 85.86% Shell 0.12% Raku 1.15% Perl 1.11%
coq coq-formalization coq-library cplusplus cplusplus-11 cplusplus-14 cplusplus-17

brick's Introduction

BRiCk

A program logic for verifying concurrent C++ in Coq.

Running

As a standalone tool

cpp2v -v -names XXX_names.v -o XXX_cpp.v XXX.cpp -- ...clang options...

Build & Dependencies

The following scripts should work, but you can customize them based on your needs. They must be run inside a clone of this repository.

Our instructions are for Linux (Ubuntu) and OSX.

  • LLVM 16 or greater (we've tested against 16, 17)
  • cmake
  • opam 2

Native dependencies: Linux (Ubuntu)

# NOTE: This is out of date.
# For Ubuntu 22.04 LTS:
sudo apt install llvm-14 llvm-14-dev clang-14 libclang-14-dev libclang-cpp14-dev
# For Ubuntu 22.10 (tested 1 Nov 2022):
sudo apt install llvm-15 llvm-15-dev clang-15 libclang-15-dev libclang-cpp15-dev mlir-15-tools libmlir-15-dev clang-tools-15 clang-tidy-15 clangd-15
sudo apt install cmake opam

Native dependencies: OSX

For OSX we recommend clang 11 due to issues linking with clang 12:

brew install llvm@16 cmake opam
export PATH=/usr/local/opt/llvm@16/bin:${PATH}

Build

The script below uses 4 cores, customize as needed.

# install opam dependencies
eval $(opam env)
# The first time, run:
opam repo add coq-released https://coq.inria.fr/opam/released
opam repo add iris-dev https://gitlab.mpi-sws.org/iris/opam.git
# install cpp2v Coq library and Coq dependencies
opam update
opam pin -n coq-cpp2v .
opam pin -n coq-cpp2v-bin .
opam install coq coq-cpp2v coq-cpp2v-bin
# install cpp2v binary

Examples

See the examples in the tests directory. More examples will be added as the feature set evolves.

You can run the tests with:

$ make test

Repository Layout

  • The implementation of the cpp2v tool is in src and include.
  • The definition of the accompanying Coq data types is in theories/lang/cpp/syntax directory. The notation in theories/lang/cpp/parser.v is used to setup the environment for the generated code.
  • The axiomatic semantics of the abstract syntax tree is defined in the theories/lang/cpp/logic directory.

Coq IDEs

The following command creates a _CoqProject file for use by Coq IDEs.

$ ln -s _CoqProject.template _CoqProject

brick's People

Contributors

aa755 avatar arjunvish avatar blaisorblade avatar ckbr avatar ismailkuru avatar janno avatar jihgfee avatar jmgrosen avatar julienfreche avatar lysxia avatar mackieloeffel avatar nateyazdani avatar rlepigre avatar yoichi-at-bedrock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

brick's Issues

This repo has the wrong name

What you have in this repo, as I understand it, is a program logic for C++ based on separation logic, along with proof automation tactics to help the user apply the program logic to the program. And incidentally a front-end that parses C++ programs and prints the Abstract Syntax Trees out (as Coq inductive types) into a .v file.

And yet the entire repo is named "cpp2v", as if this incidental front-end component were the substance of the entire project.

You know, if the README is misleading or something, that's easy to fix later. But if I want to tell people about the cool work that you're doing, then it will be rather disruptive if the name of the repo changes. So if you're going to change the name of the repo, I'd suggest sooner rather than later.

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.