Giter Site home page Giter Site logo

mdimeglio / cogent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from au-ts/cogent

0.0 2.0 0.0 5.86 MB

Proof-Code Cogeneration

Home Page: http://ts.data61.csiro.au/projects/TS/cogent.pml

License: Other

Makefile 1.86% Shell 0.91% Isabelle 47.00% C 15.08% C++ 0.24% Haskell 29.10% TeX 3.36% Roff 1.14% Emacs Lisp 0.04% Vim Script 0.19% Perl 0.06% CSS 0.16% Python 0.87%

cogent's Introduction

Build Status

Cogent: Code and Proof Co-Generation

Project homepage

For general context of this project, motivation, an overview, and published papers, see our project homepage.

Installation

Instructions tested on Debian GNU/Linux 8.2 ("jessie") and Ubuntu 16.04 ("xenial"). May need to be adapted for other systems.

Install dependencies from the Debian repository.

sudo apt-get install git # git
sudo apt-get install python-lxml python-psutil python-pycparser # regression tester

To install the Cogent compiler, consult file cogent/README.md for details.

l4v, isabelle and z3 are submodules that the Cogent framework depends on. To get them: git submodule update --init --recursive.

If you already have them on your machine, you can use your local copies, by checking out the compatible revisions:

  • l4v: ffc7b107e5bd5978295da61f64ea87b9ea3ad4d1
  • isabelle: any Isabelle2017 revision
  • z3: see cogent/INSTALL.md for more information

Add isabelle/bin to your PATH: export PATH="$(pwd)/isabelle/bin:$PATH" If you have an existing Isabelle install, you may want to set ISABELLE_IDENTIFIER instead of PATH.

Initialise Isabelle and install components:

isabelle components -I
isabelle components -a

Consult Isabelle manual for more information.

For more customised settings to run proofs and regression tests, modify build-env.sh.

Note: also see Proofs and Regression tests below.

Regression tests

Run build system and regression tests. (ETA: 2โ€“3 CPU hours) This also builds the Cogent compiler and Isabelle theories. If this works, your install is probably ok. Run ./run_tests.

For C-refinement proofs, which are excluded from the regression tests because of their size, follow instructions in Proofs section.

Proofs

To build the proofs, it is recommended that your machine (or virtual machine) provides 32G of memory and 4โ€“8 CPU threads.

# Build compilation correctness proof for ext2. (ETA: 120 CPU hours)
(cd impl/fs/ext2/cogent;
 make verification;
 isabelle build -d plat/verification -d ../../../../cogent/isa -d ../../../../l4v -b Ext2_AllRefine)

# Build compilation correctness proof for BilbyFs. (ETA: 120 CPU hours)
(cd impl/fs/bilby/cogent;
 make verification;
 patch -d plat/verification < ../../../../BilbyFs_CorresProof.patch;
 isabelle build -d . -d ../../../../cogent/isa -d ../../../../l4v -b -o process_output_limit=999 BilbyFs_AllRefine)

# View end-to-end theorems. Each theory has a "print_theorems" command for this.
# For ext2:
isabelle jedit -d impl/ext2/cogent/plat/verification -d cogent/isa -d l4v -l Ext2_CorresProof impl/fs/ext2/cogent/plat/verification/Ext2_AllRefine.thy
# For BilbyFs:
isabelle jedit -d impl/fs/bilby/cogent/plat/verification -d cogent/isa -d l4v -l BilbyFs_CorresProof impl/fs/bilby/cogent/plat/verification/BilbyFs_AllRefine.thy

The functional correctness proofs for BilbyFs's sync and iget operations are in impl/fs/bilby/proof/. They are built as part of the regression tests, and can be rebuilt with

regression/run_tests.py -x l4v -x isabelle -v sync iget

File systems

See impl/fs/ext2/README and impl/fs/bilby/README for more information on how to build the kernel modules

Directory

  • cogent: Cogent compiler
  • c-refinement: Isabelle/HOL theories and proof procedures for Cogent-C refinement
    • tests: Cogent test programs for proof procedures
  • isa-parser: Haskell library for parsing and pretty-printing Isabelle/HOL
  • impl: Systems implemented in Cogent
    • fs: File systems
      • bilby: Bilby file system
        • cogent: Cogent code for BilbyFs
        • c: C implementation for BilbyFs
        • proof: Functional correctness specs and proofs for BilbyFs
      • ext2: ext2 file system
        • cogent: Cogent code for ext2
  • regression: Regression test script

cogent's People

Contributors

vjackson725 avatar ajaysusarla avatar liamoc avatar azreika avatar cartazio avatar craigem avatar tranma avatar

Watchers

 avatar Zilin Chen 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.